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 you 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

Automate installation of Function.xml file

Solved93 views2 days agoSRM
3
Bing Herng Chong [SLC] [DevOps Advocate]1.51K 3 days ago 0 Comments

Hi, I would like to automate the installation of function file and setting it the Production. Using InstallPackage does not seem to be supported. In addition, the method using srmInstaller() can sometimes be problematic.

Is there a wrapper call that can be used to upload a function.xml file and then set that new version to Production?

Bing Herng Chong [SLC] [DevOps Advocate] Selected answer as best 2 days ago

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
0
Seppe Vanhee [SLC] [DevOps Advocate]441 Posted 2 days ago 0 Comments

Hey Bing,

Assuming you have the functions.xml file in your package, you can use SLNet messages to import it and set it active.

To upload a functions.xml file, use the 'AddFunctionsXmlRequestMessage'

var xmlContents = File.ReadAllText("..."); // The xml contents of the function file
var protocolName = "...";
var fileName = "..."; // The file name for the functions file.
var addReq = new AddFunctionsXmlRequestMessage()
{
File = xmlContents,
ProtocolName = protocolName,
FileName = fileName
};

var response = _engine.SendSLNetSingleResponseMessage(addReq) as AddFunctionsXmlResponseMessage;

if (response == null || !response.Success || !response.TraceData.HasSucceeded())
{
// Something went wrong, response.TraceData might contain more information
// and can be 'ToStringed'
}

Setting a functions.xml active can be done with the 'SetCurrentFunctionsXmlRequestMessage'
var setReq = new SetCurrentFunctionsXmlRequestMessage()
{
File = fileName,
ProtocolName = protocolName,
};

var setResp = _engine.SendSLNetSingleResponseMessage(setReq) as SetCurrentFunctionsXmlResponseMessage;
if (setResp == null || !setResp.Success || !setResp.TraceData.HasSucceeded())
{
// Something went wrong
}

Activating a functions.xml can fail in case there is already a different file active and in use (by service definitions, resources…) and the update is not considered 'safe'. The following changes are considered unsafe:

  • Removing a function definition
  • Lowering the max instances of a function definition
  • Change name of a function definition to a name that is not unique within the protocol function version
  • Change the profile of function definition
  • Change parent of a function definition
  • Changes to the entrypoints of a function definition
  • Remove an interface of a function definition
  • Remove a parameter of a function definition

If there are any unsafe changes between the function versions the call will fail unless you force it, which will skip these checks. Forcing can be done with a property on the 'SetCurrentFunctionsXmlRequestMessage',but is of course not recommended to do by default.

Note that using SLNet messages directly is not recommended. I do think the relevant method in the SRMInstaller should cover your use case as well, so if you encounter an issue with that, it's best to get in touch with the A&O domain.

Bing Herng Chong [SLC] [DevOps Advocate] Selected answer as best 2 days ago
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