Connections.DeleteConnectionAsync
Description
The API Deletes a Connection with the specified ID inside the Control Room.
Signature [C#]
Task<DeletedConnectionStatus> DeleteConnectionAsync(int connectionId);
Properties
Input
Property | Description |
---|---|
connectionId | Id of the connection to be deleted. |
Output
Property | Description |
---|---|
Task<DeletedConnectionStatus> | Returns deleted connection status. |
Remarks
Use DeleteConnectionAsync API to Delete a Connection inside the connected Control Room.
Example
C#
public void DeleteConnection()
{
IControlRoomContext context = LoginControlRoom();
string connectionName = "demo_connection";
var connection = Task.Run(() => context.Connections.GetConnectionByNameAsync(connectionName)).Result;
var connectionStatus = Task.Run(() => context.Connections.DeleteConnectionAsync(connection.ID)).Result;
System.Console.WriteLine("Stauts: " + connectionStatus.Status);
}
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;
}