-
Notifications
You must be signed in to change notification settings - Fork 1
/
btp_entitlements_assignment.md
62 lines (52 loc) · 1.33 KB
/
btp_entitlements_assignment.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Table: btp_entitlements_assignment
Get the details of all the service assignments available to the SAP BTP global account.
## Examples
### Get the business category of all services
```sql
select distinct
business_category ->> 'id' bc_id
from
btp_entitlements_assignment bes;
```
### Nested JSON structures in the Entitlements API
```sql
select
bes.display_name,
service_plans
from
btp_entitlements_assignment bes;
```
### Assignments and quota for a particular business category
```sql
select
bes.display_name,
service_plan ->> 'name' sp_displayname,
service_plan ->> 'amount' sp_amount,
service_plan ->> 'remainingamount' sp_remaining_amount
from
btp_entitlements_assignment bes
cross join
jsonb_array_elements(service_plans) service_plan
where
business_category ->> 'id' = 'AI'
order by
bes.display_name asc;
```
### Assignments and the data centers where they are available
```sql
select
bes.display_name,
service_plan ->> 'name' sp_displayname,
data_centers ->> 'name' dc_name
from
btp_entitlements_assignment bes
cross join
jsonb_array_elements(service_plans) service_plan
cross join
jsonb_array_elements(service_plan -> 'datacenters') data_centers
where
business_category ->> 'id' = 'INTEGRATION'
and data_centers ->> 'name' = 'cf-eu10'
order by
bes.display_name asc;
```