Connections.GetAllConnectionsAsync
Description
Gets the list of all connections from the connected AI Command Center
Signature [C#]
Task<List<Connection>> GetAllConnectionsAsync();
Properties
Input
None.
Output
| Property | Description |
|---|---|
| Task<List<Connection>> | Returns the list of all available connections. |
Remarks
Use GetAllConnectionsAsync API to list all available connections from the connected AI Command Center.
Example
C#
public async Task GetAllConnections()
{
IControlRoomContext context = LoginControlRoom();
try
{
var connections = await context.Connections.GetAllConnectionsAsync();
foreach (Connection connection in connections)
Console.WriteLine("Connection Name: " + connection.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.