Thanks to @joseph.shepherd who field tested these instructions. I've made a change from the feedback to use aura-cli credential list
rather than aura-cli config list
Here's what you need to do to set Introspection On / Off using the Aura API.
Although we will use CURL to enable / disable introspection, we will need to use the Aura CLI to get the Instance ID, the ID of the associated GraphQL API , and tell us the token to use with the Aura API.
Get the Aura CLI installed and configured by following the steps given in the GraphQL Beta Prerequisites
Onto finding the Instance ID. List all of your Aura instances using the table output which makes it easier to locate the ID
aura-cli instance list --output table
Make a note of the instance ID.
Now get the ID of the GraphQL API for that instance, changing YOUR_INSTANCE_ID for your value
aura-cli data-api graphql list --instance-id YOUR_INSTANCE_ID
Write down the ID of the GraphQL Data API
Finally, we need a token to auth to the Aura API. The Aura CLI caches these locally as the tokens last for 1 hour and there is no point in getting another one until it expires. This also avoids spamming the token endpoint.
You can see the token by asking the Aura CLI for it's configuration settings. Do this with
aura-cli credential list
This returns a JSON document that contains the current token as the value for the key access-token
Make a note of that as well
At this point you should have three items
- ID of the GraphQL API
- ID of the associated Aura Instance
- A token for the Aura API
Here's the CURL command to set Instrospection on using those values
curl --location --request PATCH 'https://api.neo4j.io/v1beta5/instances/YOUR_AURA_INSTANCE_ID/data-apis/graphql/YOUR_GRAPHQL_API_ID' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_AURA_API_TOKEN ' \
--data '{
"security": {
"introspection_enabled": true
}
}
}'
To disable introspection, set the value to false