CLI Client

Managing REST API servers

The config command

Using the config command allows you to manage your Scalable Pixel Streaming servers by registering a name, API endpoint and access key for each of your servers.

Commands

The following sub-commands are available for the config command:

  • add - Registers an SPS server
  • delete - Deletes a registered SPS server
  • list - Lists all registered servers
  • set-default - Sets the default SPS server
  • view - View contents of sps-client config file

Flags

The following flags are available for the config command:

  • -h, --help - print out help for config command

Adding a new REST API server with the config add command

This command has three mandatory flags for you to specify the REST API endpoint, its access key and the desired name for the server to be assigned in the CLI client, using the --access-key, --address, and --name flags respectively, for example:

sps-client config add --address <http://api-endpoint-url.example.com> --access-key <access-key> --name <server-name>

Upon successfully adding a REST API server, you should see the following:

Server <server-name> has been registered successfully

The --skip-health-check flag

Using the --skip-health-check flag can result in an invalid server being added to your configuration and should be used sparingly.

When adding a server, the tool will attempt to connect to the REST API with the provided credentials and will return an error if the server can’t be reached. Use this flag to skip this check and add the server regardless:

sps-client config add --name <http://api-endpoint-url.example.com> --access-key <access-key> --name <server-name> --skip-health-check

Flags

  • --access-key - Access key generated by the REST API server
  • --address - URL of the SPS REST API endpoint
  • -h, --help - help for add
  • --name - Name of the SPS server
  • --skip-health-check - Skip the check to test if the tool can connect to the REST API

Listing of REST API servers with the config list command

This command requires no flags and will display the list of all servers registered in the client with their respective details, marking the default server with an asterisk:

sps-client config list

An example of the expected output:

Current  Server Name  Address                                                Access Key
   *     sps          http://my-sps-server.com/                              <access-key>
         sps2         http://my-sps-server2.com/                             <access-key>

Flags

  • -h, --help - help for list

Changing the default REST API server with the config set-default command

The most recently registered server will be automatically set as the default. Unless specified otherwise, the default server will be used when managing applications and versions. Use this command to change the default server to any server on the list, specifying its name via --name flag, for example:

sps-client config set-default --name <server-name>

An example of the expected output:

Default server is now set to: <server-name>

Flags

  • -h, --help - help for set-default
  • -n, --name - The name of the SPS Server

Viewing the configuration with the config view command

Use this command without any flags to display the details of the SPS Client configuration file:

sps-client config view

An example of the expected output:

defaultserver: local
lang: en-AU
servers:
    - name: sps
      access_key: <access-key>
      address: http://my-sps-server.com/
    - name: sps2
      access_key: <access-key>
      address: http://my-sps-server2.com/

Flags

  • -h, --help - help for view

Deleting REST API servers with the config delete command

If you delete the default server, you will need to manually specify a new default server with config set-default command.

Use this command with --name flag, specifying which server is to be deleted, for example:

sps-client config delete --name <server-name>

An example of the expected output:

Server <server-name> has been deleted

Flags

  • -h, --help - help for delete
  • --name - Name of a registered SPS server