Клиенты API#

Для взаимодействия с контроллером по API можно использовать следующие типы клиентов:

  • браузер;

  • утилиту curl;

  • специальные приложения, часто называемые REST API clients;

  • расширения для браузера (например, Postman);

  • программу на любом языке программирования (например, Python).

Браузер#

Примечание

Доступ к API с помощью браузера возможен только после прохождения авторизации в графическом интерфейсе контроллера.

В адресной строке браузера введите https://<address>/api/, где <address> – FQDN или IP-адрес контроллера. При выборе любой точки доступа API (API endpoint) отображается страница с результатом GET-запроса к ней. Например, по адресу https://<address>/api/gateway/v1/ вы увидите результат запроса на получение списка всех доступных точек доступа шлюза. А по адресу https://<address>/api/gateway/v1/ping/ вы увидите результат выполнения команды GET /api/gateway/v1/ping/, которая используется для проверки доступности сервера через API.

Утилита curl#

Чтобы улучшить формат вывода JSON, в дополнение к утилите curl установите утилиту jq, с помощью команды:

sudo apt install jq

Для составления curl-запроса используйте шаблон:

curl -X GET --user <username>:<password> https://<address>/api/<component>/<api_endpoint> -k -s | jq .

Здесь:

  • -X GET – метод HTTP, который вы хотите использовать в своем запросе. GET используется для запроса данных с сервера.

  • --user <username>:<password> – ключ, в котором необходимо указать название учетной записи пользователя и пароль для аутентификации на сервере.

  • https://<address>/api/<component>/<api_endpoint> – URI, на который отправляется запрос.

  • <address> – FQDN или IP-адрес контроллера.

  • <api_endpoint> – точка доступа API (URI), к которой делается запрос.

  • -k или --insecure – флаг, позволяющий утилите curl игнорировать проверки сертификата SSL. Это может быть полезно для тестов или в случаях, когда используются самоподписанные сертификаты.

  • -s или --silent – флаг, отключающий индикаторы прогресса и сообщения об ошибках.

  • jq – утилита для фильтрации и преобразования данных JSON.

Примеры использования curl#

Обращение к корневой точке доступа API:

curl -X GET -k https://<address>/api/ | jq .

Пример вывода команды:

{
   "description": "AAP gateway REST API",
   "apis": {
      "gateway": "/api/gateway/",
      "controller": "/api/controller/",
      "eda": "/api/eda/",
      "galaxy": "/api/galaxy/"
   }
}

Получение списка всех точек доступа шлюза:

curl -X GET -k https://<address>/api/gateway/v1/ | jq .
Пример вывода команды:
{
  "activitystream": "/api/gateway/v1/activitystream/",
  "applications": "/api/gateway/v1/applications/",
  "authenticator_maps": "/api/gateway/v1/authenticator_maps/",
  "authenticator_plugins": "/api/gateway/v1/authenticator_plugins/",
  "authenticator_users": "/api/gateway/v1/authenticator_users/",
  "authenticators": "/api/gateway/v1/authenticators/",
  "http_ports": "/api/gateway/v1/http_ports/",
  "legacy_auth": "/api/gateway/v1/legacy_auth/",
  "me": "/api/gateway/v1/me/",
  "organizations": "/api/gateway/v1/organizations/",
  "ping": "/api/gateway/v1/ping/",
  "role_definitions": "/api/gateway/v1/role_definitions/",
  "role_team_assignments": "/api/gateway/v1/role_team_assignments/",
  "role_user_assignments": "/api/gateway/v1/role_user_assignments/",
  "routes": "/api/gateway/v1/routes/",
  "service_clusters": "/api/gateway/v1/service_clusters/",
  "service_keys": "/api/gateway/v1/service_keys/",
  "service_nodes": "/api/gateway/v1/service_nodes/",
  "services": "/api/gateway/v1/services/",
  "session": "/api/gateway/v1/session/",
  "settings": "/api/gateway/v1/settings/",
  "status": "/api/gateway/v1/status/",
  "teams": "/api/gateway/v1/teams/",
  "tokens": "/api/gateway/v1/tokens/",
  "trigger_definition": "/api/gateway/v1/trigger_definition/",
  "ui_auth": "/api/gateway/v1/ui_auth/",
  "users": "/api/gateway/v1/users/"
}

Получение списка шаблонов заданий:

