add-endpoint

Add an endpoint to query databases.

Syntax

fauna add-endpoint ENDPOINT_URL [OPTIONS]

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

Endpoint URL you want to add.

fauna-shell identifies the URL scheme, domain, and port and includes those values in the new endpoint entry that it creates in the configuration file.

Options

Option Description

--alias=<endpoint alias>

(Optional) Endpoint name alias that identifies a given endpoint.

--key=<secret>

(Optional) Secret associated with an endpoint database. This secret is the authentication key needed to run queries.

--domain=<domain>

(Optional) Fauna server domain, which is the Fauna hostname.
Default = db.fauna.com

--endpoint=<name>

(Optional) Endpoint name to use for the command.

--port=<number>

(Optional) Connection port.
Default = 8443

--scheme=<scheme>

(Optional) Connection scheme. Must be one of:
       https (default)
       http

--secret=<secret>

(Optional) Secret to use to connect to a database.

--timeout=<integer>

(Optional) connection timeout, in milliseconds. When the interval elapses, fauna-shell times out and displays an error.
Default = 0, wait indefinitely until a response is received.

--version

(Optional) Fauna Query Language version
       v10 = (default) FQL v10
       v4 = FQL v4

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!