FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important
information on the platform change.
02-20-2023 09:57 AM
Hello,
I failed to get license capabilities via datalayer with ipc (inprocss control).
But I didn't find nodes related in datalayer.
Could anyone tell me what is the correct address or the correct way to access datalayer with ipc?
Or is it only possible to access through license-manager Rest API, which always need user to login?
My pseudo code and execution result is below.
Thanks.
Chih-Peng
Pseudo-code
MyDatalayer::MyDatalayer()
{
m_datalayer.start(false);
// Connect client
m_ipcClient = m_datalayer.factory()->createClient(DL_IPC_AUTO);
if (m_ipcClient == nullptr || !m_ipcClient->isConnected())
{
spdlog::critical("Failed to connect to DataLayer via IPC");
delete m_ipcClient;
m_ipcClient = nullptr;
}
else
{
spdlog::info("DataLayer IPC Client initialized successfully");
}
auto readCapabilites = [this](std::string const& address)
{
Variant data;
auto result = m_ipcClient->readSync(address, &data);
if (result != DL_OK)
{
spdlog::warn("Failed to read-out {}. Reason {}", address,result.toString());
}
};
readCapabilites("license-manager/api/v1/capabilities");
readCapabilites("/license-manager/api/v1/capabilities");
readCapabilites("capabilities");
}
Log output
DataLayer IPC Client initialized successfully
Failed to read-out license-manager/api/v1/capabilities. Reason DL_INVALID_ADDRESS
Failed to read-out /license-manager/api/v1/capabilities. Reason DL_INVALID_ADDRESS
Failed to read-out capabilities. Reason DL_INVALID_ADDRESS
Solved! Go to Solution.
02-20-2023 10:07 AM
In short the path you are using is simply not part of the data layer. It is an own separated API.
Please have a look into the documentation of our SDK to get further information about licensing.
02-22-2023 11:09 AM
Hi,
sorry for late reply.
I can access via License API.
But I would like to know whether it is possible to query, acquire/free licesne using datalayer approach, instead of License API. Becasue I want to use inprocess coumunication "ipc://", so that in my app, I don't need to login to manage licenses.
My guess is that, maybe ctrlX didn't expose License in Datalayer? Because I didn't find any nodes in Datalayer which looks like related to licences.
If ctrlX does allow to aceess License via Datalayer, could you let me know what is the node address?
02-23-2023 07:30 AM - edited 02-23-2023 07:31 AM
Like @CodeShepherd already said: The license API is not part of the Data Layer. There is no path in the Data Layer were you can access the license manager.
There is the REST API to interact with the license management. I think you already managed to do this.
What I think you are now wanting do do from you app is using the unix domain socket to interact with the same REST API of the license manager. Please take a look at the chapters 3.1 - 3.3 of the license mangement manual on how to do that.
Best regards,
Nick
02-24-2023 09:41 AM
Thanks for pointing out. So it is not possible to use datalayer client with unix domain socket to access. I will use other library with unix domain socket.