cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Service/instance name

dirkwiegele
Explorer
0 Kudos

Hello,

in the Global Account you can get an export from "Costs and Usage".
I would like to process this automatically and assign it internally to our cost centers. To do this, I have created labels for each service in each subaccount.
I can read the labels via BTP CLI.
For the environments, I can search for the service name e.g. "alert-notification" in the BTP catalog and under displayname I get the service name "Alert Notification".

The output of the API for the subscription already contains the display name.

I would like to read out all the services used from our BTP subaccounts. I do this via btp --format json get services/instance.
The result is the following json structure.

 

 

{
"id": "abc1234",
"ready": true,
"last_operation": {
"id": "abc1234",
"ready": true,
"type": "update",
"state": "succeeded",
"resource_id": "abc1234",
"resource_type": "/v1/service_instances",
"platform_id": "service-manager",
"correlation_id": "abc1234",
"reschedule": false,
"reschedule_timestamp": "0001-01-01T00:00:00Z",
"deletion_scheduled": "0001-01-01T00:00:00Z",
"created_at": "2024-03-18T12:44:30.456748Z",
"updated_at": "2024-03-18T12:44:30.493928Z"
},
"name": "freely assignable name",
"service_plan_id": "abc1234",
"platform_id": "abc1234",
"dashboard_url": "https://*.hana.ondemand.com",
"context": {
"platform": "sapcp",
"organization_guid": "abc123",
"space_guid": "abc123",
"organization_name": "abc123",
"space_name": "abc123",
"organization_annotations": {},
"space_annotations": {},
"instance_name": "freely assignable name",
"zone_id": "abc123",
"global_account_id": "abc123",
"subaccount_id": "abc123",
"env_type": "abc123",
"env_provider": "abc123",
"landscape_label": "abc123",
"origin": "abc123",
"license_type": "CUSTOMER",
"subdomain": "abc123",
"region": "abc123",
"crm_customer_id": "abc123"
}
}

 


Unfortunately, the Name field contains a freely assignable name and not the BTP catalog name(Displayname).

With "btp --format json list accounts/entitlement -ga subdomain" you get all services from the BTP catalog.
There you will find e.g. "displayName": "Alert Notification".
What is "btp --format json get services/instance" linked to in order to get the display name from the catalog?

 

Best regards 

 

Accepted Solutions (0)

Answers (1)

Answers (1)

StoyanBabev
Employee
Employee
0 Kudos

Hi, 

Since we are not experts on how the BTP CLI operates, we are unable to provide you with precise information on how the command "btp --format json get services/instance" retrieves the display name from the catalog. We do not have ownership of this BTP client. For further clarification and information, I recommend reaching out to the appropriate team responsible for developing and maintaining this client. They should be able to provide you with the necessary insights and assistance regarding its functionalities.

Best,
Stoyan