Hi,
How can I assign an alias to the resources added to the service created by an SRM booking? I'm creating these bookings via an automation script.
My question is similar to the one here: https://community.dataminer.services/question/how-to-assign-an-alias-to-the-resources-in-services-created-by-srm/?hilite=Alias except that in my case, I already have the 'use node label as element alias' option set on the general page in the booking manager, and I also use this in code:
bookingManager.UseNodeLabelAsElementAlias = true;
engine.Sleep(1000);
The service at pre-roll ends up with devices but without aliases set. If you have any hints with what I can do to troubleshoot this further it would be really great!
images:
This issue was solved by fixing some old bookings (see https://community.dataminer.services/question/deleting-booking-went-wrong/)
Thank you again Support Team (Jorge Dias).
Hi Razvan,
Normally you only need to set that parameter to Enabled, like mentioned in the other topic.
Can you check if your service.xml file (under C:\Skyline DataMiner\Services\your service name) has the 'alias' attribute set? E.g.: <Element idx="0" dmaid="198" eid="30063" alias="Satellite".
Can you also check you booking log file to see if there's any exception there?
Finally, would it be possible to post the rest of the Function object initialization?
It should be some issue that needs to be investigate further, can you please contact our support team?
Thanks!
Hi Razvan,
Would it be possible to show me the node info inside the service definition ( only label and profile with the toggle button is necessary)?
Do you have the toggle button set to "by value" or "by reference"?
In the service definition, the option ‘By Reference’ is displayed. When I create the functions that I pass later to the Booking object, I use function.ByReference = false;
Would it be possible to change that to “By Value” and make sure the label is set to the correct value.
in code I can see that the ‘By Reference’ option is related to how the parameters are set (see pic added in initial description), so I’m not sure this has anything to do with Aliases.
Also if I change the option in the service definition, all my old bookings will go into quarantine, so probably I don’t want that.
1. All elements have alias=””
2. Both booking logs and debug html-format files are clean (no errors/exceptions)
3. I use this to create the Function object:
internal static Function GetFunction(
ServiceDefinition serviceDefinition,
string nodeLabel,
bool shouldAutoSelectResource = false,
bool skipResourceValidation = true)
{
var node = serviceDefinition.Diagram.Nodes.Find(x => x.Label == nodeLabel);
if (node != null)
{
return new Function
{
Id = node.ID,
ByReference = false,
ShouldAutoSelectResource = shouldAutoSelectResource,
SkipResourceValidation = skipResourceValidation,
};
}
return null;
}
Then, where needed, I do a lookup and I attach a resource with:
function.SelectedResource = foundResource.ID.ToString();
Most of the functions get created with shouldAutoSelectResource = false, skipResourceValidation = true, and with a resource attached, but few are auto-selected too, as well as functions without resource attached.