curl -X GET --user <username>:<password> -k https://<address>/api/controller/v2/job_templates/ | jq .
Пример вывода команды:
{
  "count": 3,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 6,
      "type": "job_template",
      "url": "/api/controller/v2/job_templates/6/",
      "related": {
        "created_by": "/api/controller/v2/users/1/",
        "modified_by": "/api/controller/v2/users/1/",
        "labels": "/api/controller/v2/job_templates/6/labels/",
        "inventory": "/api/controller/v2/inventories/1/",
        "project": "/api/controller/v2/projects/5/",
        "organization": "/api/controller/v2/organizations/1/",
        "credentials": "/api/controller/v2/job_templates/6/credentials/",
        "last_job": "/api/controller/v2/jobs/5/",
        "jobs": "/api/controller/v2/job_templates/6/jobs/",
        "schedules": "/api/controller/v2/job_templates/6/schedules/",
        "activity_stream": "/api/controller/v2/job_templates/6/activity_stream/",
        "launch": "/api/controller/v2/job_templates/6/launch/",
        "webhook_key": "/api/controller/v2/job_templates/6/webhook_key/",
        "webhook_receiver": "",
        "notification_templates_started": "/api/controller/v2/job_templates/6/notification_templates_started/",
        "notification_templates_success": "/api/controller/v2/job_templates/6/notification_templates_success/",
        "notification_templates_error": "/api/controller/v2/job_templates/6/notification_templates_error/",
        "access_list": "/api/controller/v2/job_templates/6/access_list/",
        "survey_spec": "/api/controller/v2/job_templates/6/survey_spec/",
        "object_roles": "/api/controller/v2/job_templates/6/object_roles/",
        "instance_groups": "/api/controller/v2/job_templates/6/instance_groups/",
        "slice_workflow_jobs": "/api/controller/v2/job_templates/6/slice_workflow_jobs/",
        "copy": "/api/controller/v2/job_templates/6/copy/"
      },
      "summary_fields": {
        "organization": {
          "id": 1,
          "name": "Default",
          "description": "The default organization for Astra Automation"
        },
        "inventory": {
          "id": 1,
          "name": "Demo Inventory",
          "description": "",
          "has_active_failures": false,
          "total_hosts": 2,
          "hosts_with_active_failures": 0,
          "total_groups": 1,
          "has_inventory_sources": false,
          "total_inventory_sources": 0,
          "inventory_sources_with_failures": 0,
          "organization_id": 1,
          "kind": ""
        },
        "project": {
          "id": 5,
          "name": "Demo Project",
          "description": "",
          "status": "successful",
          "scm_type": "git",
          "allow_override": false
        },
        "last_job": {
          "id": 5,
          "name": "Demo Job Template",
          "description": "",
          "finished": "2025-11-16T13:39:07.609606Z",
          "status": "successful",
          "failed": false
        },
        "last_update": {
          "id": 5,
          "name": "Demo Job Template",
          "description": "",
          "status": "successful",
          "failed": false
        },
        "created_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "modified_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "object_roles": {
          "admin_role": {
            "description": "Can manage all aspects of the job template",
            "name": "Admin",
            "id": 37
          },
          "execute_role": {
            "description": "May run the job template",
            "name": "Execute",
            "id": 38
          },
          "read_role": {
            "description": "May view settings for the job template",
            "name": "Read",
            "id": 39
          }
        },
        "user_capabilities": {
          "edit": true,
          "delete": true,
          "start": true,
          "schedule": true,
          "copy": true
        },
        "labels": {
          "count": 0,
          "results": []
        },
        "recent_jobs": [
          {
            "id": 5,
            "status": "successful",
            "finished": "2025-11-16T13:39:07.609606Z",
            "canceled_on": null,
            "type": "job"
          },
          {
            "id": 1,
            "status": "successful",
            "finished": "2025-11-13T10:39:26.478610Z",
            "canceled_on": null,
            "type": "job"
          }
        ],
        "credentials": [
          {
            "id": 1,
            "name": "Demo Credential",
            "description": "",
            "kind": "ssh",
            "cloud": false
          }
        ]
      },
      "created": "2025-11-12T10:21:57.002351Z",
      "modified": "2025-11-12T10:21:57.002361Z",
      "name": "Demo Job Template",
      "description": "",
      "job_type": "run",
      "inventory": 1,
      "project": 5,
      "playbook": "hello_world.yml",
      "scm_branch": "",
      "forks": 0,
      "limit": "",
      "verbosity": 0,
      "extra_vars": "",
      "job_tags": "",
      "force_handlers": false,
      "skip_tags": "",
      "start_at_task": "",
      "timeout": 0,
      "use_fact_cache": false,
      "organization": 1,
      "last_job_run": "2025-11-16T13:39:07.609606Z",
      "last_job_failed": false,
      "next_job_run": null,
      "status": "successful",
      "execution_environment": null,
      "host_config_key": "",
      "ask_scm_branch_on_launch": false,
      "ask_diff_mode_on_launch": false,
      "ask_variables_on_launch": false,
      "ask_limit_on_launch": false,
      "ask_tags_on_launch": false,
      "ask_skip_tags_on_launch": false,
      "ask_job_type_on_launch": false,
      "ask_verbosity_on_launch": false,
      "ask_inventory_on_launch": false,
      "ask_credential_on_launch": false,
      "ask_execution_environment_on_launch": false,
      "ask_labels_on_launch": false,
      "ask_forks_on_launch": false,
      "ask_job_slice_count_on_launch": false,
      "ask_timeout_on_launch": false,
      "ask_instance_groups_on_launch": false,
      "survey_enabled": false,
      "become_enabled": false,
      "diff_mode": false,
      "allow_simultaneous": false,
      "custom_virtualenv": null,
      "job_slice_count": 1,
      "webhook_service": "",
      "webhook_credential": null,
      "prevent_instance_group_fallback": false
    },
    {
      "id": 8,
      "type": "job_template",
      "url": "/api/controller/v2/job_templates/8/",
      "related": {
        "created_by": "/api/controller/v2/users/1/",
        "modified_by": "/api/controller/v2/users/1/",
        "labels": "/api/controller/v2/job_templates/8/labels/",
        "inventory": "/api/controller/v2/inventories/1/",
        "project": "/api/controller/v2/projects/7/",
        "organization": "/api/controller/v2/organizations/1/",
        "credentials": "/api/controller/v2/job_templates/8/credentials/",
        "last_job": "/api/controller/v2/jobs/7/",
        "execution_environment": "/api/controller/v2/execution_environments/2/",
        "jobs": "/api/controller/v2/job_templates/8/jobs/",
        "schedules": "/api/controller/v2/job_templates/8/schedules/",
        "activity_stream": "/api/controller/v2/job_templates/8/activity_stream/",
        "launch": "/api/controller/v2/job_templates/8/launch/",
        "webhook_key": "/api/controller/v2/job_templates/8/webhook_key/",
        "webhook_receiver": "",
        "notification_templates_started": "/api/controller/v2/job_templates/8/notification_templates_started/",
        "notification_templates_success": "/api/controller/v2/job_templates/8/notification_templates_success/",
        "notification_templates_error": "/api/controller/v2/job_templates/8/notification_templates_error/",
        "access_list": "/api/controller/v2/job_templates/8/access_list/",
        "survey_spec": "/api/controller/v2/job_templates/8/survey_spec/",
        "object_roles": "/api/controller/v2/job_templates/8/object_roles/",
        "instance_groups": "/api/controller/v2/job_templates/8/instance_groups/",
        "slice_workflow_jobs": "/api/controller/v2/job_templates/8/slice_workflow_jobs/",
        "copy": "/api/controller/v2/job_templates/8/copy/"
      },
      "summary_fields": {
        "organization": {
          "id": 1,
          "name": "Default",
          "description": "The default organization for Astra Automation"
        },
        "inventory": {
          "id": 1,
          "name": "Demo Inventory",
          "description": "",
          "has_active_failures": false,
          "total_hosts": 2,
          "hosts_with_active_failures": 0,
          "total_groups": 1,
          "has_inventory_sources": false,
          "total_inventory_sources": 0,
          "inventory_sources_with_failures": 0,
          "organization_id": 1,
          "kind": ""
        },
        "execution_environment": {
          "id": 2,
          "name": "Default execution environment",
          "description": "",
          "image": "hub.astra-automation.ru/aa-1.2/aa-full-ee:latest"
        },
        "project": {
          "id": 7,
          "name": "NGINX",
          "description": "",
          "status": "successful",
          "scm_type": "git",
          "allow_override": false
        },
        "last_job": {
          "id": 7,
          "name": "Project example",
          "description": "",
          "finished": "2025-11-17T06:13:48.687932Z",
          "status": "successful",
          "failed": false
        },
        "last_update": {
          "id": 7,
          "name": "Project example",
          "description": "",
          "status": "successful",
          "failed": false
        },
        "created_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "modified_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "object_roles": {
          "admin_role": {
            "description": "Can manage all aspects of the job template",
            "name": "Admin",
            "id": 61
          },
          "execute_role": {
            "description": "May run the job template",
            "name": "Execute",
            "id": 62
          },
          "read_role": {
            "description": "May view settings for the job template",
            "name": "Read",
            "id": 63
          }
        },
        "user_capabilities": {
          "edit": true,
          "delete": true,
          "start": true,
          "schedule": true,
          "copy": true
        },
        "labels": {
          "count": 0,
          "results": []
        },
        "recent_jobs": [
          {
            "id": 7,
            "status": "successful",
            "finished": "2025-11-17T06:13:48.687932Z",
            "canceled_on": null,
            "type": "job"
          }
        ],
        "credentials": []
      },
      "created": "2025-11-17T06:12:24.272767Z",
      "modified": "2025-11-17T06:12:24.272789Z",
      "name": "Project example",
      "description": "",
      "job_type": "run",
      "inventory": 1,
      "project": 7,
      "playbook": "example.yaml",
      "scm_branch": "",
      "forks": 0,
      "limit": "",
      "verbosity": 0,
      "extra_vars": "",
      "job_tags": "",
      "force_handlers": false,
      "skip_tags": "",
      "start_at_task": "",
      "timeout": 0,
      "use_fact_cache": false,
      "organization": 1,
      "last_job_run": "2025-11-17T06:13:48.687932Z",
      "last_job_failed": false,
      "next_job_run": null,
      "status": "successful",
      "execution_environment": 2,
      "host_config_key": "",
      "ask_scm_branch_on_launch": false,
      "ask_diff_mode_on_launch": false,
      "ask_variables_on_launch": false,
      "ask_limit_on_launch": false,
      "ask_tags_on_launch": false,
      "ask_skip_tags_on_launch": false,
      "ask_job_type_on_launch": false,
      "ask_verbosity_on_launch": false,
      "ask_inventory_on_launch": false,
      "ask_credential_on_launch": false,
      "ask_execution_environment_on_launch": false,
      "ask_labels_on_launch": false,
      "ask_forks_on_launch": false,
      "ask_job_slice_count_on_launch": false,
      "ask_timeout_on_launch": false,
      "ask_instance_groups_on_launch": false,
      "survey_enabled": false,
      "become_enabled": false,
      "diff_mode": false,
      "allow_simultaneous": false,
      "custom_virtualenv": null,
      "job_slice_count": 1,
      "webhook_service": "",
      "webhook_credential": null,
      "prevent_instance_group_fallback": false
    },
    {
      "id": 9,
      "type": "job_template",
      "url": "/api/controller/v2/job_templates/9/",
      "related": {
        "created_by": "/api/controller/v2/users/1/",
        "modified_by": "/api/controller/v2/users/1/",
        "labels": "/api/controller/v2/job_templates/9/labels/",
        "inventory": "/api/controller/v2/inventories/1/",
        "project": "/api/controller/v2/projects/7/",
        "organization": "/api/controller/v2/organizations/1/",
        "credentials": "/api/controller/v2/job_templates/9/credentials/",
        "last_job": "/api/controller/v2/jobs/8/",
        "execution_environment": "/api/controller/v2/execution_environments/2/",
        "jobs": "/api/controller/v2/job_templates/9/jobs/",
        "schedules": "/api/controller/v2/job_templates/9/schedules/",
        "activity_stream": "/api/controller/v2/job_templates/9/activity_stream/",
        "launch": "/api/controller/v2/job_templates/9/launch/",
        "webhook_key": "/api/controller/v2/job_templates/9/webhook_key/",
        "webhook_receiver": "",
        "notification_templates_started": "/api/controller/v2/job_templates/9/notification_templates_started/",
        "notification_templates_success": "/api/controller/v2/job_templates/9/notification_templates_success/",
        "notification_templates_error": "/api/controller/v2/job_templates/9/notification_templates_error/",
        "access_list": "/api/controller/v2/job_templates/9/access_list/",
        "survey_spec": "/api/controller/v2/job_templates/9/survey_spec/",
        "object_roles": "/api/controller/v2/job_templates/9/object_roles/",
        "instance_groups": "/api/controller/v2/job_templates/9/instance_groups/",
        "slice_workflow_jobs": "/api/controller/v2/job_templates/9/slice_workflow_jobs/",
        "copy": "/api/controller/v2/job_templates/9/copy/"
      },
      "summary_fields": {
        "organization": {
          "id": 1,
          "name": "Default",
          "description": "The default organization for Astra Automation"
        },
        "inventory": {
          "id": 1,
          "name": "Demo Inventory",
          "description": "",
          "has_active_failures": false,
          "total_hosts": 2,
          "hosts_with_active_failures": 0,
          "total_groups": 1,
          "has_inventory_sources": false,
          "total_inventory_sources": 0,
          "inventory_sources_with_failures": 0,
          "organization_id": 1,
          "kind": ""
        },
        "execution_environment": {
          "id": 2,
          "name": "Default execution environment",
          "description": "",
          "image": "hub.astra-automation.ru/aa-1.2/aa-full-ee:latest"
        },
        "project": {
          "id": 7,
          "name": "NGINX",
          "description": "",
          "status": "successful",
          "scm_type": "git",
          "allow_override": false
        },
        "last_job": {
          "id": 8,
          "name": "Web project example template",
          "description": "",
          "finished": "2025-11-17T07:12:10.043589Z",
          "status": "successful",
          "failed": false
        },
        "last_update": {
          "id": 8,
          "name": "Web project example template",
          "description": "",
          "status": "successful",
          "failed": false
        },
        "created_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "modified_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "object_roles": {
          "admin_role": {
            "description": "Can manage all aspects of the job template",
            "name": "Admin",
            "id": 64
          },
          "execute_role": {
            "description": "May run the job template",
            "name": "Execute",
            "id": 65
          },
          "read_role": {
            "description": "May view settings for the job template",
            "name": "Read",
            "id": 66
          }
        },
        "user_capabilities": {
          "edit": true,
          "delete": true,
          "start": true,
          "schedule": true,
          "copy": true
        },
        "labels": {
          "count": 0,
          "results": []
        },
        "recent_jobs": [
          {
            "id": 8,
            "status": "successful",
            "finished": "2025-11-17T07:12:10.043589Z",
            "canceled_on": null,
            "type": "job"
          }
        ],
        "credentials": []
      },
      "created": "2025-11-17T07:10:34.194253Z",
      "modified": "2025-11-17T07:10:34.194283Z",
      "name": "Web project example template",
      "description": "",
      "job_type": "run",
      "inventory": 1,
      "project": 7,
      "playbook": "example.yaml",
      "scm_branch": "",
      "forks": 0,
      "limit": "",
      "verbosity": 0,
      "extra_vars": "",
      "job_tags": "",
      "force_handlers": false,
      "skip_tags": "",
      "start_at_task": "",
      "timeout": 0,
      "use_fact_cache": false,
      "organization": 1,
      "last_job_run": "2025-11-17T07:12:10.043589Z",
      "last_job_failed": false,
      "next_job_run": null,
      "status": "successful",
      "execution_environment": 2,
      "host_config_key": "",
      "ask_scm_branch_on_launch": false,
      "ask_diff_mode_on_launch": false,
      "ask_variables_on_launch": false,
      "ask_limit_on_launch": false,
      "ask_tags_on_launch": false,
      "ask_skip_tags_on_launch": false,
      "ask_job_type_on_launch": false,
      "ask_verbosity_on_launch": false,
      "ask_inventory_on_launch": false,
      "ask_credential_on_launch": false,
      "ask_execution_environment_on_launch": false,
      "ask_labels_on_launch": false,
      "ask_forks_on_launch": false,
      "ask_job_slice_count_on_launch": false,
      "ask_timeout_on_launch": false,
      "ask_instance_groups_on_launch": false,
      "survey_enabled": false,
      "become_enabled": false,
      "diff_mode": false,
      "allow_simultaneous": false,
      "custom_virtualenv": null,
      "job_slice_count": 1,
      "webhook_service": "",
      "webhook_credential": null,
      "prevent_instance_group_fallback": false
    }
  ]
}

Запуск задания из шаблона:

curl -X POST --user <username>:<password> -k https://<address>/api/controller/v2/job_templates/6/launch/ | jq .
Пример вывода команды:
{
  "job": 12,
  "ignored_fields": {},
  "id": 12,
  "type": "job",
  "url": "/api/controller/v2/jobs/12/",
  "related": {
    "created_by": "/api/controller/v2/users/1/",
    "modified_by": "/api/controller/v2/users/1/",
    "labels": "/api/controller/v2/jobs/12/labels/",
    "inventory": "/api/controller/v2/inventories/1/",
    "project": "/api/controller/v2/projects/5/",
    "organization": "/api/controller/v2/organizations/1/",
    "credentials": "/api/controller/v2/jobs/12/credentials/",
    "unified_job_template": "/api/controller/v2/job_templates/6/",
    "stdout": "/api/controller/v2/jobs/12/stdout/",
    "job_events": "/api/controller/v2/jobs/12/job_events/",
    "job_host_summaries": "/api/controller/v2/jobs/12/job_host_summaries/",
    "activity_stream": "/api/controller/v2/jobs/12/activity_stream/",
    "notifications": "/api/controller/v2/jobs/12/notifications/",
    "create_schedule": "/api/controller/v2/jobs/12/create_schedule/",
    "job_template": "/api/controller/v2/job_templates/6/",
    "cancel": "/api/controller/v2/jobs/12/cancel/",
    "relaunch": "/api/controller/v2/jobs/12/relaunch/"
  },
  "summary_fields": {
    "organization": {
      "id": 1,
      "name": "Default",
      "description": "The default organization for Astra Automation"
    },
    "inventory": {
      "id": 1,
      "name": "Demo Inventory",
      "description": "",
      "has_active_failures": true,
      "total_hosts": 2,
      "hosts_with_active_failures": 1,
      "total_groups": 1,
      "has_inventory_sources": false,
      "total_inventory_sources": 0,
      "inventory_sources_with_failures": 0,
      "organization_id": 1,
      "kind": ""
    },
    "project": {
      "id": 5,
      "name": "Demo Project",
      "description": "",
      "status": "successful",
      "scm_type": "git",
      "allow_override": false
    },
    "job_template": {
      "id": 6,
      "name": "Demo Job Template",
      "description": ""
    },
    "unified_job_template": {
      "id": 6,
      "name": "Demo Job Template",
      "description": "",
      "unified_job_type": "job"
    },
    "created_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "modified_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "user_capabilities": {
      "delete": true,
      "start": true
    },
    "labels": {
      "count": 0,
      "results": []
    },
    "credentials": [
      {
        "id": 1,
        "name": "Demo Credential",
        "description": "",
        "kind": "ssh",
        "cloud": false
      }
    ]
  },
  "created": "2025-11-21T14:30:06.495914Z",
  "modified": "2025-11-21T14:30:06.747492Z",
  "name": "Demo Job Template",
  "description": "",
  "job_type": "run",
  "inventory": 1,
  "project": 5,
  "playbook": "hello_world.yml",
  "scm_branch": "",
  "forks": 0,
  "limit": "",
  "verbosity": 0,
  "extra_vars": "{}",
  "job_tags": "",
  "force_handlers": false,
  "skip_tags": "",
  "start_at_task": "",
  "timeout": 0,
  "use_fact_cache": false,
  "organization": 1,
  "unified_job_template": 6,
  "launch_type": "manual",
  "status": "pending",
  "execution_environment": null,
  "failed": false,
  "started": null,
  "finished": null,
  "canceled_on": null,
  "elapsed": 0,
  "job_args": "",
  "job_cwd": "",
  "job_env": {},
  "job_explanation": "",
  "execution_node": "",
  "controller_node": "",
  "result_traceback": "",
  "event_processing_finished": false,
  "launched_by": {
    "id": 1,
    "name": "admin",
    "type": "user",
    "url": "/api/controller/v2/users/1/"
  },
  "work_unit_id": null,
  "job_template": 6,
  "passwords_needed_to_start": [],
  "allow_simultaneous": false,
  "artifacts": {},
  "scm_revision": "",
  "instance_group": null,
  "diff_mode": false,
  "job_slice_number": 0,
  "job_slice_count": 1,
  "webhook_service": "",
  "webhook_credential": null,
  "webhook_guid": ""
}

