前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >07 Jan 2024 awx rest api tips

07 Jan 2024 awx rest api tips

作者头像
俊采
发布2024-01-08 08:55:26
2600
发布2024-01-08 08:55:26
举报
文章被收录于专栏:LEo的网络日志
  • 查看api版本信息
代码语言:javascript
复制
$ curl -s $CONTROLLER_HOST/api/ | jq .
{
  "description": "AWX REST API",
  "current_version": "/awx/api/v2/",
  "available_versions": {
    "v2": "/awx/api/v2/"
  },
  "oauth2": "/awx/api/o/",
  "custom_logo": "",
  "custom_login_info": "",
  "login_redirect_override": ""
}
  • 所有可用api
代码语言:javascript
复制
$ curl -s $CONTROLLER_HOST/api/v2/ | jq .
{
  "ping": "/awx/api/v2/ping/",
  "instances": "/awx/api/v2/instances/",
  "instance_groups": "/awx/api/v2/instance_groups/",
  "config": "/awx/api/v2/config/",
  "settings": "/awx/api/v2/settings/",
  "me": "/awx/api/v2/me/",
  "dashboard": "/awx/api/v2/dashboard/",
  "organizations": "/awx/api/v2/organizations/",
  "users": "/awx/api/v2/users/",
  "execution_environments": "/awx/api/v2/execution_environments/",
  "projects": "/awx/api/v2/projects/",
  "project_updates": "/awx/api/v2/project_updates/",
  "teams": "/awx/api/v2/teams/",
  "credentials": "/awx/api/v2/credentials/",
  "credential_types": "/awx/api/v2/credential_types/",
  "credential_input_sources": "/awx/api/v2/credential_input_sources/",
  "applications": "/awx/api/v2/applications/",
  "tokens": "/awx/api/v2/tokens/",
  "metrics": "/awx/api/v2/metrics/",
  "inventory": "/awx/api/v2/inventories/",
  "constructed_inventory": "/awx/api/v2/constructed_inventories/",
  "inventory_sources": "/awx/api/v2/inventory_sources/",
  "inventory_updates": "/awx/api/v2/inventory_updates/",
  "groups": "/awx/api/v2/groups/",
  "hosts": "/awx/api/v2/hosts/",
  "host_metrics": "/awx/api/v2/host_metrics/",
  "host_metric_summary_monthly": "/awx/api/v2/host_metric_summary_monthly/",
  "job_templates": "/awx/api/v2/job_templates/",
  "jobs": "/awx/api/v2/jobs/",
  "ad_hoc_commands": "/awx/api/v2/ad_hoc_commands/",
  "system_job_templates": "/awx/api/v2/system_job_templates/",
  "system_jobs": "/awx/api/v2/system_jobs/",
  "schedules": "/awx/api/v2/schedules/",
  "roles": "/awx/api/v2/roles/",
  "notification_templates": "/awx/api/v2/notification_templates/",
  "notifications": "/awx/api/v2/notifications/",
  "labels": "/awx/api/v2/labels/",
  "unified_job_templates": "/awx/api/v2/unified_job_templates/",
  "unified_jobs": "/awx/api/v2/unified_jobs/",
  "activity_stream": "/awx/api/v2/activity_stream/",
  "workflow_job_templates": "/awx/api/v2/workflow_job_templates/",
  "workflow_jobs": "/awx/api/v2/workflow_jobs/",
  "workflow_approvals": "/awx/api/v2/workflow_approvals/",
  "workflow_job_template_nodes": "/awx/api/v2/workflow_job_template_nodes/",
  "workflow_job_nodes": "/awx/api/v2/workflow_job_nodes/",
  "mesh_visualizer": "/awx/api/v2/mesh_visualizer/",
  "bulk": "/awx/api/v2/bulk/",
  "analytics": "/awx/api/v2/analytics/"
}
  • 查看awx系统状态
代码语言:javascript
复制
curl -s $CONTROLLER_HOST/api/v2/ping/ | jq .
  • 查看作业列表
代码语言:javascript
复制
curl -u admin:admin $CONTROLLER_HOST/api/v2/jobs/
  • 启动作业
代码语言:javascript
复制
curl -u admin:admin $CONTROLLER_HOST/api/v2/job_templates/{id}/launch/
  • 查看某个作业信息
代码语言:javascript
复制
curl -u admin:admin $CONTROLLER_HOST/api/v2/jobs/5/
  • 查看某个作业输出
代码语言:javascript
复制
curl -u admin:admin $CONTROLLER_HOST/api/v2/jobs/5/stdout/?format=txt
  • 同步项目
代码语言:javascript
复制
curl -u admin:admin $CONTROLLER_HOST/api/v2/projects/{id}/update/

LEo at 00:12

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档