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
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • 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
    • Tutorials
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • DataMiner Insights
      • Security
      • Integration Studio
      • System Architecture
      • DataMiner Releases & Updates
      • DataMiner Apps
    • 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)
    • DataMiner DevOps Professional Program
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Getting Table Ids and Protocol related data in Automation script

Solved1.14K views16th November 2023DataMiner LowCode protocol
0
Apurva Tandon [DevOps Advocate]1.53K 31st October 2023 0 Comments

Hi,
I want to retrieve the protocol related information and the table ids and names/description linked with the protocol in my automation script wherein I don't know the Ids and Description
for example:


Scenario
:
I get protocol name from the selected device via parameter and then from there I want to get names and table ids as shown above related so that I can show it later in my application it will be helpful.


So from my Low code App as in above pic, once I click on that small gear I have protocol name, so from there I want to get all table ids and protocol related information as shown on top in my automation script in c#. There is no Dummy req. as I will get protocol info from clicking that row in table.

Showing list of resource types description and also for further functionality will be having table ids as well in order to get the further information for resources via GetTableDisplayKeys for the element selected. So, currently these are hardcoded but want them get the information automatically from Protocol.

Apurva Tandon [DevOps Advocate] Selected answer as best 16th November 2023

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
0
Robin Spruytte [SLC] [DevOps Advocate]637 Posted 3rd November 2023 2 Comments

Hello Apurva

With the following call, you can get a full definition of the protocol. This allows you to collect all table information.

var protocolInfo = engine.GetProtocolInfo(protocolName)    Method not available.

var protocolInfo = engine.GetUserConnection().GetProtocol(protocolName)

You can find the table parameters by looking for the correct parameter under the following property by either the table ID...

var tableParamInfoById = protocolInfo.Parameters.FirstOrDefault(param => param.ID == requestedTableId)

...or the name of the table

var tableParamInfoByDescription = protocolInfo.Parameters.FirstOrDefault(param => param.Description == requestedTableName)

Once you have the correct table parameter you can get all related column with

var columnParameters = tableParamInfo.TableColumnDefinitions;

This will allow you to find the parameter ID of each column, which you can then use again to find each param under protocolInfo.Parameters, in case you need additional info for that parameter, such as the description.

NOTE: Retrieving the protocol information is a big request on the system, so it is not advised to repeatedly do this. In case the automation script you mentioned will be executed very frequently, I would advise to implement additional caching to save previous results, instead of requesting it each time, otherwise performance issues might occur.

Caching can be done by using a static class, using a lock to avoid issues.

internal static class ProtocolInfoCache
{
private static readonly IDictionary<string, GetProtocolInfoResponseMessage> Cache = new ConcurrentDictionary<string, GetProtocolInfoResponseMessage>();

private static readonly object CacheLock = new object();

public static GetProtocolInfoResponseMessage GetCacheProtocol(IEngine engine, string name, string version)
{
lock (CacheLock)
{
string cacheKey = GetCacheKey(name, version);
if (Cache.ContainsKey(cacheKey))
{
return Cache[cacheKey];
}

return GetProtocolInfoFromDataMiner(engine, name, version);
}
}

private static string GetCacheKey(string name, string version)
{
return String.Join(".", name, version);
}

private static GetProtocolInfoResponseMessage GetProtocolInfoFromDataMiner(IEngine engine, string name, string version)
{
GetProtocolInfoResponseMessage response = engine.GetUserConnection().GetProtocol(name, version);
Cache.Add(new KeyValuePair<string, GetProtocolInfoResponseMessage>(GetCacheKey(name, version), response));
return response;
}
}

Apurva Tandon [DevOps Advocate] Selected answer as best 16th November 2023
Apurva Tandon [DevOps Advocate] commented 3rd November 2023

Thanks Robin for the answer,
but I cannot see engine.GetProtocolInfo(“”) method, i there any other Nuget package which I need to install.

Apart from this from the device can I get like this:
var ele = engine.FindElement(“OST-X20-DM-001”);
var val = ele.Protocol.AllParameters.Where(x=>x.ArrayType);

Hope this won’t be heavy call.

And yes, for caching is there any link related to that?

Robin Spruytte [SLC] [DevOps Advocate] commented 3rd November 2023

Apologies for the confusion. The GetProtocolInfo method is not available indeed. You can get a protocol via engine.GetUserConnection().GetProtocol(protocolName). But I believe the way you did it should lead you to the same result.

As for the caching. I added an example class to the answer.

You are viewing 1 out of 2 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

Recent questions

When using the Setter = true attribute, will the copy action always be executed first? 0 Answers | 1 Vote
Multiple Set on Table parameters for DVE’s 0 Answers | 1 Vote
DOM Definition relations returned in Definition query 0 Answers | 2 Votes

Question Tags

adl2099 (115) alarm (62) Alarm Console (82) alarms (100) alarm template (83) Automation (223) automation scipt (111) Automation script (167) backup (71) Cassandra (180) Connector (109) Correlation (68) Cube (150) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (56) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (152) low code app (166) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) services (51) SNMP (86) SRM (337) table (54) trending (87) upgrade (62) Visio (539) Visual Overview (345)
Privacy Policy • Terms & Conditions • Contact

© 2025 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