cloud-sdk-js icon indicating copy to clipboard operation
cloud-sdk-js copied to clipboard

get all the destination from subaccout

Open luckyliwen opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. -Not a problem, just for some use cases that needs to get all the destinations.

Describe the solution you'd like Provide API to get all the destinations such as getAllDestinations(DestinationFetchOptions). In some case, we need do some filter based on the destination name. So the return value can be a string array of the destination name. Then we can filter by ourselves, then call the getDestination() to get the detailed information.

Describe alternatives you've considered As discussed in the StackOverflow question, it should be quite easy to implement such a function

Impact / Priority Highly demand

Additional context N/A

luckyliwen avatar Jun 06 '22 00:06 luckyliwen

Hi @luckyliwen,

Thanks for raising this up. Here are some questions from my side:

  1. From the description below, I assume, you are not blocked due to the missing feature. Could you please confirm?

Not a problem, just for some use cases that needs to get all the destinations.

  1. What's your project status? Is it a PoC or go-live system? What's your time line?

  2. Could you please explain more about "Highly demand" mentioned? Does it mean there are lots of related use cases? Or maybe this is a single use case, but lots of end users need it?

Best regards, Junjie

jjtang1985 avatar Jun 07 '22 06:06 jjtang1985

Good morning @luckyliwen,

I just want to understand the issue a bit better. Should the getAllDestinations just return a list of destination names and you do then the filtering and call to getDestination(name) the details on the destinations you want?

This would be an easy thing to do as @marikaner mentioned in the stack issue - we have the code anyway and just need to export it.

If you would need the full objects, I am a bit concerned that method could run into performance problems if you have many destinations and I would prefer to keep it simple. So you just get a list of names and it is your responsibility to filter and make the following calls in chunks so that it is not overloading the destination service.

Best Frank

FrankEssenberger avatar Jun 08 '22 06:06 FrankEssenberger

I had a call with the colleague and they have the requirement:

  • They need the destination properties as well to do some filtering so name is not enough
  • They do not need the full destination with the expensive auth token
  • The API should be similar to the getDestination where you just hand the JWT and all token exchange is done for you

FrankEssenberger avatar Jun 08 '22 11:06 FrankEssenberger

I am building a SaaS solution using NodeJS in BTP. This tool needs to connect to various external systems via 'BTP Destinations'. So the user needs to select a destination from a list of destinations. For this use case, I need an API that can list ALL destinations. https://answers.sap.com/questions/13718193/cloud-sdk-get-all-destinations.html

I see that the Java flavor already has this API. Can you please provide it in Javascript flavor as well?

krisho007 avatar Sep 09 '22 04:09 krisho007

Hey, @krisho007 thank you for your feedback,

I'm currently implementing this function, however, there are many possible sources for destinations, some of which won't serve a purpose for the user unless they have a very specific use case, such as provider- or service-binding destinations. Therefore my question is: If you say all destinations, do you refer to all subscriber destinations which are in the destination service, or literally all?

tomfrenken avatar Sep 09 '22 08:09 tomfrenken

For my use case I just need subscriber destinations. But I feel there might be scenarios where we might need provider destinations as well. But do not see a scenario where we need destinations within other subscribers.

Hope that answers your question.

krisho007 avatar Sep 13 '22 10:09 krisho007

Hey @krisho007 and @luckyliwen we've just added the requested function, as documented here.

It will be available to you with the next release, which will come later in the afternoon.

tomfrenken avatar Sep 20 '22 10:09 tomfrenken

I'll close the issue. If you have further requests or issues with the function, feel free to reopen it.

tomfrenken avatar Sep 20 '22 10:09 tomfrenken