As per the attachment, under the apps tab —> Resources, i want to delete certain resources that are associated with the Sources pool using automation script. Is that possible to do? How can that be done?
Hari priya Venkatesan [DevOps Advocate] Selected answer as best 14th August 2024
Hi,
You can do this by first getting the resources in that pool and then deleting them. Do note that if those resources are in use by bookings, traceData will be thrown.
var helper = new ResourceManagerHelper(_engine.SendSLNetSingleResponseMessage);
var resources = helper.GetResources(ResourceExposers.PoolGUIDs.Contains(Guid.Parse(“Insert PoolGUID here”)));
helper.RemoveResources(resources);
You will also have to add a using statement for Skyline.DataMiner.Net.Messages and Skyline.DataMiner.Net.Messages.SLDataGateway.
Hari priya Venkatesan [DevOps Advocate] Selected answer as best 14th August 2024