EnterpriseVariable.GetAllEVariablesAsync
Description
Gets the list of all Enterprise Variables from the connected AI Command Center
note
Use this API to retrieve all the Enterprise Variables under the Global scope and any of the Enterprise Variables existing under your User scope.
note
You will not be able to retrieve the value of Enterprise Variables encrypted for security reasons.
Signature [C#]
Task<List<EnterpriseVariable>> GetAllEVariablesAsync(string key);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
key | string | Required | [for future usage] |
Output
| Property | Description |
|---|---|
| Task<List<EnterpriseVariable>> | Returns a list of all accessible enterprise variables from the connected AI Command Center. |
Remarks
Use GetAllEVariablesAsync API to retrieve all accessible enterprise variables information from the connected AI Command Center.
Example
C#
public async Task GetEnterpriseVariables()
{
IControlRoomContext context = LoginControlRoom();
try
{
string key = null;
var availableVars = await context.EnterpriseVariables.GetAllEVariablesAsync(key);
foreach (EnterpriseVariable enterpriseVariable in availableVars)
Console.WriteLine("EnterpriseVariable Name: " + enterpriseVariable.Name);
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}
See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.