A newer version of this documentation is available.

View Latest

analytics-link-setup

      +

      Manage Analytics links

      SYNOPSIS

      couchbase-cli analytics-link-setup [--cluster <cluster>] [--username <username>]
          [--password <password>] [--create] [--delete] [--edit] [--list]
          [--dataverse <name>] [--scope <name>] [--name <name>] [--type <type>]
          [--hostname <hostname>] [--link-username <username>] [--link-password <password>]
          [--user-certificate <path>] [--user-key <path>] [--certificate <path>]
          [--encryption <type>] [--access-key-id <id>] [--secret-access-key <key>]
          [--session-token <token>] [--region <region>] [--service-endpoint <url>]
          [--connection-string <key>] [--account-name <id>] [--account-key <key>]
          [--shared-access-signature <token>] [--blob-endpoint <url>] [--endpoint-suffix <url>]

      DESCRIPTION

      This command is used to manage links used by the external dataset and remote cluster capabilities of the Analytics Service.

      OPTIONS

      -c
      --cluster

      Specifies the hostname of a node in the cluster. See the HOST FORMATS section for more information on specifying a hostname.

      -u
      --username <username>

      Specifies the username of the user executing the command. If you do not have a user account with permission to execute the command then it will fail with an unauthorized error.

      -p
      --password <password>

      Specifies the password of the user executing the command. If you do not have a user account with permission to execute the command then it will fail with an unauthorized error. If this argument is specified, but no password is given then the command will prompt the user for a password through non-echoed stdin. You may also specify your password by using the environment variable CB_REST_PASSWORD.

      --create

      Creates a new link.

      --delete

      Deletes a link.

      --edit

      Edits a link.

      --list

      List defined links.

      --name <name>

      The name for the link.

      --type <type>

      The type of the link. It can be 'couchbase', 's3' or 'azureblob'.

      --dataverse <name>

      (Deprecated) The dataverse of the link. Use --scope instead.

      --scope <name>

      The scope of the link in its canonical form. The canonical form of a scope is each part of the form, joined with a '/' character. e.g. the canonical form of the scope '`remote.links`.s3' would be represented as 'remote.links/s3'

      Following are the options specific to --type couchbase, i.e. Couchbase links

      --hostname <hostname>

      The hostname of the link.

      --encryption <type>

      Specifies the type of encryption to use. This flag may be set to 'half', 'full', or 'none'. Half encryption means that passwords are encrypted, but data is not. This results in faster data transfer, but less security. Full encryption means that all data and passwords are encrypted which increases security, but reduces overall data transfer speed. If no encryption is needed then "none" can be specified.

      --link-username <username>

      The username of the link.

      --link-password <password>

      The password of the link.

      --user-certificate <path>

      The local path to the file containing the user certificate for authentication. This and --user-key are used in place of --link-username and --link-password when utilizing certificate-based authentication. Certificate-based auth requires --encryption full.

      --user-key <path>

      The local path to the file containing the user key for authentication. This and --user-certificate are used in place of --link-username and --link-password when utilizing certificate-based authentication. Certificate-based auth requires --encryption full.

      --certificate <path>

      The local path to the file containing the certificate used for encryption. Required with --encryption full.

      Following are the options specific to --type s3, i.e. S3 links

      --access-key-id <id>

      The access key ID of the s3 link.

      --secret-access-key <key>

      The secret access key of the s3 link.

      --session-token <token>

      The session token of the s3 link. This is used when Multi-Factor Authentication (MFA) temporary credentials are used.

      --region <region>

      The region of the s3 link.

      --service-endpoint <url>

      The service endpoint of the link (optional).

      Following are the options specific to --type azureblob, i.e. Azure Blob links

      --connection-string <key>

      The connection string of the link. Only a single authentication method can be used at a time. Authentication method can be connection string, account name & account key, or account name & shared access signature.

      --account-name <id>

      The account name of the link. Only a single authentication method can be used at a time. Authentication method can be connection string, account name & account key, or account name & shared access signature.

      --account-key <key>

      The account key of the link. Only a single authentication method can be used at a time. Authentication method can be connection string, account name & account key, or account name & shared access signature.

      --shared-access-signature <token>

      The shared access signature of the link. Only a single authentication method can be used at a time. Authentication method can be connection string, account name & account key, or account name & shared access signature.

      --blob-endpoint <url>

      The blob endpoint of the link (optional).

      --endpoint-suffix <url>

      The endpoint suffix of the link (optional).

      HOST FORMATS

      When specifying a host for the couchbase-cli command the following formats are expected:

      • couchbase://<addr>

      • <addr>:<port>

      • http://<addr>:<port>

      It is recommended to use the couchbase://<addr> format for standard installations. The other two formats allow an option to take a port number which is needed for non-default installations where the admin port has been set up on a port other that 8091.

      EXAMPLES

      To create a new link to a Couchbase cluster named "east", run the following command:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --create --scope Default --name east --type couchbase \
       --hostname 192.168.1.6 --link-username Administrator \
       --link-password password --encryption none

      If the new remote reference should be fully encrypted then make sure to enable encryption:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --create --scope Default --name east --type couchbase \
       --hostname 192.168.1.6 --link-username Administrator \
       --link-password password --encryption full \
       --certificate /root/cluster.cert

      To create an S3 link named myAwsLink in the "`remote.links`.s3" scope, run the following command:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --create --scope remote.links/s3 --name myAwsLink --type s3 \
       --region us-west-2 --access-key-id LOREMIPSUMDOLORSITAMET123 \
       --secret-access-key CoNSEcteTuRadipIsciNGelITSEDDoeiUSmODTEMpor456

      To create an S3 link named myAwsLink in the "`remote.links`.s3" scope, with temporary S3 credentials, run the following command:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --create --scope remote.links/s3 --name myAwsLink --type s3 \
       --region us-west-2 --access-key-id myTemporaryAccessKeyId \
       --secret-access-key myTemporarySecretAccessKey \
       --session-token myTemporarySessionToken

      Note: Azure Blob links are supported only in Developer Preview mode.

      To create an AzureBlob link named myAzureBlobLink in the "`remote.links`.s3" scope, using "connection string" for authentication, run the following command:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --create --scope remote.links/s3 --name myAzureBlobLink --type \
       azureblob --connection-string myConnectionString

      To create an AzureBlob link named myAzureBlobLink in the "`remote.links`.s3" scope, using "account name and account key" for authentication, run the following command:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --create --scope remote.links/s3 --name myAzureBlobLink --type \
       azureblob --account-name myAccountName --account-key myAccountKey

      To create an AzureBlob link named myAzureBlobLink in the "`remote.links`.s3" scope, using "account name and shared access signature" for authentication, run the following command:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --create --scope remote.links/s3 --name myAzureBlobLink --type \
       azureblob --account-name myAccountName --shared-access-signature \
       mySharedAccessSignature

      To create an AzureBlob link named myAzureBlobLink in the "`remote.links`.s3" scope, using "account name and shared access signature" for authentication, and using a custom endpoint, run the following command:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --create --scope remote.links/s3 --name myAzureBlobLink --type \
       azureblob --account-name myAccountName --shared-access-signature \
       mySharedAccessSignature --blob-endpoint my-custom-endpoint.com

      To list all current links, run the following command:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --list

      To list current S3 links, run the following command:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --list --type s3

      To list current AzureBlob links, run the following command:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --list --type azureblob

      If you need to edit a link named "east" and change the password, run the following command:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --edit --scope Default --name east --type couchbase \
       --hostname 192.168.1.6 --link-username Administrator \
       --link-password new_password --encryption half

      Note in the above example that you need to re-specify all of the current unchanging configuration parameters in addition to changing ones, except --type which cannot change.

      If a link is no longer needed it can be deleted. The following example deletes the link named "east" in the "Default" scope:

      $ couchbase-cli analytics-link-setup -c 192.168.1.5 -u Administrator \
       -p password --delete --scope Default --link east

      ENVIRONMENT AND CONFIGURATION VARIABLES

      CB_REST_USERNAME

      Specifies the username to use when executing the command. This environment variable allows you to specify a default argument for the -u/--username argument on the command line.

      CB_REST_PASSWORD

      Specifies the password of the user executing the command. This environment variable allows you to specify a default argument for the -p/--password argument on the command line. It also allows the user to ensure that their password are not cached in their command line history.

      COUCHBASE-CLI

      Part of the couchbase-cli suite