I can’t figure out how to programmatically create standard and remote tag providers using the SDK. I’d like to be able to:
- Create a standard tag provider (on our tag server)
- Create a remote tag provider (that points to our tag server)
I was able to successfully create a “Managed Tag Provider” but I don’t think this is what I want…I see it in my drop down of tag providers but it’s not on the webpage because it’s managed (or at least that’s my best guess). And if the only way to solve this is with a “Managed Tag Provider”, I also don’t see a way to make a “Managed Tag Provider” a remote tag provider.
I’ve been following some of these documents:
- Gateway Context
-
Gateway Tag Manger
- I’m using the getOrCreateManagedTagProvider method to create the managed tag provider
- I don’t see any other methods for creating tag providers
But I don’t see any way to create a standard or remote tag provider. Or at least not easily…
I stumbled upon the TagProviderExtensionPointType
But it looks like that is for when I want to create a different type of tag provider? And I’m not trying to do that…And since it is an Abstract class, I have to extend it to use it.
Are creating standard and remote tag providers some of those things that just aren’t possible? And I saw in the SDK examples on GitHub there’s an example to create a Managed Tag Provider but I just can’t find anything to create a Standard or Remote Tag Provider…
For some background, I’m trying to use the WebDev module to allow us to create tag providers via APIs. Here is some of the code that I’ve tried so far. The top portion is how I am creating a managed tag provider and the commented out portion on the bottom are some of my failed attempts at creating a standard tag provider.
Code to create a Managed Tag Provider in WebDev module:
#Creating a managed tag provider
from com.inductiveautomation.ignition.gateway.tags.managed import ProviderConfiguration
context = request['context']
tagManager = context.getTagManager()
print(tagManager)
print(type(tagManager))
config = ProviderConfiguration('ManagedProvider')
managedTagProvider = tagManager.getOrCreateManagedProvider(config)
return {'json': {'Provider': managedTagProvider}}
#To delete a managed tag provider, run the below line
#managedTagProvider.shutdown(True)
Code attempting to create standard and/or remote tag providers
#Code trying to create standard and/or remote tag providers...
#Not functional because the TagProviderExtensionPointType is abstract and needs to be extended...
from com.inductiveautomation.ignition.gateway.tags.api import TagProviderExtensionPointType, TagProviderSettingsRecord
tagProviderExtension = TagProviderExtensionPointType('1')
settings = TagProviderSettingsRecord()
print(settings)
print(type(settings))
settings.DESCRIPTION = 'Here is my description!'
print(settings)
print(type(settings))
tagProvider = TagProviderExtensionPointType.createNewProvider(context, settings)
print(tagProvider)
print(type(tagProvider))
Using Ignition 8.1.0, any help is greatly appreciated! Thank you in advance!