Skip to content

Commit 374907a

Browse files
committed
Add monitor examples for C# next-gen
1 parent 3e7171a commit 374907a

File tree

9 files changed

+212
-0
lines changed

9 files changed

+212
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
2+
using System;
3+
using Twilio;
4+
using Twilio.Rest.Monitor.V1;
5+
6+
public class Example
7+
{
8+
public static void Main(string[] args)
9+
{
10+
// Find your Account SID and Auth Token at twilio.com/console
11+
const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
12+
const string authToken = "your_auth_token";
13+
const string alertSid = "NO5a7a84730f529f0a76b3e30c01315d1a";
14+
15+
TwilioClient.Init(accountSid, authToken);
16+
17+
var status = AlertResource.Delete(alertSid);
18+
19+
Console.WriteLine(status);
20+
}
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
2+
using System;
3+
using Twilio;
4+
using Twilio.Rest.Monitor.V1;
5+
6+
public class Example
7+
{
8+
public static void Main(string[] args)
9+
{
10+
// Find your Account SID and Auth Token at twilio.com/console
11+
const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
12+
const string authToken = "your_auth_token";
13+
const string alertSid = "NO5a7a84730f529f0a76b3e30c01315d1a";
14+
15+
TwilioClient.Init(accountSid, authToken);
16+
17+
var alert = AlertResource.Fetch(alertSid);
18+
19+
Console.WriteLine(alert.AlertText);
20+
}
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
2+
using System;
3+
using Twilio;
4+
using Twilio.Rest.Monitor.V1;
5+
6+
public class Example
7+
{
8+
public static void Main(string[] args)
9+
{
10+
// Find your Account SID and Auth Token at twilio.com/console
11+
const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
12+
const string authToken = "your_auth_token";
13+
14+
TwilioClient.Init(accountSid, authToken);
15+
16+
var alerts = AlertResource.Read();
17+
18+
foreach (var alert in alerts)
19+
{
20+
Console.WriteLine(alert.AlertText);
21+
}
22+
}
23+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
2+
using System;
3+
using Twilio;
4+
using Twilio.Rest.Monitor.V1;
5+
6+
public class Example
7+
{
8+
public static void Main(string[] args)
9+
{
10+
// Find your Account SID and Auth Token at twilio.com/console
11+
const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
12+
const string authToken = "your_auth_token";
13+
14+
TwilioClient.Init(accountSid, authToken);
15+
16+
var alerts = AlertResource.Read(
17+
"warning",
18+
new DateTime(2015, 4, 1),
19+
new DateTime(2015, 4, 30));
20+
21+
foreach (var alert in alerts)
22+
{
23+
Console.WriteLine(alert.AlertText);
24+
}
25+
}
26+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
2+
using System;
3+
using Twilio;
4+
using Twilio.Rest.Monitor.V1;
5+
6+
public class Example
7+
{
8+
public static void Main(string[] args)
9+
{
10+
// Find your Account SID and Auth Token at twilio.com/console
11+
const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
12+
const string authToken = "your_auth_token";
13+
const string eventSid = "AE21f24380625e4aa4abec76e39b14458d";
14+
15+
TwilioClient.Init(accountSid, authToken);
16+
17+
var e = EventResource.Fetch(eventSid);
18+
19+
Console.WriteLine(e.Description);
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
2+
using System;
3+
using Twilio;
4+
using Twilio.Rest.Monitor.V1;
5+
6+
public class Example
7+
{
8+
public static void Main(string[] args)
9+
{
10+
// Find your Account SID and Auth Token at twilio.com/console
11+
const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
12+
const string authToken = "your_auth_token";
13+
const string actorSid = "USd0afd67cddff4ec7cb0022771a203cb1";
14+
const string resourceSid = "PN4aa51b930717ea83c91971b86d99018f";
15+
16+
TwilioClient.Init(accountSid, authToken);
17+
18+
var events = EventResource.Read(actorSid, resourceSid: resourceSid);
19+
20+
foreach (var e in events)
21+
{
22+
Console.WriteLine(e.Description);
23+
}
24+
}
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
2+
using System;
3+
using Twilio;
4+
using Twilio.Rest.Monitor.V1;
5+
6+
public class Example
7+
{
8+
public static void Main(string[] args)
9+
{
10+
// Find your Account SID and Auth Token at twilio.com/console
11+
const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
12+
const string authToken = "your_auth_token";
13+
14+
TwilioClient.Init(accountSid, authToken);
15+
16+
var events = EventResource.Read(
17+
startDate: new DateTime(2015, 3, 1),
18+
endDate: new DateTime(2015, 4, 1));
19+
20+
foreach (var e in events)
21+
{
22+
Console.WriteLine(e.Description);
23+
}
24+
}
25+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
2+
using System;
3+
using Twilio;
4+
using Twilio.Rest.Monitor.V1;
5+
6+
public class Example
7+
{
8+
public static void Main(string[] args)
9+
{
10+
// Find your Account SID and Auth Token at twilio.com/console
11+
const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
12+
const string authToken = "your_auth_token";
13+
const string resourceSid = "PN4aa51b930717ea83c91971b86d99018f";
14+
15+
TwilioClient.Init(accountSid, authToken);
16+
17+
var events = EventResource.Read(resourceSid: resourceSid);
18+
19+
foreach (var e in events)
20+
{
21+
Console.WriteLine(e.Description);
22+
}
23+
}
24+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
2+
using System;
3+
using Twilio;
4+
using Twilio.Rest.Monitor.V1;
5+
6+
public class Example
7+
{
8+
public static void Main(string[] args)
9+
{
10+
// Find your Account SID and Auth Token at twilio.com/console
11+
const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
12+
const string authToken = "your_auth_token";
13+
14+
TwilioClient.Init(accountSid, authToken);
15+
16+
var events = EventResource.Read(
17+
sourceIpAddress: "104.14.155.29",
18+
startDate: new DateTime(2015, 4, 25),
19+
endDate: new DateTime(2015, 4, 25, 23, 59, 59));
20+
21+
foreach (var e in events)
22+
{
23+
Console.WriteLine(e.Description);
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)