getDependencies callback and is the focus of this post.getDependencies? The official documentation gives us a hint:If your application consumes any reuse services provided by SAP, you must implement the getDependencies callback to return the service dependencies of the application. The callback must return a 200 response code and a JSON file with the dependent services appName and appId, or just the xsappname.
getDependencies must return it. But how do you know if a service is a reuse service, is there a list somewhere? As far as I know, the answer is no. Still, experience has shown these services fit the description:getDependencies and what services we need to included in its response, the next step is to understand when SAP BTP will attempt to getDependencies. As you might expect, it accesses this endpoint during subscription creation and update events.onSubscription endpoint, the getDependencies endpoint is also accessed. So when activating the new subscription from the customer subaccount, SAP BTP calls both onSubscription and getDependencies to complete the subscription.getDependencies call so SAP BTP can retrieve an updated list of services needed by the subscribed customer.PATCH /saas-manager/v1/application/tenants/{tenantId}/subscriptions
Update the dependencies of a multitenant application.
getDependencies endpoint to include the new service and then execute that PATCH request against the tenant to update.getDependencies it also triggers a new call to onSubcription. This can be problematic if you assumed onSubscription will only be accessed during the subscription creation.onSubscription request body that allows us to distinguish which event this is, the eventType field. For new subscriptions, the value is CREATE while in subscription updates the value is UPDATE. So, if you have logic in onSubscription you only wanted executed on subscription creation, just check the eventType.getDependencies is relevant: during subscription creations and updates. Both events result in calls to both onSubscription and getDependencies so it is important that your onSubscription logic can account for this.PUT {onSubscription}/{tenantId}
{
...
"eventType": "CREATE"
}
GET {getDependencies}?tenantId={tenantId}
PATCH endpoint in the SaaS Provisioning API. Results in these callbacks:PUT {onSubscription}/{tenantId}
{
...
"eventType": "UPDATE"
}
GET {getDependencies}?tenantId={tenantId}
getDependencies works within the Saas Provisioning service. Maybe this documentation exists and I'm just not good enough to find it and if that's the case, I invite any readers to share where I can find that. If it does not actually exists, I hope this post can help others that have struggled with the same issues I have.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 3143 | |
| 1916 | |
| 1916 | |
| 1212 | |
| 1079 | |
| 757 | |
| 755 | |
| 742 |