Hi Team,
Could you please tell me how to replace a contributing resource from an automation script?
This use cases are for the confirmed state of the bookings.
Use case 1.
Initially there are 2 separated booking with their corresponding contributive resources.
After an update in one of the bookings both bookings can start using the same contributing recourse.
Use case 2.
Initially there are 2 bookings using the same contributing resource.
After an update on one of the bookings they should no longer use the same contributing resource.
Thanks in advance.
Hi Julio,
You should use the AssignResources method for that.
// Summary:
// Assigns resources to the given reservation.
// Parameters:
// reservation:
// The reservation where the resources will be assigned.
// engine:
// Link with SLScripting.
// requests:
// Assign resource requests.
// Returns:
// The updated reservation.
// Exceptions:
// T:System.ArgumentNullException:
// If any argument is null.
// T:Skyline.DataMiner.Library.Exceptions.ServiceDefinitionNotFoundException:
// If the service definition used to create reservation doesn't exist anymore.
// T:Skyline.DataMiner.Library.Exceptions.NodeNotFoundException:
// If the Skyline.DataMiner.Library.Solutions.SRM.Model.AssignProfilesAndResources.AssignResourceRequest.TargetNodeLabel
// doesn't exist in the reservation service definition.
// T:Skyline.DataMiner.Library.Exceptions.FunctionDefinitionNotFoundException:
// If there are no function definition for the target nodes.
// T:Skyline.DataMiner.Library.Exceptions.ResourceNotAvailableException:
// The provided resource is currently not available.
// T:Skyline.DataMiner.Library.Exceptions.ResourceManagerException:
// The provided information is not enough to Confirm the booking and it's running.
public static ServiceReservationInstance AssignResources(this ServiceReservationInstance reservation, Engine engine, params AssignResourceRequest[] requests);
E.g.:
var request = new AssignResourceRequest
{
TargetNodeLabel = "Rx Sat",
NewResourceId = contributing2.ID,
ByReference = false
};
main1 = main1.AssignResources(Engine, request);
If you no longer need an old contributing reservation, you can Cancel it to release the resources used.