Closed CarstenLeue closed 2 years ago
You should probably use the platform services SDK https://github.com/IBM/platform-services-node-sdk. See:
The response of "Get a resource instance" contains the CRN.
@thu2thu2 thank you for the pointer. I think this is a feasible but inconvenient way, because I have to setup configuration for a completely different service in order to retrieve information about a service I already have an SDK object for.
Would it be possible to expose an API in the SDK that invokes your suggested workaround internally, so as a consumer I only have to deal with one SDK object?
@CarstenLeue I believe this function should belong to platform services SDK
hmm ok. I'll close the issue, then
In order to interface with a different API I need the CRN of the service instance. I do have an instance of the SDK object at hand which is configured via the endpoint URL and the service ID (according to doc). But I cannot find a way to use the SDK API to return the CRN of the instance.
As a workaround I was thinking to create a key, read the CRN of the key and delete the key immediately. The from the CRN of the key strip off the CRN of the service. But this seems to be unnecessarily complicated. Is there a better way?