Получение токена авторизации:

curl -k -X POST \
https://<address>/api/gateway/v1/tokens/ \
-H 'Content-Type: application/json' \
-d '{
      "description": "Token description",
      "application": null,
      "user": "admin",
      "scope": "write"
   }' \
-u '<username>:<password>' | jq .
Пример вывода команды:
{
  "id": 3,
  "url": "/api/gateway/v1/tokens/3/",
  "related": {
    "activity_stream": "/api/gateway/v1/activitystream/?content_type=38&object_id=3",
    "created_by": "/api/gateway/v1/users/2/",
    "modified_by": "/api/gateway/v1/users/2/",
    "user": "/api/gateway/v1/users/2/"
  },
  "summary_fields": {
    "modified_by": {
      "id": 2,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "created_by": {
      "id": 2,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "user": {
      "id": 2,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    }
  },
  "created": "2025-11-21T14:41:45.209414Z",
  "created_by": 2,
  "modified": "2025-11-21T14:41:45.247211Z",
  "modified_by": 2,
  "expires": "3025-03-24T14:41:45.201955Z",
  "user": 2,
  "application": null,
  "description": "Token description",
  "last_used": null,
  "scope": "write",
  "token": "<your_token>",
  "refresh_token": null
}

Здесь <your_token> – токен авторизации.

Проверка статуса задания, запущенного ранее:

curl -X GET \
https://<address>/api/controller/v2/jobs/<jobs_id>/ \
-H 'Authorization: Bearer <your_token>' \
-k -s | jq .

Здесь <jobs_id> – идентификатор задания, запущенного ранее.

Пример вывода команды:
{
  "id": 12,
  "type": "job",
  "url": "/api/controller/v2/jobs/12/",
  "related": {
    "created_by": "/api/controller/v2/users/1/",
    "labels": "/api/controller/v2/jobs/12/labels/",
    "inventory": "/api/controller/v2/inventories/1/",
    "project": "/api/controller/v2/projects/5/",
    "organization": "/api/controller/v2/organizations/1/",
    "credentials": "/api/controller/v2/jobs/12/credentials/",
    "unified_job_template": "/api/controller/v2/job_templates/6/",
    "stdout": "/api/controller/v2/jobs/12/stdout/",
    "execution_environment": "/api/controller/v2/execution_environments/2/",
    "job_events": "/api/controller/v2/jobs/12/job_events/",
    "job_host_summaries": "/api/controller/v2/jobs/12/job_host_summaries/",
    "activity_stream": "/api/controller/v2/jobs/12/activity_stream/",
    "notifications": "/api/controller/v2/jobs/12/notifications/",
    "create_schedule": "/api/controller/v2/jobs/12/create_schedule/",
    "job_template": "/api/controller/v2/job_templates/6/",
    "cancel": "/api/controller/v2/jobs/12/cancel/",
    "relaunch": "/api/controller/v2/jobs/12/relaunch/"
  },
  "summary_fields": {
    "organization": {
      "id": 1,
      "name": "Default",
      "description": "The default organization for Astra Automation"
    },
    "inventory": {
      "id": 1,
      "name": "Demo Inventory",
      "description": "",
      "has_active_failures": true,
      "total_hosts": 2,
      "hosts_with_active_failures": 1,
      "total_groups": 1,
      "has_inventory_sources": false,
      "total_inventory_sources": 0,
      "inventory_sources_with_failures": 0,
      "organization_id": 1,
      "kind": ""
    },
    "execution_environment": {
      "id": 2,
      "name": "Default execution environment",
      "description": "",
      "image": "hub.astra-automation.ru/aa-1.2/aa-full-ee:latest"
    },
    "project": {
      "id": 5,
      "name": "Demo Project",
      "description": "",
      "status": "successful",
      "scm_type": "git",
      "allow_override": false
    },
    "job_template": {
      "id": 6,
      "name": "Demo Job Template",
      "description": ""
    },
    "unified_job_template": {
      "id": 6,
      "name": "Demo Job Template",
      "description": "",
      "unified_job_type": "job"
    },
    "instance_group": {
      "id": 2,
      "name": "default",
      "is_container_group": false
    },
    "created_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "user_capabilities": {
      "delete": true,
      "start": true
    },
    "labels": {
      "count": 0,
      "results": []
    },
    "credentials": [
      {
        "id": 1,
        "name": "Demo Credential",
        "description": "",
        "kind": "ssh",
        "cloud": false
      }
    ]
  },
  "created": "2025-11-21T14:30:06.495914Z",
  "modified": "2025-11-21T14:30:07.027587Z",
  "name": "Demo Job Template",
  "description": "",
  "job_type": "run",
  "inventory": 1,
  "project": 5,
  "playbook": "hello_world.yml",
  "scm_branch": "",
  "forks": 0,
  "limit": "",
  "verbosity": 0,
  "extra_vars": "{}",
  "job_tags": "",
  "force_handlers": false,
  "skip_tags": "",
  "start_at_task": "",
  "timeout": 0,
  "use_fact_cache": false,
  "organization": 1,
  "unified_job_template": 6,
  "launch_type": "manual",
  "status": "failed",
  "execution_environment": 2,
  "failed": true,
  "started": "2025-11-21T14:30:07.202079Z",
  "finished": "2025-11-21T14:30:12.733562Z",
  "canceled_on": null,
  "elapsed": 5.531,
  "job_args": "[\"podman\", \"run\", \"--rm\", \"--tty\", \"--interactive\", \"--workdir\", \"/runner/project\", \"-v\", \"/tmp/awx_12_8rgq8tz7/:/runner/:Z\", \"-v\", \"/etc/ssl/certs/:/etc/ssl/certs/:O\", \"-v\", \"/usr/local/share/ca-certificates/:/usr/local/share/ca-certificates/:O\", \"--env-file\", \"/tmp/awx_12_8rgq8tz7/artifacts/12/env.list\", \"--quiet\", \"--name\", \"ansible_runner_12\", \"--user=root\", \"--network\", \"slirp4netns:enable_ipv6=true\", \"hub.astra-automation.ru/aa-1.2/aa-full-ee:latest\", \"ansible-playbook\", \"-u\", \"admin\", \"-i\", \"/runner/inventory\", \"-e\", \"@/runner/env/extravars\", \"hello_world.yml\"]",
  "job_cwd": "/runner/project",
  "job_env": {
    "JOB_ID": "12",
    "AWX_HOST": "https://10.205.212.89",
    "INVENTORY_ID": "1",
    "MAX_EVENT_RES": "700000",
    "PROJECT_REVISION": "347e44fea036c94d5f60e544de006453ee5c71ad",
    "ANSIBLE_ROLES_PATH": "/runner/requirements_roles:~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles",
    "RUNNER_OMIT_EVENTS": "False",
    "ANSIBLE_FORCE_COLOR": "True",
    "AWX_PRIVATE_DATA_DIR": "/tmp/awx_12_8rgq8tz7",
    "ANSIBLE_UNSAFE_WRITES": "1",
    "AWX_ISOLATED_DATA_DIR": "/runner/artifacts/12",
    "ANSIBLE_STDOUT_CALLBACK": "awx_display",
    "ANSIBLE_CALLBACK_PLUGINS": "/runner/artifacts/12/callback",
    "ANSIBLE_COLLECTIONS_PATH": "/runner/requirements_collections:~/.ansible/collections:/usr/share/ansible/collections",
    "ANSIBLE_HOST_KEY_CHECKING": "False",
    "RUNNER_ONLY_FAILED_EVENTS": "False",
    "ANSIBLE_RETRY_FILES_ENABLED": "False",
    "ANSIBLE_SSH_CONTROL_PATH_DIR": "/runner/cp",
    "ANSIBLE_STANDARD_SETTINGS_FILES": "[PosixPath('/etc/ansible-automation-platform/settings.yaml'), PosixPath('/etc/ansible-automation-platform/flags.yaml'), PosixPath('/etc/ansible-automation-platform/.secrets.yaml'), PosixPath('/etc/ansible-automation-platform/awx/settings.yaml'), PosixPath('/etc/ansible-automation-platform/awx/flags.yaml'), PosixPath('/etc/ansible-automation-platform/awx/.secrets.yaml')]",
    "ANSIBLE_INVENTORY_UNPARSED_FAILED": "True",
    "ANSIBLE_PARAMIKO_RECORD_HOST_KEYS": "False"
  },
  "job_explanation": "",
  "execution_node": "10.205.212.60",
  "controller_node": "10.205.212.90",
  "result_traceback": "",
  "event_processing_finished": true,
  "launched_by": {
    "id": 1,
    "name": "admin",
    "type": "user",
    "url": "/api/controller/v2/users/1/"
  },
  "work_unit_id": "10205212902HUMxyGa",
  "job_template": 6,
  "passwords_needed_to_start": [],
  "allow_simultaneous": false,
  "artifacts": {},
  "scm_revision": "347e44fea036c94d5f60e544de006453ee5c71ad",
  "instance_group": 2,
  "diff_mode": false,
  "job_slice_number": 0,
  "job_slice_count": 1,
  "webhook_service": "",
  "webhook_credential": null,
  "webhook_guid": "",
  "host_status_counts": {
    "ok": 1,
    "dark": 1
  },
  "playbook_counts": {
    "play_count": 1,
    "task_count": 2
  },
  "custom_virtualenv": null
}

Создание проекта:

curl -X POST \
https://<address>/api/controller/v2/projects/ \
-H 'Authorization: Bearer <your_token>' \
-H 'Content-Type: application/json' \
-d '{
   "name": "New Project",
   "organization": 1,
   "scm_type": "git",
   "scm_url": "https://github.com/ansible/ansible-tower-samples"
}' \
-k -s | jq .
Пример вывода команды:
{
  "id": 10,
  "type": "project",
  "url": "/api/controller/v2/projects/10/",
  "related": {
    "named_url": "/api/controller/v2/projects/New Project++Default/",
    "created_by": "/api/controller/v2/users/1/",
    "modified_by": "/api/controller/v2/users/1/",
    "current_job": "/api/controller/v2/project_updates/13/",
    "teams": "/api/controller/v2/projects/10/teams/",
    "playbooks": "/api/controller/v2/projects/10/playbooks/",
    "inventory_files": "/api/controller/v2/projects/10/inventories/",
    "update": "/api/controller/v2/projects/10/update/",
    "project_updates": "/api/controller/v2/projects/10/project_updates/",
    "scm_inventory_sources": "/api/controller/v2/projects/10/scm_inventory_sources/",
    "schedules": "/api/controller/v2/projects/10/schedules/",
    "activity_stream": "/api/controller/v2/projects/10/activity_stream/",
    "notification_templates_started": "/api/controller/v2/projects/10/notification_templates_started/",
    "notification_templates_success": "/api/controller/v2/projects/10/notification_templates_success/",
    "notification_templates_error": "/api/controller/v2/projects/10/notification_templates_error/",
    "access_list": "/api/controller/v2/projects/10/access_list/",
    "object_roles": "/api/controller/v2/projects/10/object_roles/",
    "copy": "/api/controller/v2/projects/10/copy/",
    "organization": "/api/controller/v2/organizations/1/",
    "current_update": "/api/controller/v2/project_updates/13/"
  },
  "summary_fields": {
    "organization": {
      "id": 1,
      "name": "Default",
      "description": "The default organization for Astra Automation"
    },
    "current_update": {
      "id": 13,
      "name": "New Project",
      "description": "",
      "status": "pending",
      "failed": false
    },
    "current_job": {
      "id": 13,
      "name": "New Project",
      "description": "",
      "status": "pending",
      "failed": false
    },
    "created_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "modified_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "object_roles": {
      "admin_role": {
        "description": "Can manage all aspects of the project",
        "name": "Admin",
        "id": 99
      },
      "use_role": {
        "description": "Can use the project in a job template",
        "name": "Use",
        "id": 100
      },
      "update_role": {
        "description": "May update the project",
        "name": "Update",
        "id": 101
      },
      "read_role": {
        "description": "May view settings for the project",
        "name": "Read",
        "id": 102
      }
    },
    "user_capabilities": {
      "edit": true,
      "delete": true,
      "start": true,
      "schedule": true,
      "copy": true
    }
  },
  "created": "2025-11-21T14:49:52.871576Z",
  "modified": "2025-11-21T14:49:52.871603Z",
  "name": "New Project",
  "description": "",
  "local_path": "_10__new_project",
  "scm_type": "git",
  "scm_url": "https://github.com/ansible/ansible-tower-samples",
  "scm_branch": "",
  "scm_refspec": "",
  "scm_clean": false,
  "scm_track_submodules": false,
  "scm_delete_on_update": false,
  "credential": null,
  "timeout": 0,
  "scm_revision": "",
  "last_job_run": null,
  "last_job_failed": false,
  "next_job_run": null,
  "status": "pending",
  "organization": 1,
  "scm_update_on_launch": false,
  "scm_update_cache_timeout": 0,
  "allow_override": false,
  "custom_virtualenv": null,
  "default_environment": null,
  "signature_validation_credential": null,
  "last_update_failed": false,
  "last_updated": null
}

