Skip to content

Connections

Before you can use the hubcli command to perform actions on a Hub instance, you have to create a connection. A connection is used to identify to the hubcli command the Hub instance on which the command acts.

You create a connection using the command hubcli connection add, and specify the URL of the Hub instance and the name for the connection. The name you provide is used in other hubcli commands to identify the connection. For example, to create a connection to a Hub instance with the URL https:\\myhub.srv.com, you specify:

hubcli connection add -u https:\\myhub.srv.com myconn

This creates the connection myconn to the Hub instance https:\myhub.srv.com.

Default connections

The first connection you create with this command is automatically specified as the default connection. You do not have to specify a connection to other hubcli commands if there is a connection that has been specified as the default. You can specify that a different connection is to be the default by adding the -d flag when you create a connection:

hubcli connection add -u https:\\myhub.srv.com newconn -d

A connection can also be made default using the another variation of the hubcli command after the connection has been added:

hubcli connection use newconn

All commands used after this command would then use newconn as the default connection. If there is already a default connection, then the default set using this command supercedes the previous default connection.

Note that when you have set a connection as default, it remains the default connection until another connection is made the default. There is no way to remove the default setting from a connection.

Managing connection profiles

Connections to multiple instances of Altair SLC Hub can be configured. Connections defined using the hubcli connection add command are added to the configuration file in your home directory. The path to the configuration file is ~/.hubcli/config.yaml.

Connection definitions can also be shared among Hub users accessing the same Altair SLC Hub host. The definitions are stored in a .yaml file. To access the file, create an environment variable called ALTAIR_HUBCLI_SHARED_CFG and specify the file location to that variable. If set, this environment variable is read on hubcli invocation.

The format of the configuration file is the same as the configuration file stored in your home directory. To populate a shred configuration file, copy the required section from the user configuration file, for example:

connections:
  - name: prod
    url: https://prodhub.example.org:9090