[英]How can I create a application to login into another website with no API
[英]How do I create a job in Rundeck to test a website login?
我是 Rundeck 的初學者,我想創建一個工作來測試特定網站的登錄。 我怎么做?
您可以使用 CURL 調用站點 API 的內聯腳本步驟創建作業。
例如,要針對 rundeck 本身進行測試,您可以在 rundeck 作業中使用以下腳本:
curl -v -c cookie -b cookie -d j_username=admin -d j_password=admin http://localhost:4440/j_security_check \
-H "Accept: application/json" \
http://localhost:4440/api/38/system/info/
以及作業定義,您可以將其復制並保存為 YAML 文件,然后將其導入到您的項目中進行測試。
- defaultTab: nodes
description: ''
executionEnabled: true
id: 2dc15b18-5b2c-4081-be72-17eb3618d68c
loglevel: INFO
name: Login
nodeFilterEditable: false
plugins:
ExecutionLifecycle: null
scheduleEnabled: true
sequence:
commands:
- fileExtension: .sh
interpreterArgsQuoted: false
script: |-
curl -v -c cookie -b cookie -d j_username=admin -d j_password=admin http://localhost:4440/j_security_check \
-H "Accept: application/json" \
http://localhost:4440/api/38/system/info/ | jq
scriptInterpreter: /bin/bash
keepgoing: false
strategy: node-first
uuid: 2dc15b18-5b2c-4081-be72-17eb3618d68c
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.