Quantcast
Channel: A Portal to a Portal
Viewing all articles
Browse latest Browse all 1850

TIL - Logging into IBM Cloud with fewer keystrokes

$
0
0

So, back in the day i.e. earlier today, this is how I'd log into IBM Cloud: -

ic login --apikey $(cat ~/keyfile_staging_payg.json | jq -r .apikey) -r us-south -a 

where I'm using cat and jq to parse a JSON document containing my API key: -

cat ~/keyfile_staging_payg.json | jq -r .apikey

Well, today I learned that I can do it in fewer keystrokes ...

ic login --apikey @keyfile_staging_payg.json -r us-south -a https://test.cloud.ibm.com

In other words, I'm using @ rather than a combination of cat and jq.

Now, personally, I use aliases to make life even easier e.g.

testlogin='ic login --apikey @~/keyfile_staging_payg.json -c 19f41865a1cf430c918334d89f6b09b9 -r us-south -a https://test.cloud.ibm.com'

where said aliases are defined in ~/.bash_profile or ~/.zshenv.

All of which is nice!



Viewing all articles
Browse latest Browse all 1850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>