Изменение проекта, созданного ранее:

curl -X PATCH \
https://<address>/api/controller/v2/projects/<project_id>/ \
-H 'Authorization: Bearer <your_token>' \
-H 'Content-Type: application/json' \
-d '{
   "name": "Updated Project",
   "scm_url": "https://github.com/ansible/ansible-examples"
}' \
-k -s | jq .

Здесь <project_id> – идентификатор проекта, созданного ранее.

Пример вывода команды:
{
  "id": 10,
  "type": "project",
  "url": "/api/controller/v2/projects/10/",
  "related": {
    "named_url": "/api/controller/v2/projects/Updated Project++Default/",
    "created_by": "/api/controller/v2/users/1/",
    "modified_by": "/api/controller/v2/users/1/",
    "current_job": "/api/controller/v2/project_updates/14/",
    "last_job": "/api/controller/v2/project_updates/13/",
    "teams": "/api/controller/v2/projects/10/teams/",
    "playbooks": "/api/controller/v2/projects/10/playbooks/",
    "inventory_files": "/api/controller/v2/projects/10/inventories/",
    "update": "/api/controller/v2/projects/10/update/",
    "project_updates": "/api/controller/v2/projects/10/project_updates/",
    "scm_inventory_sources": "/api/controller/v2/projects/10/scm_inventory_sources/",
    "schedules": "/api/controller/v2/projects/10/schedules/",
    "activity_stream": "/api/controller/v2/projects/10/activity_stream/",
    "notification_templates_started": "/api/controller/v2/projects/10/notification_templates_started/",
    "notification_templates_success": "/api/controller/v2/projects/10/notification_templates_success/",
    "notification_templates_error": "/api/controller/v2/projects/10/notification_templates_error/",
    "access_list": "/api/controller/v2/projects/10/access_list/",
    "object_roles": "/api/controller/v2/projects/10/object_roles/",
    "copy": "/api/controller/v2/projects/10/copy/",
    "organization": "/api/controller/v2/organizations/1/",
    "current_update": "/api/controller/v2/project_updates/14/",
    "last_update": "/api/controller/v2/project_updates/13/"
  },
  "summary_fields": {
    "organization": {
      "id": 1,
      "name": "Default",
      "description": "The default organization for Astra Automation"
    },
    "last_job": {
      "id": 13,
      "name": "New Project",
      "description": "",
      "finished": "2025-11-21T14:50:01.025151Z",
      "status": "successful",
      "failed": false
    },
    "last_update": {
      "id": 13,
      "name": "New Project",
      "description": "",
      "status": "successful",
      "failed": false
    },
    "current_update": {
      "id": 14,
      "name": "Updated Project",
      "description": "",
      "status": "pending",
      "failed": false
    },
    "current_job": {
      "id": 14,
      "name": "Updated Project",
      "description": "",
      "status": "pending",
      "failed": false
    },
    "created_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "modified_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "object_roles": {
      "admin_role": {
        "description": "Can manage all aspects of the project",
        "name": "Admin",
        "id": 99
      },
      "use_role": {
        "description": "Can use the project in a job template",
        "name": "Use",
        "id": 100
      },
      "update_role": {
        "description": "May update the project",
        "name": "Update",
        "id": 101
      },
      "read_role": {
        "description": "May view settings for the project",
        "name": "Read",
        "id": 102
      }
    },
    "user_capabilities": {
      "edit": true,
      "delete": true,
      "start": true,
      "schedule": true,
      "copy": true
    },
    "resolved_environment": {
      "id": 2,
      "name": "Default execution environment",
      "description": "",
      "image": "hub.astra-automation.ru/aa-1.2/aa-full-ee:latest"
    }
  },
  "created": "2025-11-21T14:49:52.871576Z",
  "modified": "2025-11-21T14:55:12.985646Z",
  "name": "Updated Project",
  "description": "",
  "local_path": "_10__new_project",
  "scm_type": "git",
  "scm_url": "https://github.com/ansible/ansible-examples",
  "scm_branch": "",
  "scm_refspec": "",
  "scm_clean": false,
  "scm_track_submodules": false,
  "scm_delete_on_update": false,
  "credential": null,
  "timeout": 0,
  "scm_revision": "347e44fea036c94d5f60e544de006453ee5c71ad",
  "last_job_run": "2025-11-21T14:50:01.025151Z",
  "last_job_failed": false,
  "next_job_run": null,
  "status": "pending",
  "organization": 1,
  "scm_update_on_launch": false,
  "scm_update_cache_timeout": 0,
  "allow_override": false,
  "custom_virtualenv": null,
  "default_environment": null,
  "signature_validation_credential": null,
  "last_update_failed": false,
  "last_updated": "2025-11-21T14:50:01.025151Z"
}

Удаление проекта:

curl -k -X DELETE \
https://<address>/api/controller/v2/projects/<project_id>/ \
-H 'Authorization: Bearer <your-token>'

Расширения для браузера#

Применение расширения для браузера Google Chrome выглядит следующим образом:

  1. Откройте Chrome Web Store и установите расширение Postman на ваш браузер.

  2. Запустите Postman из списка расширений в вашем браузере.

  3. Создайте новый запрос.

  4. Введите URI объекта, который вы хотите запросить, и выберите нужный метод HTTP (GET, POST, PUT, PATCH, DELETE).

  5. Отправьте запрос.

  6. После отправки запроса вы увидите ответ от сервера в формате JSON, XML или другом формате. Вы также можете просмотреть статус-код ответа и другие детали.

Программа#

Рассмотрим в качестве примера скрипт Python, который выполняет следующие действия в контроллере:

  1. Создает новый проект.

  2. Получает информацию о всех проектах.

  3. Получает информацию о созданном проекте.

  4. Обновляет проект из источника.

  5. Проверяет статус обновления проекта.

  6. Изменяет проект.

  7. Получает информацию о созданном проекте после изменения.

  8. Удаляет проект.

  9. Получает информацию о всех проектах.

  10. Получает конфигурацию Automation Controller.

После команд, запускающих какое-либо действие на сервере, добавлена тридцатисекундная пауза для наглядности выполнения команд.

Для запуска скрипта необходимо:

  • Использовать Python не ниже версии 3.8.

  • Установить пакет requests.

"""Demo scenario"""

import json
import time
import requests

# Define base URL and headers
gateway_url = "https://<address>/api/gateway/v1/"
controller_url = "https://<address>/api/controller/v2/"
headers = {"Authorization": "Bearer <your_token>", "Content-type": "application/json"}


def button_press():
    """Prompt the user to press Enter to continue."""
    input("\nНажмите Enter чтобы продолжить...\n")


def print_json(response):
    """
    Print the response JSON returned by a REST API request.

    Args:
        response: The response object returned by the REST API request
    """
    if response.text:
        print(json.dumps(response.json(), indent=4))
    else:
        print("Status code:", response.status_code)


# Define the project data
project_data = {
    "name": "New Project",
    "organization": 1,
    "scm_type": "git",
    "scm_url": "https://github.com/ansible/ansible-tower-samples",
}

# Post new project
response_post_new_project = requests.post(
    f"{controller_url}projects/",
    headers=headers,
    data=json.dumps(project_data),
    verify=False,
    timeout=10,
)
print("\n--- Создание проекта ---")
print_json(response_post_new_project)
project_id = response_post_new_project.json()["id"]
time.sleep(30)
print("\n --- Проект создан ---")
button_press()

# Get all projects
response_get_all_projects = requests.get(
    f"{controller_url}projects/", headers=headers, verify=False, timeout=10
)
print("\n--- Информация о проектах ---")
print_json(response_get_all_projects)
print("\n --- Выведена информация по всем проектам ---")
button_press()

# Get project details
response_get_project_detail = requests.get(
    f"{controller_url}projects/{project_id}/", headers=headers, verify=False, timeout=10
)
print("\n--- Получение деталей проекта ---")
print_json(response_get_project_detail)
print("\n --- Выведена информация о созданном проекте ---")
button_press()

# Update project from the version control source
response_update_project = requests.post(
    f"{controller_url}projects/{project_id}/update/",
    headers=headers,
    verify=False,
    timeout=10,
)
print("\n--- Обновление проекта из источника контроля версий ---")
print_json(response_update_project)
time.sleep(30)
print("\n --- Проект обновлен ---")
button_press()

# Check update status information
response_project_update_status = requests.get(
    f"{controller_url}projects/{project_id}/project_updates/",
    headers=headers,
    verify=False,
    timeout=10,
)
print("\n--- Проверка информации о статусе обновления ---")
print_json(response_project_update_status)
print("\n --- Выведена информация о статусе обновления ---")
button_press()

