Creating your API key

This content explains how to create an API key and gather some files and environment variable values that are needed when you set up edge nodes. Perform these steps on a host that can connect to your IEAM management hub cluster.

Before you begin

Procedure

If you have configured an LDAP connection, you can use the added users credentials to login and create API keys, or you can use the initial admin credentials printed out by the following command:

echo "$(oc -n ibm-common-services get secret platform-auth-idp-credentials -o jsonpath='{.data.admin_username}' | base64 --decode) // $(oc -n ibm-common-services get secret platform-auth-idp-credentials -o jsonpath='{.data.admin_password}' | base64 --decode)"
  1. Use cloudctl to log in to the IEAM management hub. Specify the user that you want to create an API key for:

    cloudctl login -a <cluster-url> -u <user> -p <password> --skip-ssl-validation
    
  2. Each user who is setting up edge nodes must have an API key. You can use the same API key to set up all of your edge nodes (it is not saved on the edge nodes). Create an API key:

    cloudctl iam api-key-create "<choose-an-api-key-name>" -d "<choose-an-api-key-description>"
    

    Find the key value in the command output; this is the line that starts with API Key. Save the key value for future use because you cannot query it from the system later.

  3. Contact your IEAM administrator for help in setting these environment variables:

    export HZN_EXCHANGE_USER_AUTH=iamapikey:<api-key>
    export HZN_ORG_ID=<your-exchange-organization>
    mgmtHubIngress=$(oc get cm management-ingress-ibmcloud-cluster-info -o jsonpath='{.data.cluster_ca_domain}')
    export HZN_FSS_CSSURL=https://$mgmtHubIngress/edge-css/
    echo "export HZN_FSS_CSSURL=$HZN_FSS_CSSURL"
    

What's next

When you are ready to set up edge nodes, follow the steps in Installing edge nodes.