#Dagger session

1 messages · Page 1 of 1 (latest)

idle sphinx
#

You need to start a dagger session, which launches the API's GraphQL server. That's usually done by the Dagger CLI (e.g., dagger run, dagger query...). If you have a running session then you can make any HTTP request to the API, even with curl.

idle sphinx
#

By the way, dagger run -h shows you an example of using curl:

    jq -n '{query:"{container{id}}"}' | \
      dagger run sh -c 'curl -s \
        -u $DAGGER_SESSION_TOKEN: \
        -H "content-type:application/json" \
        -d @- \
        http://127.0.0.1:$DAGGER_SESSION_PORT/query'

dagger run just establishes a session, exports a few env vars and runs whatever the command you put in front:

> dagger run env | grep DAGGER
DAGGER_SESSION_PORT=53330
DAGGER_SESSION_TOKEN=10bc35dd-80b6-4876-968d-33dc4a80f814