# Change the project
patch_data = {
    "name": "Updated Project",
    "scm_url": "https://github.com/ansible/ansible-examples",
}
response_patch_project = requests.patch(
    f"{controller_url}projects/{project_id}/",
    headers=headers,
    data=json.dumps(patch_data),
    verify=False,
    timeout=10,
)
print("\n--- Изменение проекта ---")
print_json(response_patch_project)
time.sleep(30)
print("\n --- Проект изменен ---")
button_press()

# Get project details after the change
response_get_project_detail_after_change = requests.get(
    f"{controller_url}projects/{project_id}/", headers=headers, verify=False, timeout=10
)
print("\n--- Получение деталей проекта (после обновления) ---")
print_json(response_get_project_detail_after_change)
print("\n --- Выведена информация о созданном проекте после изменения ---")
button_press()

# Delete the project
response_delete_project = requests.delete(
    f"{controller_url}projects/{project_id}/", headers=headers, verify=False, timeout=10
)
print("\n--- Удаление проекта ---")
print_json(response_delete_project)
print("\n --- Проект удален ---")
button_press()

# List all projects after deletion
response_get_all_projects_after_deletion = requests.get(
    f"{controller_url}projects/", headers=headers, verify=False, timeout=10
)
print("\n--- Список проектов (после удаления) ---")
print_json(response_get_all_projects_after_deletion)
print("\n --- Выведена информация по всем проектам после удаления ---")
button_press()

# Get Automation Controller Configuration
response_get_configuration = requests.get(
    f"{controller_url}config/", headers=headers, verify=False, timeout=10
)
print("\n--- Получение конфигурации Automation Controller ---")
print_json(response_get_configuration)
print("\n --- Выведена информация по серверу Automation Controller ---")

В демонстрационном скрипте замените значения <address> и <your_token> на свои.

Пример вывода:

Создание проекта:

{
  "id": 11,
  "type": "project",
  "url": "/api/controller/v2/projects/11/",
  "related": {
    "named_url": "/api/controller/v2/projects/New Project++Default/",
    "created_by": "/api/controller/v2/users/1/",
    "modified_by": "/api/controller/v2/users/1/",
    "current_job": "/api/controller/v2/project_updates/16/",
    "teams": "/api/controller/v2/projects/11/teams/",
    "playbooks": "/api/controller/v2/projects/11/playbooks/",
    "inventory_files": "/api/controller/v2/projects/11/inventories/",
    "update": "/api/controller/v2/projects/11/update/",
    "project_updates": "/api/controller/v2/projects/11/project_updates/",
    "scm_inventory_sources": "/api/controller/v2/projects/11/scm_inventory_sources/",
    "schedules": "/api/controller/v2/projects/11/schedules/",
    "activity_stream": "/api/controller/v2/projects/11/activity_stream/",
    "notification_templates_started": "/api/controller/v2/projects/11/notification_templates_started/",
    "notification_templates_success": "/api/controller/v2/projects/11/notification_templates_success/",
    "notification_templates_error": "/api/controller/v2/projects/11/notification_templates_error/",
    "access_list": "/api/controller/v2/projects/11/access_list/",
    "object_roles": "/api/controller/v2/projects/11/object_roles/",
    "copy": "/api/controller/v2/projects/11/copy/",
    "organization": "/api/controller/v2/organizations/1/",
    "current_update": "/api/controller/v2/project_updates/16/"
  },
  "summary_fields": {
    "organization": {
      "id": 1,
      "name": "Default",
      "description": "The default organization for Astra Automation"
    },
    "current_update": {
      "id": 16,
      "name": "New Project",
      "description": "",
      "status": "pending",
      "failed": false
    },
    "current_job": {
      "id": 16,
      "name": "New Project",
      "description": "",
      "status": "pending",
      "failed": false
    },
    "created_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "modified_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "object_roles": {
      "admin_role": {
        "description": "Can manage all aspects of the project",
        "name": "Admin",
        "id": 106
      },
      "use_role": {
        "description": "Can use the project in a job template",
        "name": "Use",
        "id": 107
      },
      "update_role": {
        "description": "May update the project",
        "name": "Update",
        "id": 108
      },
      "read_role": {
        "description": "May view settings for the project",
        "name": "Read",
        "id": 109
      }
    },
    "user_capabilities": {
      "edit": true,
      "delete": true,
      "start": true,
      "schedule": true,
      "copy": true
    }
  },
  "created": "2025-11-25T08:21:51.600418Z",
  "modified": "2025-11-25T08:21:51.600456Z",
  "name": "New Project",
  "description": "",
  "local_path": "_11__new_project",
  "scm_type": "git",
  "scm_url": "https://github.com/ansible/ansible-tower-samples",
  "scm_branch": "",
  "scm_refspec": "",
  "scm_clean": false,
  "scm_track_submodules": false,
  "scm_delete_on_update": false,
  "credential": null,
  "timeout": 0,
  "scm_revision": "",
  "last_job_run": null,
  "last_job_failed": false,
  "next_job_run": null,
  "status": "pending",
  "organization": 1,
  "scm_update_on_launch": false,
  "scm_update_cache_timeout": 0,
  "allow_override": false,
  "custom_virtualenv": null,
  "default_environment": null,
  "signature_validation_credential": null,
  "last_update_failed": false,
  "last_updated": null
}

Получение информации о проектах:

{
  "count": 3,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 5,
      "type": "project",
      "url": "/api/controller/v2/projects/5/",
      "related": {
        "created_by": "/api/controller/v2/users/1/",
        "modified_by": "/api/controller/v2/users/1/",
        "teams": "/api/controller/v2/projects/5/teams/",
        "playbooks": "/api/controller/v2/projects/5/playbooks/",
        "inventory_files": "/api/controller/v2/projects/5/inventories/",
        "update": "/api/controller/v2/projects/5/update/",
        "project_updates": "/api/controller/v2/projects/5/project_updates/",
        "scm_inventory_sources": "/api/controller/v2/projects/5/scm_inventory_sources/",
        "schedules": "/api/controller/v2/projects/5/schedules/",
        "activity_stream": "/api/controller/v2/projects/5/activity_stream/",
        "notification_templates_started": "/api/controller/v2/projects/5/notification_templates_started/",
        "notification_templates_success": "/api/controller/v2/projects/5/notification_templates_success/",
        "notification_templates_error": "/api/controller/v2/projects/5/notification_templates_error/",
        "access_list": "/api/controller/v2/projects/5/access_list/",
        "object_roles": "/api/controller/v2/projects/5/object_roles/",
        "copy": "/api/controller/v2/projects/5/copy/",
        "organization": "/api/controller/v2/organizations/1/"
      },
      "summary_fields": {
        "organization": {
          "id": 1,
          "name": "Default",
          "description": "The default organization for Astra Automation"
        },
        "created_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "modified_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "object_roles": {
          "admin_role": {
            "description": "Can manage all aspects of the project",
            "name": "Admin",
            "id": 22
          },
          "use_role": {
            "description": "Can use the project in a job template",
            "name": "Use",
            "id": 23
          },
          "update_role": {
            "description": "May update the project",
            "name": "Update",
            "id": 24
          },
          "read_role": {
            "description": "May view settings for the project",
            "name": "Read",
            "id": 25
          }
        },
        "user_capabilities": {
          "edit": true,
          "delete": true,
          "start": true,
          "schedule": true,
          "copy": true
        }
      },
      "created": "2025-11-12T10:21:56.220632Z",
      "modified": "2025-11-12T10:21:56.220653Z",
      "name": "Demo Project",
      "description": "",
      "local_path": "_5__demo_project",
      "scm_type": "git",
      "scm_url": "https://github.com/ansible/ansible-tower-samples",
      "scm_branch": "",
      "scm_refspec": "",
      "scm_clean": false,
      "scm_track_submodules": false,
      "scm_delete_on_update": false,
      "credential": null,
      "timeout": 0,
      "scm_revision": "347e44fea036c94d5f60e544de006453ee5c71ad",
      "last_job_run": null,
      "last_job_failed": false,
      "next_job_run": null,
      "status": "successful",
      "organization": 1,
      "scm_update_on_launch": false,
      "scm_update_cache_timeout": 0,
      "allow_override": false,
      "custom_virtualenv": null,
      "default_environment": null,
      "signature_validation_credential": null,
      "last_update_failed": false,
      "last_updated": null
    },
    {
      "id": 7,
      "type": "project",
      "url": "/api/controller/v2/projects/7/",
      "related": {
        "created_by": "/api/controller/v2/users/1/",
        "modified_by": "/api/controller/v2/users/1/",
        "credential": "/api/controller/v2/credentials/4/",
        "last_job": "/api/controller/v2/project_updates/6/",
        "teams": "/api/controller/v2/projects/7/teams/",
        "playbooks": "/api/controller/v2/projects/7/playbooks/",
        "inventory_files": "/api/controller/v2/projects/7/inventories/",
        "update": "/api/controller/v2/projects/7/update/",
        "project_updates": "/api/controller/v2/projects/7/project_updates/",
        "scm_inventory_sources": "/api/controller/v2/projects/7/scm_inventory_sources/",
        "schedules": "/api/controller/v2/projects/7/schedules/",
        "activity_stream": "/api/controller/v2/projects/7/activity_stream/",
        "notification_templates_started": "/api/controller/v2/projects/7/notification_templates_started/",
        "notification_templates_success": "/api/controller/v2/projects/7/notification_templates_success/",
        "notification_templates_error": "/api/controller/v2/projects/7/notification_templates_error/",
        "access_list": "/api/controller/v2/projects/7/access_list/",
        "object_roles": "/api/controller/v2/projects/7/object_roles/",
        "copy": "/api/controller/v2/projects/7/copy/",
        "organization": "/api/controller/v2/organizations/1/",
        "default_environment": "/api/controller/v2/execution_environments/2/",
        "last_update": "/api/controller/v2/project_updates/6/"
      },
      "summary_fields": {
        "organization": {
          "id": 1,
          "name": "Default",
          "description": "The default organization for Astra Automation"
        },
        "default_environment": {
          "id": 2,
          "name": "Default execution environment",
          "description": "",
          "image": "hub.astra-automation.ru/aa-1.2/aa-full-ee:latest"
        },
        "credential": {
          "id": 4,
          "name": "SCM access",
          "description": "",
          "kind": "scm",
          "cloud": false,
          "kubernetes": false,
          "credential_type_id": 8
        },
        "last_job": {
          "id": 6,
          "name": "NGINX",
          "description": "",
          "finished": "2025-11-17T06:03:37.360186Z",
          "status": "successful",
          "failed": false
        },
        "last_update": {
          "id": 6,
          "name": "NGINX",
          "description": "",
          "status": "successful",
          "failed": false
        },
        "created_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "modified_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "object_roles": {
          "admin_role": {
            "description": "Can manage all aspects of the project",
            "name": "Admin",
            "id": 57
          },
          "use_role": {
            "description": "Can use the project in a job template",
            "name": "Use",
            "id": 58
          },
          "update_role": {
            "description": "May update the project",
            "name": "Update",
            "id": 59
          },
          "read_role": {
            "description": "May view settings for the project",
            "name": "Read",
            "id": 60
          }
        },
        "user_capabilities": {
          "edit": true,
          "delete": true,
          "start": true,
          "schedule": true,
          "copy": true
        }
      },
      "created": "2025-11-17T06:03:28.735832Z",
      "modified": "2025-11-17T06:03:28.735856Z",
      "name": "NGINX",
      "description": "",
      "local_path": "_7__nginx",
      "scm_type": "git",
      "scm_url": "https://gitflic.ru/project/dgaripov/ac-project.git",
      "scm_branch": "",
      "scm_refspec": "",
      "scm_clean": false,
      "scm_track_submodules": false,
      "scm_delete_on_update": false,
      "credential": 4,
      "timeout": 0,
      "scm_revision": "88c68e7f0a4c21e1d559d697ae85c9e7a6b31d3a",
      "last_job_run": "2025-11-17T06:03:37.360186Z",
      "last_job_failed": false,
      "next_job_run": null,
      "status": "successful",
      "organization": 1,
      "scm_update_on_launch": false,
      "scm_update_cache_timeout": 0,
      "allow_override": false,
      "custom_virtualenv": null,
      "default_environment": 2,
      "signature_validation_credential": null,
      "last_update_failed": false,
      "last_updated": "2025-11-17T06:03:37.360186Z"
    },
    {
      "id": 11,
      "type": "project",
      "url": "/api/controller/v2/projects/11/",
      "related": {
        "created_by": "/api/controller/v2/users/1/",
        "modified_by": "/api/controller/v2/users/1/",
        "last_job": "/api/controller/v2/project_updates/16/",
        "teams": "/api/controller/v2/projects/11/teams/",
        "playbooks": "/api/controller/v2/projects/11/playbooks/",
        "inventory_files": "/api/controller/v2/projects/11/inventories/",
        "update": "/api/controller/v2/projects/11/update/",
        "project_updates": "/api/controller/v2/projects/11/project_updates/",
        "scm_inventory_sources": "/api/controller/v2/projects/11/scm_inventory_sources/",
        "schedules": "/api/controller/v2/projects/11/schedules/",
        "activity_stream": "/api/controller/v2/projects/11/activity_stream/",
        "notification_templates_started": "/api/controller/v2/projects/11/notification_templates_started/",
        "notification_templates_success": "/api/controller/v2/projects/11/notification_templates_success/",
        "notification_templates_error": "/api/controller/v2/projects/11/notification_templates_error/",
        "access_list": "/api/controller/v2/projects/11/access_list/",
        "object_roles": "/api/controller/v2/projects/11/object_roles/",
        "copy": "/api/controller/v2/projects/11/copy/",
        "organization": "/api/controller/v2/organizations/1/",
        "last_update": "/api/controller/v2/project_updates/16/"
      },
      "summary_fields": {
        "organization": {
          "id": 1,
          "name": "Default",
          "description": "The default organization for Astra Automation"
        },
        "last_job": {
          "id": 16,
          "name": "New Project",
          "description": "",
          "finished": "2025-11-25T08:21:59.748433Z",
          "status": "successful",
          "failed": false
        },
        "last_update": {
          "id": 16,
          "name": "New Project",
          "description": "",
          "status": "successful",
          "failed": false
        },
        "created_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "modified_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "object_roles": {
          "admin_role": {
            "description": "Can manage all aspects of the project",
            "name": "Admin",
            "id": 106
          },
          "use_role": {
            "description": "Can use the project in a job template",
            "name": "Use",
            "id": 107
          },
          "update_role": {
            "description": "May update the project",
            "name": "Update",
            "id": 108
          },
          "read_role": {
            "description": "May view settings for the project",
            "name": "Read",
            "id": 109
          }
        },
        "user_capabilities": {
          "edit": true,
          "delete": true,
          "start": true,
          "schedule": true,
          "copy": true
        }
      },
      "created": "2025-11-25T08:21:51.600418Z",
      "modified": "2025-11-25T08:21:51.600456Z",
      "name": "New Project",
      "description": "",
      "local_path": "_11__new_project",
      "scm_type": "git",
      "scm_url": "https://github.com/ansible/ansible-tower-samples",
      "scm_branch": "",
      "scm_refspec": "",
      "scm_clean": false,
      "scm_track_submodules": false,
      "scm_delete_on_update": false,
      "credential": null,
      "timeout": 0,
      "scm_revision": "347e44fea036c94d5f60e544de006453ee5c71ad",
      "last_job_run": "2025-11-25T08:21:59.748433Z",
      "last_job_failed": false,
      "next_job_run": null,
      "status": "successful",
      "organization": 1,
      "scm_update_on_launch": false,
      "scm_update_cache_timeout": 0,
      "allow_override": false,
      "custom_virtualenv": null,
      "default_environment": null,
      "signature_validation_credential": null,
      "last_update_failed": false,
      "last_updated": "2025-11-25T08:21:59.748433Z"
    }
  ]
}

