add-endpoint
Add an endpoint to query databases.
Description
The add-endpoint
command adds a connection ENDPOINT_URL
to the
configuration file. If
you don’t provide a key or alias, you’re prompted for them, and
they are written to the configuration file.
Typically, you should use the
cloud-login
command instead of
this command. cloud-login
guides you through selecting the correct Region Group to connect to. If you
want to connect to a non-standard endpoint, then use the add-endpoint
command.
Arguments
Argument | Description |
---|---|
|
Endpoint URL you want to add.
|
Options
Option | Description |
---|---|
|
(Optional) Endpoint name alias that identifies a given endpoint. |
|
(Optional) Secret associated with an endpoint database. This secret is the authentication key needed to run queries. |
|
(Optional) Fauna server domain, which is the Fauna hostname. |
|
(Optional) Endpoint name to use for the command. |
|
(Optional) Connection port. |
|
(Optional) Connection scheme. Must be one of: |
|
(Optional) Secret to use to connect to a database. |
|
(Optional) connection timeout, in milliseconds.
When the interval elapses, |
|
(Optional) Fauna Query Language version |
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 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!