兩邊的前次修訂版 前次修改
| |
tech:alpine_semaphore:api [2024/01/02 19:37] – 3. Remove task jonathan | tech:alpine_semaphore:api [2024/01/02 19:45] (目前版本) – [5. Get template] jonathan |
---|
* Connection #0 to host localhost left intact | * Connection #0 to host localhost left intact |
</cli>++ | </cli>++ |
| |
| ==== 4. Remove template ==== |
| * 需要使用到 API token : p5wyfpx9wge4wu57ytfkx9msmu0efke6yqvzapfd3hg= |
| * 預計刪除 template : 1 |
| * 屬於這 template 的所有 task 都會一併刪除 |
| * <cli> |
| curl -X 'DELETE' 'http://localhost:3000/api/project/1/templates/1' -H 'accept: application/json' -H 'Authorization: Bearer p5wyfpx9wge4wu57ytfkx9msmu0efke6yqvzapfd3hg=' |
| </cli> |
| * ++實際操作畫面|<cli> |
| semaphore-44:~/cli-work# curl -X 'DELETE' 'http://localhost:3000/api/project/1/templates/1' -H 'accept: application/json' -H 'Authorization: Bearer p5wyfpx9wge4wu57ytfkx9msmu0efke6yqvzapfd3hg=' |
| </cli>++ |
| |
| ==== 5. Get template ==== |
| * 需要使用到 API token : p5wyfpx9wge4wu57ytfkx9msmu0efke6yqvzapfd3hg= |
| * 預計取得 template : 2 |
| * <cli> |
| curl -X 'GET' 'http://localhost:3000/api/project/1/templates/2' -H 'accept: application/json' -H 'Authorization: Bearer p5wyfpx9wge4wu57ytfkx9msmu0efke6yqvzapfd3hg=' |
| </cli> |
| * ++實際操作畫面|<cli> |
| semaphore-44:~/cli-work# curl -X 'GET' 'http://localhost:3000/api/project/1/templates/2' -H 'accept: application/json' -H 'Authorization: Bearer p5wyfpx9wge4wu57ytfkx9msmu0efke6yqvzapfd3hg=' |
| { |
| "id": 2, |
| "project_id": 1, |
| "inventory_id": 2, |
| "repository_id": 1, |
| "environment_id": 1, |
| "name": "daliy-update-ubuntu", |
| "playbook": "upgrade.yml", |
| "arguments": null, |
| "allow_override_args_in_task": false, |
| "description": null, |
| "vault_key_id": null, |
| "type": "", |
| "start_version": null, |
| "build_template_id": null, |
| "view_id": 1, |
| "last_task": { |
| "id": 28, |
| "template_id": 2, |
| "project_id": 1, |
| "status": "success", |
| "debug": false, |
| "dry_run": false, |
| "diff": false, |
| "playbook": "", |
| "environment": "", |
| "limit": "", |
| "user_id": null, |
| "created": "2024-01-02T10:35:00.001752Z", |
| "start": "2024-01-02T10:35:03.218576Z", |
| "end": "2024-01-02T10:35:32.726596Z", |
| "message": "", |
| "commit_hash": null, |
| "commit_message": "", |
| "build_task_id": null, |
| "version": null, |
| "arguments": null, |
| "tpl_playbook": "upgrade.yml", |
| "tpl_alias": "daliy-update-ubuntu", |
| "tpl_type": "", |
| "user_name": null, |
| "build_task": null |
| }, |
| "autorun": false, |
| "survey_vars": null, |
| "suppress_success_alerts": false |
| } |
| </cli>++ |
| |
| |
| |
{{tag>ansible semaphore}} | {{tag>ansible semaphore}} |
| |