Получение деталей проекта:

{
  "id": 11,
  "type": "project",
  "url": "/api/controller/v2/projects/11/",
  "related": {
    "named_url": "/api/controller/v2/projects/New Project++Default/",
    "created_by": "/api/controller/v2/users/1/",
    "modified_by": "/api/controller/v2/users/1/",
    "last_job": "/api/controller/v2/project_updates/16/",
    "teams": "/api/controller/v2/projects/11/teams/",
    "playbooks": "/api/controller/v2/projects/11/playbooks/",
    "inventory_files": "/api/controller/v2/projects/11/inventories/",
    "update": "/api/controller/v2/projects/11/update/",
    "project_updates": "/api/controller/v2/projects/11/project_updates/",
    "scm_inventory_sources": "/api/controller/v2/projects/11/scm_inventory_sources/",
    "schedules": "/api/controller/v2/projects/11/schedules/",
    "activity_stream": "/api/controller/v2/projects/11/activity_stream/",
    "notification_templates_started": "/api/controller/v2/projects/11/notification_templates_started/",
    "notification_templates_success": "/api/controller/v2/projects/11/notification_templates_success/",
    "notification_templates_error": "/api/controller/v2/projects/11/notification_templates_error/",
    "access_list": "/api/controller/v2/projects/11/access_list/",
    "object_roles": "/api/controller/v2/projects/11/object_roles/",
    "copy": "/api/controller/v2/projects/11/copy/",
    "organization": "/api/controller/v2/organizations/1/",
    "last_update": "/api/controller/v2/project_updates/16/"
  },
  "summary_fields": {
    "organization": {
      "id": 1,
      "name": "Default",
      "description": "The default organization for Astra Automation"
    },
    "last_job": {
      "id": 16,
      "name": "New Project",
      "description": "",
      "finished": "2025-11-25T08:21:59.748433Z",
      "status": "successful",
      "failed": false
    },
    "last_update": {
      "id": 16,
      "name": "New Project",
      "description": "",
      "status": "successful",
      "failed": false
    },
    "created_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "modified_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "object_roles": {
      "admin_role": {
        "description": "Can manage all aspects of the project",
        "name": "Admin",
        "id": 106
      },
      "use_role": {
        "description": "Can use the project in a job template",
        "name": "Use",
        "id": 107
      },
      "update_role": {
        "description": "May update the project",
        "name": "Update",
        "id": 108
      },
      "read_role": {
        "description": "May view settings for the project",
        "name": "Read",
        "id": 109
      }
    },
    "user_capabilities": {
      "edit": true,
      "delete": true,
      "start": true,
      "schedule": true,
      "copy": true
    },
    "resolved_environment": {
      "id": 2,
      "name": "Default execution environment",
      "description": "",
      "image": "hub.astra-automation.ru/aa-1.2/aa-full-ee:latest"
    }
  },
  "created": "2025-11-25T08:21:51.600418Z",
  "modified": "2025-11-25T08:21:51.600456Z",
  "name": "New Project",
  "description": "",
  "local_path": "_11__new_project",
  "scm_type": "git",
  "scm_url": "https://github.com/ansible/ansible-tower-samples",
  "scm_branch": "",
  "scm_refspec": "",
  "scm_clean": false,
  "scm_track_submodules": false,
  "scm_delete_on_update": false,
  "credential": null,
  "timeout": 0,
  "scm_revision": "347e44fea036c94d5f60e544de006453ee5c71ad",
  "last_job_run": "2025-11-25T08:21:59.748433Z",
  "last_job_failed": false,
  "next_job_run": null,
  "status": "successful",
  "organization": 1,
  "scm_update_on_launch": false,
  "scm_update_cache_timeout": 0,
  "allow_override": false,
  "custom_virtualenv": null,
  "default_environment": null,
  "signature_validation_credential": null,
  "last_update_failed": false,
  "last_updated": "2025-11-25T08:21:59.748433Z"
}

Обновление проекта из источника контроля версий:

{
  "project_update": 17,
  "id": 17,
  "type": "project_update",
  "url": "/api/controller/v2/project_updates/17/",
  "related": {
    "created_by": "/api/controller/v2/users/1/",
    "modified_by": "/api/controller/v2/users/1/",
    "unified_job_template": "/api/controller/v2/projects/11/",
    "stdout": "/api/controller/v2/project_updates/17/stdout/",
    "project": "/api/controller/v2/projects/11/",
    "cancel": "/api/controller/v2/project_updates/17/cancel/",
    "scm_inventory_updates": "/api/controller/v2/project_updates/17/scm_inventory_updates/",
    "notifications": "/api/controller/v2/project_updates/17/notifications/",
    "events": "/api/controller/v2/project_updates/17/events/"
  },
  "summary_fields": {
    "organization": {
      "id": 1,
      "name": "Default",
      "description": "The default organization for Astra Automation"
    },
    "project": {
      "id": 11,
      "name": "New Project",
      "description": "",
      "status": "pending",
      "scm_type": "git",
      "allow_override": false
    },
    "unified_job_template": {
      "id": 11,
      "name": "New Project",
      "description": "",
      "unified_job_type": "project_update"
    },
    "created_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "modified_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "user_capabilities": {
      "delete": true,
      "start": true
    }
  },
  "created": "2025-11-25T08:23:19.689476Z",
  "modified": "2025-11-25T08:23:19.714576Z",
  "name": "New Project",
  "description": "",
  "local_path": "_11__new_project",
  "scm_type": "git",
  "scm_url": "https://github.com/ansible/ansible-tower-samples",
  "scm_branch": "",
  "scm_refspec": "",
  "scm_clean": false,
  "scm_track_submodules": false,
  "scm_delete_on_update": false,
  "credential": null,
  "timeout": 0,
  "scm_revision": "",
  "unified_job_template": 11,
  "launch_type": "manual",
  "status": "pending",
  "execution_environment": null,
  "failed": false,
  "started": null,
  "finished": null,
  "canceled_on": null,
  "elapsed": 0.0,
  "job_args": "",
  "job_cwd": "",
  "job_env": {},
  "job_explanation": "",
  "execution_node": "",
  "result_traceback": "",
  "event_processing_finished": false,
  "launched_by": {
    "id": 1,
    "name": "admin",
    "type": "user",
    "url": "/api/controller/v2/users/1/"
  },
  "work_unit_id": null,
  "project": 11,
  "job_type": "check",
  "job_tags": "update_git,install_roles,install_collections"
}

Проверка информации о статусе обновления:

