btp
binary (in $HOME/bin/
) added to the environment variable $PATH
so that you can invoke it simply as btp
.btp
from a terminal in your App Studio dev space and stare at the output for a moment; it should look something like this: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'.
OK
btp login
SAP BTP command line interface (client v2.8.0)
CLI server URL [https://cpcli.cf.eu10.hana.ondemand.com]>
Connecting to CLI server at https://cpcli.cf.eu10.hana.ondemand.com.
Global account subdomain>82715b8dtrial-ga
User>sapdeveloper@example.com
Password>********
Login successful
We stored your configuration file at: /home/user/.cache/.btp/config.json
Current target:
Global account (subdomain: 82715b8dtrial-ga)
Tip:
For more information on the targeting mechanism, use 'btp --help target'.
OK
https://cpcli.cf.eu10.hana.ondemand.com
) is appropriate.-ga
suffix. Here's a screenshot of the temporary trial account I set up for this set of examples, where the relationship between the global account identifier and the global account subdomain can be seen:btp
again to see the difference. You should now see the version of the server to which you're connected and authenticated, confirmation of your user identification, and also the "current target", being the global account that you specified (via the subdomain) when you logged in. The output should look something like this: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)
Tips:
For information about the targeting mechanism, use 'btp --help target'.
To display general help, use 'btp --help'.
OK
The btp CLI also offers a way to log in through the browser, with the --sso
option.
btp target --subaccount trial
Subaccount 'trial' does not exist in the current global account. Make sure to provide the ID of a subaccount of the current global account.
Tip:
To find your subaccount ID, use 'btp list accounts/subaccount'.
ERROR
btp list accounts/subaccount
Pause for a second to consider the ACTION [GROUP/OBJECT]
command structure we saw earlier - here we're seeing a nice example of that.
subaccounts in global account 906b8d84-2f2c-429d-8ce4-c1bf166aeb08...
subaccount id: display name: subdomain: region: beta-enabled: parent id: parent type: state: state message:
b8a33bf9-b155-4736-aadf-582dae8fd65a trial 82715b8dtrial eu10 true 906b8d84-2f2c-429d-8ce4-c1bf166aeb08 global account OK Updated tenant status to ACTIVE
OK
btp target --subaccount b8a33bf9-b155-4736-aadf-582dae8fd65a
The ID is what you see when selecting "More Info" from the three-dots menu on the "trial" subaccount card in the screenshot we saw earlier.
Targeting subaccount 'b8a33bf9-b155-4736-aadf-582dae8fd65a'.
Commands that only work on global account level will be executed in the parent global account.
Current target:
Global account (subdomain: 82715b8dtrial-ga)
└─ Subaccount (ID: b8a33bf9-b155-4736-aadf-582dae8fd65a)
Tips:
To execute a command in the parent global account, use parameter '-ga' without value.
To execute a command in a different context, specify the subaccount, directory, or global account in the command.
OK
btp get accounts/subaccount
Constraint violated - you must provide parameter 'ID'.
Usage: btp [OPTIONS] get accounts/subaccount ID --global-account SUBDOMAIN
ERROR
target
command, we get what we're looking for:Showing subaccount details for b8a33bf9-b155-4736-aadf-582dae8fd65a...
subaccount id: b8a33bf9-b155-4736-aadf-582dae8fd65a
display name: trial
description:
subdomain: 82715b8dtrial
region: eu10
created by:
beta-enabled: true
used for production: false
parent id: 906b8d84-2f2c-429d-8ce4-c1bf166aeb08
parent type: global account
state: OK
state message: Updated tenant status to ACTIVE
OK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
29 | |
10 | |
9 | |
8 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 |