2023 Aug 18 7:04 AM - edited 2023 Aug 22 5:26 PM
(Check out the SAP Developer Challenge - APIs blog post for everything you need to know about the challenge to which this task relates!)
This task is the first in a group that belong together, and in it you will prepare the ground for the subsequent tasks in that group.
The SAP Business Accelerator Hub contains API and related resources not only for SAP products such as SAP S/4HANA Cloud, SAP SuccessFactors, SAP Ariba, SAP Concur and so on, but also for the SAP Business Technology Platform, as you can see:
The Explore menu
Selecting this entry brings you to an overview page with links to APIs, events, integrations, business processes, workflow management resources and more. You'll see that one of the API packages available is Core Services for SAP BTP which contains multiple REST APIs, including:
and more.
These APIs afford you programmatic access to information on SAP BTP, specifically about your global accounts, subaccounts, directories, entitlements, services and lots more.
In the next few tasks you will take a small journey of discovery, one that will lead you to be able to make calls to these APIs, and in fact you will end up making a specific call to get a feel for how things operate and what you need to make such calls.
In order for everyone to have something consistent to work with, i.e. so that you all end up making essentially the same call, and will get the same results, this task will get you to create a directory in an SAP BTP account, with a custom label. In a subsequent task in this group you'll use the appropriate API in this Core Services for SAP BTP package to retrieve that information.
Your task here is to create a new directory within an SAP BTP global account accessible to you. If you don't have one, you can set up a trial account for free - see the "Hints and tips" section below for details.
Here are the task requirements:
You can do this any way you wish. You may want to use the SAP BTP Cockpit. You may wish to use the btp CLI. See the "Hints and tips" section below for both these approaches.
The value you need to get, to send to be hashed and shared in a reply to this discussion thread (as described, as always, in Task 0), is the length of the new directory's GUID. Not the GUID itself. The GUID consists of groups of hexadecimal digits interspersed with dashes. In calculating the length required, note that you should measure the length of the entire GUID, including the dashes.
If you don't have a global account with which to work (for example, if you only have access to productive accounts at work and can't use them for learning), you can get a trial account on SAP BTP, and it won't cost you anything. You don't even need a credit card to sign up for one. Just follow the instructions in the tutorial Get a Free Account on SAP BTP Trial.
You can create the directory from the Account Explorer section of the SAP BTP Cockpit.
Use the "Create -> Directory" menu from the button and specify the details appropriately, like this:
Once you've created the directory, it should look like this (you may have to adjust the display settings from the "tree view" to the "table view"). Note that the label information is available too in this display:
Of course, as #TheFutureIsTerminal, you may prefer to go for maximum efficiency and use the command line. Luckily for us there's a great command line tool for accessing and manipulating resources on SAP BTP, and that's the btp CLI, available from the SAP Development Tools website. There are plenty of resources on the btp CLI, here are just a few:
Here's a sample session where I use the btp CLI to create the directory, in that I:
# developer-challenge-apis/tasks/7-create-assets-in-an-sap-btp-account (main %=) ; btp login SAP BTP command line interface (client v2.38.0) CLI server URL [https://cpcli.cf.eu10.hana.ondemand.com]> Connecting to CLI server at https://cpcli.cf.eu10.hana.ondemand.com... User> dj.adams@sap.com Password> Authentication successful Choose a global account: [1] c2d7b67atrial [2] ... [3] ... Choose option> 1 Current target: c2d7b67atrial (global account, subdomain: c2d7b67atrial-ga) We stored your configuration file at: /home/user/.config/btp/config.json Tips: Commands are executed in the target, unless specified otherwise using a parameter. To change the target, use 'btp target'. To provide feedback about the btp CLI, use 'btp feedback' to open our survey. OK # developer-challenge-apis/tasks/7-create-assets-in-an-sap-btp-account (main %=) ; btp create accounts/directory \ --display-name "developer-challenge" \ --labels '{"task":[7]}' Creating directory in global account 7da58aab-6c60-4492-a95b-b1ed3139e242... directory id: 57675710-7b16-43ec-b64a-ab14660c1b24 display name: developer-challenge description: directory features: DEFAULT created by: dj.adams@sap.com custom properties: name: value: task 7 labels: name: value: task [7] parent id: 7da58aab-6c60-4492-a95b-b1ed3139e242 parent type: global account state: OK state message: Directory created. Command runs in the background. Use 'btp get accounts/directory' to verify status. OK
Although the value 7 for the task label is scalar, it must be specified in the JSON value for the --labels parameter inside an array, i.e. [7] rather than just 7.
Did you use the cockpit or the CLI tool? Which would or do you prefer? If you used the btp CLI, how did the installation go? Did you install it "natively" or did you use the script described in the SAP Tech Bytes: btp CLI – installation blog post?
What are some of your other power command line tools, inside the SAP ecosphere and also beyond?
2023 Aug 18 9:21 PM
2023 Aug 19 4:03 PM
2023 Aug 20 6:37 AM
2023 Aug 20 8:00 AM
2023 Aug 20 8:34 AM
2023 Aug 20 7:42 PM
2023 Aug 20 8:46 PM
2023 Aug 21 7:22 AM - edited 2023 Aug 21 7:25 AM
2023 Aug 21 8:18 AM
2023 Aug 21 2:20 PM
2023 Aug 21 2:39 PM
2023 Aug 21 9:35 PM
2023 Aug 22 3:42 AM
2023 Aug 22 7:33 AM
2023 Aug 22 7:58 AM
2023 Aug 22 9:41 AM
2023 Aug 22 11:51 AM
2023 Aug 22 12:48 PM
2023 Aug 22 2:00 PM - edited 2023 Aug 23 12:28 PM
2023 Aug 22 2:06 PM
Hey John,
hint, hint: don't put anything but the solution into the reply (see instructions in task 00)
Cheers, Uwe
2023 Aug 22 2:23 PM
2023 Aug 23 7:00 AM
2023 Aug 22 8:46 PM
2023 Aug 23 4:18 AM
2023 Aug 23 8:59 AM
2023 Aug 23 11:30 AM
2023 Aug 23 3:47 PM
2023 Aug 24 3:12 AM
2023 Aug 24 3:18 PM
2023 Aug 24 7:23 PM
2023 Aug 25 3:07 PM
2023 Aug 26 2:33 PM
2023 Aug 26 11:58 PM
2023 Aug 27 2:51 PM
2023 Aug 28 1:20 AM
2023 Aug 28 1:21 AM
2023 Aug 29 7:44 AM
2023 Aug 28 6:30 AM
2023 Aug 28 7:44 AM
2023 Aug 28 9:54 AM - last edited on 2023 Aug 28 9:54 AM by Former Member