List ids of all the infrastructure stacks and instnace ids within those stacks using api calls

Hello Team,
How to list the infrastructure stacks in Rancher 1.6.18?
How can we get the stacks ids dynamically using api calls?
How to get the instance ids for those stack ids using api calls?
I would like to have the above using api calls. i am not able to frame the api call. Could you please help on the same?
Thank you

Regards,
Yash

Hello @vincent @superseb , could you please help me on this?

Regards,
Yash

This should probably get you started: https://gist.github.com/superseb/dacac8bc5bb29110ccd92ab5c107f799

This is a curl/jq solution but the calls should be easy to extract. Let me know if you run into anything.

1 Like

Thanks alot @superseb i will try the above and surely let you know.
The problem which we are facing is we are not able to stops the infrastructure stacks especially IPSec.
the cni-driver says its already in use. and it has about 180 containers.
Whenever we try to stop the cni-driver, it pops up the set of ids which are in use.
We need to call the api of

> containers to stop the same in a loop

How can i achieve the above dynamically.
The idea here is, the infrastructure stacks id and theiur instance id should get retrieved from the api call and saved into a variable and using which we can loop in the list to stop those cni driver containers and deactivate ipsec stack.
Thank you

Regards,
Yash

Thank you @superseb I am able to achieve the above.

Regards,
Yash