-
-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Labels
help wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested
Description
Hey, I have an usecase where I need to perform an HTTP request to a REST API, which will perform another request to another REST API. To check that this request is performed I use tcpdump in my terminal. It works well but I would like to make fully autonomous using runn.
I tried to use the concurrency field on include notebook in step. However, it did not work.
main runbook:
steps:
init:
include: ./init_log.yaml
list_logs:
http:
/mypath
get:
headers:
Authorization: "Bearer xxxx"
body:
application/json: null
test: |
current.res.status == 200
export_log:
include:
path: ./export_log_http.yaml
network_test:
include: ./export_log_network.yaml
servers:
include: ./export_log_server.yaml
cleanup:
include: ./cleanup.yaml
force: truenetwork runbook:
debug: true
if: included
vars:
netInt: ${NETWORK_INTERFACE:-ens33}
host: ${PACKAGE_HOSTNAME:-localhost}
port: ${PACKAGE_PORT:-9000}
concurrency: export-log-request
steps:
export_log:
exec:
command: |
tcpdump -i {{ vars.netInt }} -c 1 'host {{ vars.host }} and port {{ vars.port }}'
test:
current.stdout contains "1 packet captured"http runbook:
debug: true
runners:
http:
endpoint: ${TEST_HTTP_ENDPOINT:-http://localhost:9004}
trace: true
if: included
concurrency: export-log-request
steps:
export_log:
http:
/mypath
post:
headers:
Authorization: "Bearer xxxx"
body: nullnetcat server to simulate the other service:
debug: true
if: included
vars:
host: ${PACKAGE_HOSTNAME:-localhost} # There is probably a way to use this with netcat
port: ${PACKAGE_PORT:-9000}
concurrency: export-log-request
steps:
export_log:
exec:
command: |
nc -l -p {{ vars.port }} -w 1Is there any way to perform this operation like I want in the main ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested