Skip to content
DataMiner Dojo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Learn more about Agile
        • Agile Webspace
        • Everything Agile
          • The Agile Manifesto
          • Best Practices
          • Retro Recipes
        • Methodologies
          • The Scrum Framework
          • Kanban
          • Extreme Programming
        • Roles
          • The Product Owner
          • The Agile Coach
          • The Quality & UX Coach (QX)
      • Book your Agile Fundamentals training
      • Book your Kanban workshop
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Program
    • DataMiner DevOps Support
    • Feature Suggestions
  • Downloads
  • Swag Shop
  • PARTNERS
    • Business Partners
    • Technology Partners
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

update service by automation with core library

130 views8 hours ago
3
Juan Falcon370 2 days ago 1 Comment

Hello Dojo

Im creating service with automation core library and works well, im want to add a logic to update the service if existe but i cant find the funciton to remove elements and add the news

if (dms.ServiceExists(grupoCunico.Key))
{
var serviceExist = dms.GetService(grupoCunico.Key);

}

This is my code working in 10.5.0.0-16294-CU6

ServiceConfiguration serviceConfig = new ServiceConfiguration(dms, grupoCunico.Key);
serviceConfig.Views.Add(dms.GetView(63));
serviceConfig.AdvancedSettings.Protocol = dmsProtocol;
serviceConfig.AdvancedSettings.AlarmTemplate = alarmTemplate;

var gruposTroncales = grupoCunico
.GroupBy(x => new
{
// x.Troncal,
x.HostName,
});
int i = 0;
foreach (var grupo in gruposTroncales)
{
i++;
if (dms.ElementExists(grupo.Key.HostName) )
{
engine.GenerateInformation("=======================================");
//engine.GenerateInformation($"Troncal: {grupo.Key.Troncal}");
engine.GenerateInformation($"Host: {grupo.Key.HostName}");
engine.GenerateInformation("---- Registros del grupo ----");

var filters1 = new List<ElementParamFilterConfiguration>();
var filters2 = new List<ElementParamFilterConfiguration>();
foreach (var item in grupo)
{
engine.GenerateInformation(
$"{item.Itm} | {item.IE_Name} | {item.MAC_IE_Local} | {item.MAC_CajaRemota}"
);
filters1.Add(new ElementParamFilterConfiguration(5003, "*", true));
filters1.Add(new ElementParamFilterConfiguration(5004, "*", true));
filters1.Add(new ElementParamFilterConfiguration(5005, "*", true));
filters1.Add(new ElementParamFilterConfiguration(1407, "*" + item.IE_Name + " * ", true));
filters1.Add(new ElementParamFilterConfiguration(1419, "*" + item.IE_Name + " * ", true));
filters1.Add(new ElementParamFilterConfiguration(1420, "*" + item.IE_Name + " * ", true));
filters1.Add(new ElementParamFilterConfiguration(1407, "*" + item.IE_Name + " * ", true));
filters1.Add(new ElementParamFilterConfiguration(1405, "*" + item.IE_Name + " * ", true));
filters1.Add(new ElementParamFilterConfiguration(1408, "*" + item.IE_Name + " * ", true));
filters1.Add(new ElementParamFilterConfiguration(1427, "*" + item.IE_Name + " * ", true));
filters1.Add(new ElementParamFilterConfiguration(1412, "*" + item.IE_Name + " * ", true));
filters1.Add(new ElementParamFilterConfiguration(1413, "*" + item.IE_Name + " * ", true));
filters1.Add(new ElementParamFilterConfiguration(1417, "*" + item.IE_Name + " * ", true));
filters1.Add(new ElementParamFilterConfiguration(1418, "*" + item.IE_Name + " * ", true));
filters1.Add(new ElementParamFilterConfiguration(1431, "*" + item.IE_Name + " * ", true));

}
var element1 = dms.GetElement(grupo.Key.HostName);

serviceConfig.AddElement(element1.DmsElementId, filters1);
var includedElements = serviceConfig.IncludedElements;
int j = 1;
foreach (var includedElement in includedElements)
{
//includedElement.Alias = "device" + j;
includedElement.IncludedCapped = Skyline.DataMiner.Core.DataMinerSystem.Common.AlarmLevel.Normal;
j++;
}

}
}
agent.CreateService(serviceConfig);

Thanks

Thomas Cauwelier [SLC] [DevOps Advocate] Answered question 8 hours ago
Juan Falcon commented 1 day ago

correct, creating again the service gets error for existing.

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
0
Thomas Cauwelier [SLC] [DevOps Advocate]1.85K Posted 8 hours ago 1 Comment

Hi Juan,

While the IDmsService interface does provide an Update() method that allows you to persist changes after modifying the service object, it is currently not possible to change the ElementParamFilters through the IDmsService object.

So even though you can retrieve the service and update certain properties, you won’t be able to remove, or add ElementParamFilters on existing service elements using that API.

If you would like this functionality to be added, you can submit a request on the feature suggestions page: https://community.dataminer.services/feature-suggestions/

Juan Falcon Posted new comment 3 hours ago
Juan Falcon commented 3 hours ago

hi thomas, could i use an other way to update the service on the automation?

You are viewing 1 out of 1 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2026 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin