add-endpoint
Add a connection endpoint for Fauna.
Description
The add-endpoint
command adds a connection ENDPOINT_URL
for Fauna to the
fauna-shell
configuration file. If you
don’t specify a key or alias, fauna-shell
prompts you for them and then
writes them to the fauna-shell
configuration file.
For most cases, use the
cloud-login
command instead of
add-endpoint
. cloud-login
guides you through selecting the correct Region Group to connect to. If you
want to connect to the Fauna Preview environment, or another non-standard
endpoint, continue to use add-endpoint
.
Arguments
Argument | Description |
---|---|
|
The URL of the endpoint that you want to add.
|
Options
Option | Description |
---|---|
|
Optional endpoint alias, a name that identifies a particular endpoint. |
|
Optional secret associated with a database at the endpoint. This secret provides the authentication to run queries in Fauna. |
|
Optional Fauna server domain, that is, the hostname where
Fauna is running. Defaults to |
|
Optional name of the endpoint to use for the command. |
|
Optional connection port. Defaults to 8443. |
|
Optional connection scheme. Must be one of |
|
Optional secret to use. A secret authenticates your connection to Fauna, and connects you to a database. |
|
Optional connection timeout, an integer number of milliseconds.
When the interval has elapsed, The default is zero, which means that |
|
Not supported. |
|
Not supported. |
Examples
The following example demonstrates adding a new endpoint. Because the
--alias
and --key
options were not given, fauna-shell
prompts you for them:
$ fauna add-endpoint https://db.fauna.com:8443
Endpoint Key: ******
Endpoint Alias [db.fauna.com]: db2
Endpoint 'db2' saved.
When the fauna-shell
configuration file does not exist, running fauna
add-endpoint
creates the configuration file. The configuration file should
resemble:
default=db2
[db2]
domain=private.example
port=8443
scheme=https
secret=MY_ORGANIZATION_SECRET
When you run the add-endpoint
command again, the new endpoint is added
to the configuration file:
$ fauna add-endpoint http://localhost:8443/ --alias=localhost --key=secret
Endpoint 'localhost' saved.
default=db2
[db2]
domain=private.example
port=8443
scheme=https
secret=MY_ORGANIZATION_SECRET
[localhost]
domain=127.0.0.1
port=8443
scheme=http
secret=secret
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!