Is there any way to get all the tenant details C8Y microservice.
@prakash.veer06 Can you please explain your query in more details. Are you want to list down all the tenants through microservices?
Hello Vachaspati,
I have one microservice which will be deployed in various tenants. This microservice will have some calculations and will make some rest get API calls to the tenant itself.
Ex : Tenant A
Tenant B
Inside Tenant A, is there any way to get the tenant URL to make get API call and same goes to Tenant B.
Hi,
few comments that might help you here:
- Your microservice is gettting various environment variables injected at runtime. This includes e.g. the Base-URL, the tenant ID and Service credentials. See a list of available env vars here: General aspects - Cumulocity IoT Guides.
- For your REST Calls, include the Tenant in your username, so use
{Tenant-Id}/{Username}
as your User. - If your developing a multi-tenant Microservice, you can do a
GET /application/currentApplication/subscriptions
with your bootstrap user (available as environment variable). It will return all tenant’s this service is currently subscribed (including tenant-ID and credentials) - If you’re using Java SDK, take a look at
MicroserviceSubscriptionsService
, it provides you with details about your current subscriptions.
Can you call REST …
https://<TENANT_DOMAIN>/tenant/tenants/
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.