btp.Configuration: /home/user/.cache/.btp/config.jsonbtp uses./home/user/.cache/ directory.ls -la | grep .cache), it's fairly clear that it's ephemeral - here it's a symbolic link to a directory in /tmp/:lrwxrwxrwx 1 root root 20 Sep 7 09:01 .cache -> /tmp/usertemp/.cache/tmp/ is guaranteed to be there after a restart. Given that this is where btp stores configuration, what happens when our App Studio dev space is stopped and then restarted? Well, let's find out.btp with no further parameters. If we're logged in, we should see something like this (i.e. btp shows us the details of our connection and identity):SAP BTP command line interface (client v2.8.0)
Usage: btp [OPTIONS] ACTION [GROUP/OBJECT] [PARAMS]
CLI server URL: https://cpcli.cf.eu10.hana.ondemand.com (server v2.8.0)
User: P0003480944 (sapdeveloper@example.com)
Configuration: /home/user/.cache/.btp/config.json
Current target:
Global account (subdomain: 82715b8dtrial-ga)
└─ Subaccount (ID: b8a33bf9-b155-4736-aadf-582dae8fd65a)
Tips:
For information about the targeting mechanism, use 'btp --help target'.
To display general help, use 'btp --help'.
OKI find the quickest way to get back to the App Studio's "Dev Space Manager" is just to remove the hashpath from the URL; in this example, it would be by removing#ws-kvhjcfromhttps://82715b8dtrial.eu10cf.trial.applicationstudio.cloud.sap/index.html#ws-kvhjc(this is the dev space's ID).
.cache/ directory (we can refer to this relative name as we'll be in our home directory /home/user/ by default in a newly created terminal anyway):ls --all --dereference --recursive .cache/the options given tolshere make sure we see hidden files (--all) (remember that.btpbegins with a dot and is therefore hidden by default), that symbolic links are followed (--dereference) and that the list descends recursively (--recursive); normally I'd write this asls -aLR .cache/.
.btp/ directory or anything in it, because it's not there any more (any content that is there will have been recreated when the dev space was restarted).btp again. This is the result:Welcome to the SAP BTP command line interface (client v2.8.0)
Usage: btp [OPTIONS] ACTION [GROUP/OBJECT] [PARAMS]
CLI server URL: not set
User: not set
Configuration: /home/user/.cache/.btp/config.json
You are currently not logged in.
Tips:
To log in to a global account of SAP BTP, use 'btp login'. For help on login, use 'btp --help login'.
To display general help, use 'btp --help'.
OKbtp will create a config.json file on invocation. Use the ls command again to see, and you should see (amongst the other content that was there) this:.cache:
. .. .btp
.cache/.btp:
. .. config.jsonconfig.json? Basically, this:{
"ServerURL": "",
"SubDomain": "",
"UserName": "",
"RefreshToken": "",
"Directory": "",
"Subaccount": "",
"Version": "2.8.0",
"Authentication": {
"User": "",
"Mail": ""
},
"TrustedURLs": null,
"Autocomplete": null
}btp shows nothing, and that we're not logged in any more.XDG_CONFIG_HOME is one of those, and "defines the base directory relative to which user-specific configuration files should be stored.". Moreover, it goes on to say: "If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.". That works as a nice default for me.--config option, which you'll need to specify on each invocation of btp, or using the environment variable SAPCP_CLIENTCONFIG..config/btp/config.jsonSAPCP_CLIENTCONFIG in the same file as we added the bin/ directory to our path in the previous post. This is the .bashrc file in our home directory.
.bashrc file from the Explorer, and at the bottom, add content so it looks like this:export PATH=$PATH:$HOME/bin
export SAPCP_CLIENTCONFIG=$HOME/.config/btp/config.json.bashrc file to be processed, and you can then check that the SAPCP_CLIENTCONFIG environment variable is indeed now set:echo $SAPCP_CLIENTCONFIG/home/user/.config/btp/config.jsonbtp target command to specify your trial subaccount too.btp on its own now should show familiar information:SAP BTP command line interface (client v2.8.0)
Usage: btp [OPTIONS] ACTION [GROUP/OBJECT] [PARAMS]
CLI server URL: https://cpcli.cf.eu10.hana.ondemand.com (server v2.8.0)
User: P0003480944 (sapdeveloper@example.com)
Configuration: /home/user/.config/btp/config.json
Current target:
Global account (subdomain: 82715b8dtrial-ga)
└─ Subaccount (ID: b8a33bf9-b155-4736-aadf-582dae8fd65a)
Tips:
For information about the targeting mechanism, use 'btp --help target'.
To display general help, use 'btp --help'.
OKSAPCP_CLIENTCONFIG. Great!btp, you should see that your configuration has survived, and you're still logged in. Great!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 19 | |
| 17 | |
| 14 | |
| 10 | |
| 10 | |
| 9 | |
| 9 | |
| 8 | |
| 8 | |
| 8 |