Connections.GetAllConnectionsByTypesAsync
Description
Gets the specified connection from the connected Control Room
Signature [C#]
Task<List<Connection>> GetAllConnectionsByTypesAsync(List</string/> connectionTypes)
Properties
Input
Property | Description |
---|---|
connectionTypes | Specify the list of the connection types to query. |
Output
Property | Description |
---|---|
Task<List<Connection>> | Returns the queried connections. |
Remarks
Use GetAllConnectionsByTypesAsync API to get the connections based on the connection type from the connected Control Room.
Example
C#
public void GetConnectionByName()
{
IControlRoomContext context = LoginControlRoom();
string connectionName = "demo_connection";
var Lis<connection> connections = Task.Run(() => context.Connections.GetAllConnectionsByTypesAsync(new List<string>(){"Email Server"})).Result;
Console.WriteLine("Email server connections count: " + connections.Count);
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;
connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);
context.Open();
return context;
}