Read the workspace from <ProgramData>\National Instruments\salt\conf\grain for file-based httpconfiguration
Add os.getenv("PROGRAMDATA") as a fallback option to get <ProgramData> path logic.
Why should this Pull Request be merged?
Automated Agent role does not support write access to several services. Applications that run on the remote system that need write access to these unsupported services must use user's API key. Default workspace of user's API key may not be the same as that of an Automated Agent.
workspace field of httpconfiguration helps the user application to use the remote system's default workspace even when using user's API key.
What testing has been done?
Manually tested on local machine with SystemLink client,
from nisystemlink.clients.core import HttpConfigurationManager
print(HttpConfigurationManager.get_configuration().workspace)
Test Result:
If the SystemLink Client is connected, workspace_id is successfully obtained
If the SystemLink Client is not connected, ApiException: No SystemLink configurations available
What does this Pull Request accomplish?
Add
workspace
field tohttpconfiguration
Read the
workspace
from<ProgramData>\National Instruments\salt\conf\grain
for file-basedhttpconfiguration
Add
os.getenv("PROGRAMDATA")
as a fallback option to get<ProgramData>
path logic.Why should this Pull Request be merged?
Automated Agent
role does not supportwrite
access to several services. Applications that run on the remote system that needwrite
access to these unsupported services must use user's API key. Default workspace of user's API key may not be the same as that of anAutomated Agent
.workspace
field ofhttpconfiguration
helps the user application to use the remote system's default workspace even when using user's API key.What testing has been done?
Manually tested on local machine with SystemLink client,
Test Result:
ApiException: No SystemLink configurations available