{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 16,
      "type": "project_update",
      "url": "/api/controller/v2/project_updates/16/",
      "related": {
        "created_by": "/api/controller/v2/users/1/",
        "unified_job_template": "/api/controller/v2/projects/11/",
        "stdout": "/api/controller/v2/project_updates/16/stdout/",
        "execution_environment": "/api/controller/v2/execution_environments/3/",
        "project": "/api/controller/v2/projects/11/",
        "cancel": "/api/controller/v2/project_updates/16/cancel/",
        "scm_inventory_updates": "/api/controller/v2/project_updates/16/scm_inventory_updates/",
        "notifications": "/api/controller/v2/project_updates/16/notifications/",
        "events": "/api/controller/v2/project_updates/16/events/"
      },
      "summary_fields": {
        "organization": {
          "id": 1,
          "name": "Default",
          "description": "The default organization for Astra Automation"
        },
        "execution_environment": {
          "id": 3,
          "name": "Control Plane Execution Environment",
          "description": "",
          "image": "hub.astra-automation.ru/aa-1.2/aa-control-ee:latest"
        },
        "project": {
          "id": 11,
          "name": "New Project",
          "description": "",
          "status": "successful",
          "scm_type": "git",
          "allow_override": false
        },
        "unified_job_template": {
          "id": 11,
          "name": "New Project",
          "description": "",
          "unified_job_type": "project_update"
        },
        "instance_group": {
          "id": 1,
          "name": "controlplane",
          "is_container_group": false
        },
        "created_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "user_capabilities": {
          "delete": true,
          "start": true
        }
      },
      "created": "2025-11-25T08:21:52.080566Z",
      "modified": "2025-11-25T08:21:52.414131Z",
      "name": "New Project",
      "description": "",
      "unified_job_template": 11,
      "launch_type": "manual",
      "status": "successful",
      "execution_environment": 3,
      "failed": false,
      "started": "2025-11-25T08:21:52.555787Z",
      "finished": "2025-11-25T08:21:59.748433Z",
      "canceled_on": null,
      "elapsed": 7.193,
      "job_explanation": "",
      "execution_node": "10.205.212.90",
      "launched_by": {
        "id": 1,
        "name": "admin",
        "type": "user",
        "url": "/api/controller/v2/users/1/"
      },
      "work_unit_id": "1020521290P82YebHM",
      "local_path": "_11__new_project",
      "scm_type": "git",
      "scm_url": "https://github.com/ansible/ansible-tower-samples",
      "scm_branch": "",
      "scm_refspec": "",
      "scm_clean": false,
      "scm_track_submodules": false,
      "scm_delete_on_update": false,
      "credential": null,
      "timeout": 0,
      "scm_revision": "347e44fea036c94d5f60e544de006453ee5c71ad",
      "project": 11,
      "job_type": "check",
      "job_tags": "update_git,install_roles,install_collections"
    },
    {
      "id": 17,
      "type": "project_update",
      "url": "/api/controller/v2/project_updates/17/",
      "related": {
        "created_by": "/api/controller/v2/users/1/",
        "unified_job_template": "/api/controller/v2/projects/11/",
        "stdout": "/api/controller/v2/project_updates/17/stdout/",
        "execution_environment": "/api/controller/v2/execution_environments/3/",
        "project": "/api/controller/v2/projects/11/",
        "cancel": "/api/controller/v2/project_updates/17/cancel/",
        "scm_inventory_updates": "/api/controller/v2/project_updates/17/scm_inventory_updates/",
        "notifications": "/api/controller/v2/project_updates/17/notifications/",
        "events": "/api/controller/v2/project_updates/17/events/"
      },
      "summary_fields": {
        "organization": {
          "id": 1,
          "name": "Default",
          "description": "The default organization for Astra Automation"
        },
        "execution_environment": {
          "id": 3,
          "name": "Control Plane Execution Environment",
          "description": "",
          "image": "hub.astra-automation.ru/aa-1.2/aa-control-ee:latest"
        },
        "project": {
          "id": 11,
          "name": "New Project",
          "description": "",
          "status": "successful",
          "scm_type": "git",
          "allow_override": false
        },
        "unified_job_template": {
          "id": 11,
          "name": "New Project",
          "description": "",
          "unified_job_type": "project_update"
        },
        "instance_group": {
          "id": 1,
          "name": "controlplane",
          "is_container_group": false
        },
        "created_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "user_capabilities": {
          "delete": true,
          "start": true
        }
      },
      "created": "2025-11-25T08:23:19.689476Z",
      "modified": "2025-11-25T08:23:20.090734Z",
      "name": "New Project",
      "description": "",
      "unified_job_template": 11,
      "launch_type": "manual",
      "status": "successful",
      "execution_environment": 3,
      "failed": false,
      "started": "2025-11-25T08:23:20.198178Z",
      "finished": "2025-11-25T08:23:26.286009Z",
      "canceled_on": null,
      "elapsed": 6.088,
      "job_explanation": "",
      "execution_node": "10.205.212.90",
      "launched_by": {
        "id": 1,
        "name": "admin",
        "type": "user",
        "url": "/api/controller/v2/users/1/"
      },
      "work_unit_id": "1020521290u1HqqqwP",
      "local_path": "_11__new_project",
      "scm_type": "git",
      "scm_url": "https://github.com/ansible/ansible-tower-samples",
      "scm_branch": "",
      "scm_refspec": "",
      "scm_clean": false,
      "scm_track_submodules": false,
      "scm_delete_on_update": false,
      "credential": null,
      "timeout": 0,
      "scm_revision": "347e44fea036c94d5f60e544de006453ee5c71ad",
      "project": 11,
      "job_type": "check",
      "job_tags": "update_git,install_roles,install_collections"
    }
  ]
}

Изменение проекта:

{
  "id": 11,
  "type": "project",
  "url": "/api/controller/v2/projects/11/",
  "related": {
    "named_url": "/api/controller/v2/projects/Updated Project++Default/",
    "created_by": "/api/controller/v2/users/1/",
    "modified_by": "/api/controller/v2/users/1/",
    "current_job": "/api/controller/v2/project_updates/18/",
    "last_job": "/api/controller/v2/project_updates/17/",
    "teams": "/api/controller/v2/projects/11/teams/",
    "playbooks": "/api/controller/v2/projects/11/playbooks/",
    "inventory_files": "/api/controller/v2/projects/11/inventories/",
    "update": "/api/controller/v2/projects/11/update/",
    "project_updates": "/api/controller/v2/projects/11/project_updates/",
    "scm_inventory_sources": "/api/controller/v2/projects/11/scm_inventory_sources/",
    "schedules": "/api/controller/v2/projects/11/schedules/",
    "activity_stream": "/api/controller/v2/projects/11/activity_stream/",
    "notification_templates_started": "/api/controller/v2/projects/11/notification_templates_started/",
    "notification_templates_success": "/api/controller/v2/projects/11/notification_templates_success/",
    "notification_templates_error": "/api/controller/v2/projects/11/notification_templates_error/",
    "access_list": "/api/controller/v2/projects/11/access_list/",
    "object_roles": "/api/controller/v2/projects/11/object_roles/",
    "copy": "/api/controller/v2/projects/11/copy/",
    "organization": "/api/controller/v2/organizations/1/",
    "current_update": "/api/controller/v2/project_updates/18/",
    "last_update": "/api/controller/v2/project_updates/17/"
  },
  "summary_fields": {
    "organization": {
      "id": 1,
      "name": "Default",
      "description": "The default organization for Astra Automation"
    },
    "last_job": {
      "id": 17,
      "name": "New Project",
      "description": "",
      "finished": "2025-11-25T08:23:26.286009Z",
      "status": "successful",
      "failed": false
    },
    "last_update": {
      "id": 17,
      "name": "New Project",
      "description": "",
      "status": "successful",
      "failed": false
    },
    "current_update": {
      "id": 18,
      "name": "Updated Project",
      "description": "",
      "status": "pending",
      "failed": false
    },
    "current_job": {
      "id": 18,
      "name": "Updated Project",
      "description": "",
      "status": "pending",
      "failed": false
    },
    "created_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "modified_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "object_roles": {
      "admin_role": {
        "description": "Can manage all aspects of the project",
        "name": "Admin",
        "id": 106
      },
      "use_role": {
        "description": "Can use the project in a job template",
        "name": "Use",
        "id": 107
      },
      "update_role": {
        "description": "May update the project",
        "name": "Update",
        "id": 108
      },
      "read_role": {
        "description": "May view settings for the project",
        "name": "Read",
        "id": 109
      }
    },
    "user_capabilities": {
      "edit": true,
      "delete": true,
      "start": true,
      "schedule": true,
      "copy": true
    },
    "resolved_environment": {
      "id": 2,
      "name": "Default execution environment",
      "description": "",
      "image": "hub.astra-automation.ru/aa-1.2/aa-full-ee:latest"
    }
  },
  "created": "2025-11-25T08:21:51.600418Z",
  "modified": "2025-11-25T08:23:58.333025Z",
  "name": "Updated Project",
  "description": "",
  "local_path": "_11__new_project",
  "scm_type": "git",
  "scm_url": "https://github.com/ansible/ansible-examples",
  "scm_branch": "",
  "scm_refspec": "",
  "scm_clean": false,
  "scm_track_submodules": false,
  "scm_delete_on_update": false,
  "credential": null,
  "timeout": 0,
  "scm_revision": "347e44fea036c94d5f60e544de006453ee5c71ad",
  "last_job_run": "2025-11-25T08:23:26.286009Z",
  "last_job_failed": false,
  "next_job_run": null,
  "status": "pending",
  "organization": 1,
  "scm_update_on_launch": false,
  "scm_update_cache_timeout": 0,
  "allow_override": false,
  "custom_virtualenv": null,
  "default_environment": null,
  "signature_validation_credential": null,
  "last_update_failed": false,
  "last_updated": "2025-11-25T08:23:26.286009Z"
}

Получение деталей проекта (после обновления):

{
  "id": 11,
  "type": "project",
  "url": "/api/controller/v2/projects/11/",
  "related": {
    "named_url": "/api/controller/v2/projects/Updated Project++Default/",
    "created_by": "/api/controller/v2/users/1/",
    "modified_by": "/api/controller/v2/users/1/",
    "last_job": "/api/controller/v2/project_updates/18/",
    "teams": "/api/controller/v2/projects/11/teams/",
    "playbooks": "/api/controller/v2/projects/11/playbooks/",
    "inventory_files": "/api/controller/v2/projects/11/inventories/",
    "update": "/api/controller/v2/projects/11/update/",
    "project_updates": "/api/controller/v2/projects/11/project_updates/",
    "scm_inventory_sources": "/api/controller/v2/projects/11/scm_inventory_sources/",
    "schedules": "/api/controller/v2/projects/11/schedules/",
    "activity_stream": "/api/controller/v2/projects/11/activity_stream/",
    "notification_templates_started": "/api/controller/v2/projects/11/notification_templates_started/",
    "notification_templates_success": "/api/controller/v2/projects/11/notification_templates_success/",
    "notification_templates_error": "/api/controller/v2/projects/11/notification_templates_error/",
    "access_list": "/api/controller/v2/projects/11/access_list/",
    "object_roles": "/api/controller/v2/projects/11/object_roles/",
    "copy": "/api/controller/v2/projects/11/copy/",
    "organization": "/api/controller/v2/organizations/1/",
    "last_update": "/api/controller/v2/project_updates/18/"
  },
  "summary_fields": {
    "organization": {
      "id": 1,
      "name": "Default",
      "description": "The default organization for Astra Automation"
    },
    "last_job": {
      "id": 18,
      "name": "Updated Project",
      "description": "",
      "finished": "2025-11-25T08:24:07.074135Z",
      "status": "successful",
      "failed": false
    },
    "last_update": {
      "id": 18,
      "name": "Updated Project",
      "description": "",
      "status": "successful",
      "failed": false
    },
    "created_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "modified_by": {
      "id": 1,
      "username": "admin",
      "first_name": "",
      "last_name": ""
    },
    "object_roles": {
      "admin_role": {
        "description": "Can manage all aspects of the project",
        "name": "Admin",
        "id": 106
      },
      "use_role": {
        "description": "Can use the project in a job template",
        "name": "Use",
        "id": 107
      },
      "update_role": {
        "description": "May update the project",
        "name": "Update",
        "id": 108
      },
      "read_role": {
        "description": "May view settings for the project",
        "name": "Read",
        "id": 109
      }
    },
    "user_capabilities": {
      "edit": true,
      "delete": true,
      "start": true,
      "schedule": true,
      "copy": true
    },
    "resolved_environment": {
      "id": 2,
      "name": "Default execution environment",
      "description": "",
      "image": "hub.astra-automation.ru/aa-1.2/aa-full-ee:latest"
    }
  },
  "created": "2025-11-25T08:21:51.600418Z",
  "modified": "2025-11-25T08:23:58.333025Z",
  "name": "Updated Project",
  "description": "",
  "local_path": "_11__new_project",
  "scm_type": "git",
  "scm_url": "https://github.com/ansible/ansible-examples",
  "scm_branch": "",
  "scm_refspec": "",
  "scm_clean": false,
  "scm_track_submodules": false,
  "scm_delete_on_update": false,
  "credential": null,
  "timeout": 0,
  "scm_revision": "b50586543c6c4be907fdc88f9f78a2b35d2a895f",
  "last_job_run": "2025-11-25T08:24:07.074135Z",
  "last_job_failed": false,
  "next_job_run": null,
  "status": "successful",
  "organization": 1,
  "scm_update_on_launch": false,
  "scm_update_cache_timeout": 0,
  "allow_override": false,
  "custom_virtualenv": null,
  "default_environment": null,
  "signature_validation_credential": null,
  "last_update_failed": false,
  "last_updated": "2025-11-25T08:24:07.074135Z"
}

