Create an AuraDB instance in the terminal

This tutorial describes using the terminal to create an instance in the Aura Console.

Preparation

Generate API credentials

  • Log in to the Aura Console.

  • Click your email address in the top right corner and select Account details.

  • In the API credentials section, select Create. Enter a descriptive name and save the generated Client ID and Client Secret.

cURL

  • Install cURL via your terminal

  • For macOS with Homebrew: use brew install curl.

  • Install cURL. See curl download wizard for more information.

  • Check cURL is available: Type curl -V in the terminal

Obtain a bearer token

Bearer tokens are valid for one hour.

In the terminal paste the snippet, replacing YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with the values generated by the Aura Console. Keep the : between the values.

curl --location 'https://api.neo4j.io/oauth/token' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=client_credentials' -u 'YOUR_CLIENT_ID:YOUR_CLIENT_SECRET' -v

Response body example

Save the access_token from the end of the returned code. This is your bearer token. It looks similar to this example:

"access_token":"eyJ1c3IiOiJkNzI2MzE1My03MWZmLTUxMjQtOWVjYy1lOGFlM2FjNjNjZWUiLCJpc3MiOiJodHRwczovL2F1cmEtYXBpLmV1LmF1dGgwLmNvbS8iLCJzdWIiOiJFSDdsRTgwbEhWQVVkbDVHUUpEY0M1VDdxZ3BNTnpqVkBjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9jb25zb2xlLm5lbzRqLmlvIiwiaWF0IjoxNzAyOTgzODQzLCJleHAiOjE3MDI5ODc0NDMsImF6cCI6IkVIN2xFODBsSFZBVWRsNUdRSkRjQzVUN3FncE1OempWIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImFKbWhtUTlYeExsQmFLdHNuZnJIcCJ9..jkpatG4SCRnxwTPzfEcSJk3Yyd0u_NMH8epNqmSBMUlp_JvvqbKpNdkPIE6vx5hLRgVCVKovxl4KY9yzEkr7R5s4YU3s2K25eNB1q1y3yQ_-9N0e6eOhmjIrsWHMd_rl2NuGIHo6pHihumuJlEg-U2ELkWyu8Iz3zQxjycVnPHzlbu7sbtwVJdU7UzgO12jgDLA1T4mUqvxdAAdnoXO57SwczYoYKY2YL61CMTn-xdQ6MFS8A3vwpGQbRirwVVxvEmoIPCLlQwHeEC4_modJ4cifmjt6ChJb1sxsRpFvdNHm0vNcLjy-96e88D50AMgjvS4VQCmVKA7kUgt7t5IpKg","expires_in":3600,"token_type":"Bearer"

Obtain the project ID

Use cURL to obtain the project ID with your token. Replace YOUR_BEARER_TOKEN with your token.

curl --location 'https://api.neo4j.io/v1/projects' --header 'Accept: application/json' --header 'Authorization: Bearer YOUR_BEARER_TOKEN'

This returns something similar to:

{"data":[{"id":"6e6bbbe2-5678-5f8a-1234-b1f62f08b98f","name":"team1"},{"id":"ad69ee24-1234-5678-af02-ff8d3cc23611","name":"team2"}]}

In the example response above, two projects are returned. If you’re a member of multiple projects, select the one you wish to use.

Project replaces Tenant in the console UI and documentation. However, in the API, tenant remains the nomenclature.

Configure an AuraDB instance

Configure the instance values

Use the bearer token and Project ID to create the Aura instance. Replace YOUR_BEARER_TOKEN with your token. Replace YOUR_PROJECT_ID with your project ID.

The following values are customizable version, region, memory, name, type, tenant_id, and cloud_provider.

curl --location 'https://api.neo4j.io/v1/instances' --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Bearer YOUR_BEARER_TOKEN' --data ' { "version": "5", "region": "europe-west1", "memory": "8GB", "name": "instance01", "type": "enterprise-db", "tenant_id": "YOUR_PROJECT_ID", "cloud_provider": "gcp" }'

See Aura API documentation for more details.

At this point, an Aura instance is provisioned in the Aura Console. Optionally, use this code in the terminal to check the status:

curl --location 'https://api.neo4j.io/v1/instances/YOUR_INSTANCE_ID' --header 'Accept: application/json' --header 'Authorization: Bearer YOUR_BEARER_TOKEN'

Response

curl --location 'https://api.neo4j.io/v1/instances/YOUR_INSTANCE_ID' --header 'Accept: application/json' --header 'Authorization: Bearer YOUR_BEARER_TOKEN'

If the value of status shows running, you can start using the new Aura instance.