SuperAPI AI Directory

bk-cli-sops

Deployment & operations

View repository

Updated 10-16 08:26

About this skill

bk-cli sops — Standard O&M capability usage instructions

Used to call the BlueKing Standard O&M (SOPS) API through the bk-cli sops system subcommands.

CRITICAL — Before starting, you MUST first use the Read tool to read ../bk-cli-shared/SKILL.md. The shared skill handles authentication, context, tenant, stage, dry-run, verbose, header/body, and general request rules; this skill only supplements the sops command's own semantics and input conventions.

Current coverage

This skill currently covers these commonly used commands:

  • get_template_list
  • get_task_list
  • get_task_status
  • get_task_detail
  • create_task
  • start_task
  • operate_task

Commands

Template query

get_template_list

bk-cli sops get_template_list --bk_biz_id 2
bk-cli sops get_template_list --bk_biz_id 2 --keyword deploy
  • Call path:GET /get_template_list/{bk_biz_id}/

Task management

get_task_list

bk-cli sops get_task_list --bk_biz_id 2
bk-cli sops get_task_list --bk_biz_id 2 --keyword deploy --limit 50
  • Call path:GET /get_task_list/{bk_biz_id}/

create_task

bk-cli sops create_task --bk_biz_id 2 --template_id 100 --name "deploy-v1"
bk-cli sops create_task --bk_biz_id 2 --template_id 100 --name "deploy" --constants '{"${key}":"value"}'
  • Create task from template
  • --constants must be a JSON object; the CLI will write it into the request body as a nested object
  • Call path:POST /create_task/{template_id}/{bk_biz_id}/

start_task

bk-cli sops start_task --bk_biz_id 2 --task_id 100
  • Start a created task
  • Call path:POST /start_task/{task_id}/{bk_biz_id}/

get_task_status

bk-cli sops get_task_status --task_id 100 --bk_biz_id 2
  • Call path:GET /get_task_status/{task_id}/{bk_biz_id}/

get_task_detail

bk-cli sops get_task_detail --task_id 100 --bk_biz_id 2
  • Call path:GET /get_task_detail/{task_id}/{bk_biz_id}/

operate_task

bk-cli sops operate_task --bk_biz_id 2 --task_id 100 --action pause
bk-cli sops operate_task --bk_biz_id 2 --task_id 100 --action resume
bk-cli sops operate_task --bk_biz_id 2 --task_id 100 --action revoke
  • Operate task: pause, resume, or terminate
  • action must be one of pause / resume / revoke
  • Call path:POST /operate_task/{task_id}/{bk_biz_id}/