Удаление проекта:

Status code: 204

Получение списка проектов (после удаления):

{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 5,
      "type": "project",
      "url": "/api/controller/v2/projects/5/",
      "related": {
        "created_by": "/api/controller/v2/users/1/",
        "modified_by": "/api/controller/v2/users/1/",
        "teams": "/api/controller/v2/projects/5/teams/",
        "playbooks": "/api/controller/v2/projects/5/playbooks/",
        "inventory_files": "/api/controller/v2/projects/5/inventories/",
        "update": "/api/controller/v2/projects/5/update/",
        "project_updates": "/api/controller/v2/projects/5/project_updates/",
        "scm_inventory_sources": "/api/controller/v2/projects/5/scm_inventory_sources/",
        "schedules": "/api/controller/v2/projects/5/schedules/",
        "activity_stream": "/api/controller/v2/projects/5/activity_stream/",
        "notification_templates_started": "/api/controller/v2/projects/5/notification_templates_started/",
        "notification_templates_success": "/api/controller/v2/projects/5/notification_templates_success/",
        "notification_templates_error": "/api/controller/v2/projects/5/notification_templates_error/",
        "access_list": "/api/controller/v2/projects/5/access_list/",
        "object_roles": "/api/controller/v2/projects/5/object_roles/",
        "copy": "/api/controller/v2/projects/5/copy/",
        "organization": "/api/controller/v2/organizations/1/"
      },
      "summary_fields": {
        "organization": {
          "id": 1,
          "name": "Default",
          "description": "The default organization for Astra Automation"
        },
        "created_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "modified_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "object_roles": {
          "admin_role": {
            "description": "Can manage all aspects of the project",
            "name": "Admin",
            "id": 22
          },
          "use_role": {
            "description": "Can use the project in a job template",
            "name": "Use",
            "id": 23
          },
          "update_role": {
            "description": "May update the project",
            "name": "Update",
            "id": 24
          },
          "read_role": {
            "description": "May view settings for the project",
            "name": "Read",
            "id": 25
          }
        },
        "user_capabilities": {
          "edit": true,
          "delete": true,
          "start": true,
          "schedule": true,
          "copy": true
        }
      },
      "created": "2025-11-12T10:21:56.220632Z",
      "modified": "2025-11-12T10:21:56.220653Z",
      "name": "Demo Project",
      "description": "",
      "local_path": "_5__demo_project",
      "scm_type": "git",
      "scm_url": "https://github.com/ansible/ansible-tower-samples",
      "scm_branch": "",
      "scm_refspec": "",
      "scm_clean": false,
      "scm_track_submodules": false,
      "scm_delete_on_update": false,
      "credential": null,
      "timeout": 0,
      "scm_revision": "347e44fea036c94d5f60e544de006453ee5c71ad",
      "last_job_run": null,
      "last_job_failed": false,
      "next_job_run": null,
      "status": "successful",
      "organization": 1,
      "scm_update_on_launch": false,
      "scm_update_cache_timeout": 0,
      "allow_override": false,
      "custom_virtualenv": null,
      "default_environment": null,
      "signature_validation_credential": null,
      "last_update_failed": false,
      "last_updated": null
    },
    {
      "id": 7,
      "type": "project",
      "url": "/api/controller/v2/projects/7/",
      "related": {
        "created_by": "/api/controller/v2/users/1/",
        "modified_by": "/api/controller/v2/users/1/",
        "credential": "/api/controller/v2/credentials/4/",
        "last_job": "/api/controller/v2/project_updates/6/",
        "teams": "/api/controller/v2/projects/7/teams/",
        "playbooks": "/api/controller/v2/projects/7/playbooks/",
        "inventory_files": "/api/controller/v2/projects/7/inventories/",
        "update": "/api/controller/v2/projects/7/update/",
        "project_updates": "/api/controller/v2/projects/7/project_updates/",
        "scm_inventory_sources": "/api/controller/v2/projects/7/scm_inventory_sources/",
        "schedules": "/api/controller/v2/projects/7/schedules/",
        "activity_stream": "/api/controller/v2/projects/7/activity_stream/",
        "notification_templates_started": "/api/controller/v2/projects/7/notification_templates_started/",
        "notification_templates_success": "/api/controller/v2/projects/7/notification_templates_success/",
        "notification_templates_error": "/api/controller/v2/projects/7/notification_templates_error/",
        "access_list": "/api/controller/v2/projects/7/access_list/",
        "object_roles": "/api/controller/v2/projects/7/object_roles/",
        "copy": "/api/controller/v2/projects/7/copy/",
        "organization": "/api/controller/v2/organizations/1/",
        "default_environment": "/api/controller/v2/execution_environments/2/",
        "last_update": "/api/controller/v2/project_updates/6/"
      },
      "summary_fields": {
        "organization": {
          "id": 1,
          "name": "Default",
          "description": "The default organization for Astra Automation"
        },
        "default_environment": {
          "id": 2,
          "name": "Default execution environment",
          "description": "",
          "image": "hub.astra-automation.ru/aa-1.2/aa-full-ee:latest"
        },
        "credential": {
          "id": 4,
          "name": "SCM access",
          "description": "",
          "kind": "scm",
          "cloud": false,
          "kubernetes": false,
          "credential_type_id": 8
        },
        "last_job": {
          "id": 6,
          "name": "NGINX",
          "description": "",
          "finished": "2025-11-17T06:03:37.360186Z",
          "status": "successful",
          "failed": false
        },
        "last_update": {
          "id": 6,
          "name": "NGINX",
          "description": "",
          "status": "successful",
          "failed": false
        },
        "created_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "modified_by": {
          "id": 1,
          "username": "admin",
          "first_name": "",
          "last_name": ""
        },
        "object_roles": {
          "admin_role": {
            "description": "Can manage all aspects of the project",
            "name": "Admin",
            "id": 57
          },
          "use_role": {
            "description": "Can use the project in a job template",
            "name": "Use",
            "id": 58
          },
          "update_role": {
            "description": "May update the project",
            "name": "Update",
            "id": 59
          },
          "read_role": {
            "description": "May view settings for the project",
            "name": "Read",
            "id": 60
          }
        },
        "user_capabilities": {
          "edit": true,
          "delete": true,
          "start": true,
          "schedule": true,
          "copy": true
        }
      },
      "created": "2025-11-17T06:03:28.735832Z",
      "modified": "2025-11-17T06:03:28.735856Z",
      "name": "NGINX",
      "description": "",
      "local_path": "_7__nginx",
      "scm_type": "git",
      "scm_url": "https://gitflic.ru/project/dgaripov/ac-project.git",
      "scm_branch": "",
      "scm_refspec": "",
      "scm_clean": false,
      "scm_track_submodules": false,
      "scm_delete_on_update": false,
      "credential": 4,
      "timeout": 0,
      "scm_revision": "88c68e7f0a4c21e1d559d697ae85c9e7a6b31d3a",
      "last_job_run": "2025-11-17T06:03:37.360186Z",
      "last_job_failed": false,
      "next_job_run": null,
      "status": "successful",
      "organization": 1,
      "scm_update_on_launch": false,
      "scm_update_cache_timeout": 0,
      "allow_override": false,
      "custom_virtualenv": null,
      "default_environment": 2,
      "signature_validation_credential": null,
      "last_update_failed": false,
      "last_updated": "2025-11-17T06:03:37.360186Z"
    }
  ]
}

Получение конфигурации Automation Controller:

{
  "time_zone": "UTC",
  "license_info": {
    "instance_count": 10,
    "license_date": "1767225599",
    "license_type": "enterprise",
    "sku": "24929",
    "usage": "",
    "pool_id": "8a8883dc94ae933601952859afc905c2",
    "satellite": false,
    "valid_key": true,
    "product_name": "Astra Automation",
    "support_level": "",
    "account_number": null,
    "subscription_id": null,
    "subscription_name": "Astra Automation",
    "deleted_instances": 0,
    "reactivated_instances": 0,
    "current_instances": 2,
    "automated_instances": 2,
    "automated_since": 1763030365,
    "free_instances": 8,
    "time_remaining": 3166479,
    "trial": false,
    "grace_period_remaining": 5758479,
    "compliant": true,
    "date_warning": false,
    "date_expired": false
  },
  "version": "2.1.0+51f9160",
  "eula": "\u041b...",
  "analytics_status": "off",
  "analytics_collectors": {
    "config": {
      "name": "config",
      "version": "1.6",
      "description": "General platform configuration."
    },
    "counts": {
      "name": "counts",
      "version": "1.2",
      "description": "Counts of objects such as organizations, inventories, and projects"
    },
    "cred_type_counts": {
      "name": "cred_type_counts",
      "version": "1.0",
      "description": "Counts of credentials by credential type"
    },
    "events_table": {
      "name": "events_table",
      "version": "1.5",
      "description": "Automation task records"
    },
    "host_metric_summary_monthly_table": {
      "name": "host_metric_summary_monthly_table",
      "version": "1.0",
      "description": "HostMetricSummaryMonthly export, full sync"
    },
    "host_metric_table": {
      "name": "host_metric_table",
      "version": "1.0",
      "description": "Host Metric data, incremental/full sync"
    },
    "instance_info": {
      "name": "instance_info",
      "version": "1.3",
      "description": "Cluster topology and capacity"
    },
    "inventory_counts": {
      "name": "inventory_counts",
      "version": "1.2",
      "description": "Inventories, their inventory sources, and host counts"
    },
    "org_counts": {
      "name": "org_counts",
      "version": "1.0",
      "description": "Counts of users and teams by organization"
    },
    "projects_by_scm_type": {
      "name": "projects_by_scm_type",
      "version": "1.0",
      "description": "Counts of projects by source control type"
    },
    "query_info": {
      "name": "query_info",
      "version": "1.0",
      "description": "Metadata about the analytics collected"
    },
    "switched_off_instance_info": {
      "name": "switched_off_instance_info",
      "version": "1.0",
      "description": "Switched off instances"
    },
    "unified_job_template_table": {
      "name": "unified_job_template_table",
      "version": "1.1",
      "description": "Data on job templates"
    },
    "unified_jobs_table": {
      "name": "unified_jobs_table",
      "version": "1.4",
      "description": "Data on jobs run"
    },
    "workflow_job_node_table": {
      "name": "workflow_job_node_table",
      "version": "1.0",
      "description": "Data on workflow runs"
    },
    "workflow_job_template_node_table": {
      "name": "workflow_job_template_node_table",
      "version": "1.0",
      "description": "Data on workflows"
    }
  },
  "become_methods": [
    ["sudo", "Sudo"],
    ["su", "Su"],
    ["pbrun", "Pbrun"],
    ["pfexec", "Pfexec"],
    ["dzdo", "DZDO"],
    ["pmrun", "Pmrun"],
    ["runas", "Runas"],
    ["enable", "Enable"],
    ["doas", "Doas"],
    ["ksu", "Ksu"],
    ["machinectl", "Machinectl"],
    ["sesu", "Sesu"]
  ],
  "project_base_dir": "/var/lib/awx/projects",
  "project_local_paths": [],
  "custom_virtualenvs": []
}