update readme; add new nuspec; add changelog
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
@@ -0,0 +1,15 @@
|
||||
### 2.0.0 (2014-02-02)
|
||||
|
||||
- Re-publish UptimeSharp as a newly created PCL with support for multiple platforms
|
||||
|
||||
### 0.2.0 (2013-08-28)
|
||||
|
||||
- Added request validation
|
||||
|
||||
### 0.1.1 (2013-08-26)
|
||||
|
||||
- Adding a Port monitor works now
|
||||
|
||||
### 0.1.0 (2013-08-25)
|
||||
|
||||
- Initial release
|
||||
@@ -1,22 +1,18 @@
|
||||

|
||||

|
||||
|
||||
**UptimeSharp** is a C#.NET class library that integrates the [UptimeRobot API](http://www.uptimerobot.com/api.asp).
|
||||
**UptimeSharp** is a .NET portable class library that integrates the [UptimeRobot API](http://www.uptimerobot.com/api.asp).
|
||||
|
||||
The wrapper consists of 2 parts:
|
||||
|
||||
- Get and modify monitors
|
||||
- Get and modify alert contacts
|
||||
|
||||
[uptimesharp.frontendplay.com](http://uptimesharp.frontendplay.com/)
|
||||
|
||||
## Install using NuGet
|
||||
## Install UptimeSharp using [NuGet](https://www.nuget.org/packages/UptimeSharp/)
|
||||
|
||||
```
|
||||
Install-Package UptimeSharp
|
||||
```
|
||||
|
||||
[nuget.org/packages/UptimeSharp](https://www.nuget.org/packages/UptimeSharp/)
|
||||
|
||||
## Usage Example
|
||||
|
||||
Get your [API Key UptimeRobot](http://uptimerobot.com/mySettings.asp) (left section under "API Information")
|
||||
@@ -37,8 +33,10 @@ UptimeClient _client = new UptimeClient("[YOUR_API_KEY]");
|
||||
Do a simple request - e.g. get all your monitors:
|
||||
|
||||
```csharp
|
||||
_client.GetMonitors().ForEach(
|
||||
item => Console.WriteLine(item.Name + " | " + item.Type)
|
||||
List<Monitor> monitors = await _client.GetMonitors()
|
||||
|
||||
monitors.ForEach(
|
||||
item => Debug.WriteLine(item.Name + " | " + item.Type)
|
||||
);
|
||||
```
|
||||
|
||||
@@ -64,22 +62,22 @@ Get your [API Key UptimeRobot](http://uptimerobot.com/mySettings.asp) (left sect
|
||||
Get list of all monitors:
|
||||
|
||||
```csharp
|
||||
List<Monitor> items = _client.GetMonitors();
|
||||
List<Monitor> items = await _client.GetMonitors();
|
||||
```
|
||||
|
||||
Get monitors by ID - or a single monitor:
|
||||
|
||||
```csharp
|
||||
List<Monitor> items = _client.GetMonitors(new int[]{ 12891, 98711 });
|
||||
List<Monitor> items = await _client.GetMonitors(new string[]{ 12891, 98711 });
|
||||
// or
|
||||
Monitor item = _client.GetMonitor(12891);
|
||||
Monitor item = await _client.GetMonitor("12891");
|
||||
```
|
||||
|
||||
Provide additional params for more data:
|
||||
|
||||
```csharp
|
||||
List<Monitor> items = _client.GetMonitors(
|
||||
monitorIDs: new int[]{ 12891, 98711 },
|
||||
List<Monitor> items = await _client.GetMonitors(
|
||||
monitorIDs: new string[]{ 12891, 98711 },
|
||||
customUptimeRatio: new float[] { 7, 30, 45 },
|
||||
showLog: true,
|
||||
showAlerts: true
|
||||
@@ -101,15 +99,15 @@ List<Monitor> items = _client.GetMonitors(
|
||||
Adds/creates a new monitor.
|
||||
|
||||
```csharp
|
||||
bool AddMonitor(
|
||||
Task<Monitor> AddMonitor(
|
||||
string name,
|
||||
string uri,
|
||||
string target,
|
||||
Type type = Type.HTTP,
|
||||
Subtype subtype = Subtype.Unknown,
|
||||
int? port = null,
|
||||
string keywordValue = null,
|
||||
KeywordType keywordType = KeywordType.Unknown,
|
||||
int[] alerts = null,
|
||||
string[] alerts = null,
|
||||
string HTTPUsername = null,
|
||||
string HTTPPassword = null
|
||||
)
|
||||
@@ -118,9 +116,9 @@ bool AddMonitor(
|
||||
Example - Watch a SMTP Server:
|
||||
|
||||
```csharp
|
||||
bool isSuccess = _client.AddMonitor(
|
||||
Monitor monitor = await _client.AddMonitor(
|
||||
name: "cee",
|
||||
uri: "127.0.0.1",
|
||||
target: "127.0.0.1",
|
||||
type: Type.Port,
|
||||
subtype: Subtype.SMTP
|
||||
);
|
||||
@@ -128,7 +126,7 @@ bool isSuccess = _client.AddMonitor(
|
||||
|
||||
`name`: A friendly name for the new monitor
|
||||
<br>
|
||||
`uri`: The URI or IP to watch
|
||||
`target`: The URI or IP to watch
|
||||
<br>
|
||||
`type`: The type of the monitor (see [# Monitor Types](#monitor-types))
|
||||
<br>
|
||||
@@ -156,14 +154,14 @@ If you've selected `Type.Port` for example, UptimeSharp will ignore the `keyword
|
||||
Delete a monitor by ID:
|
||||
|
||||
```csharp
|
||||
bool isSuccess = _client.DeleteMonitor(12891);
|
||||
bool isSuccess = await _client.DeleteMonitor("12891");
|
||||
```
|
||||
|
||||
Delete a monitor by a Monitor instance:
|
||||
|
||||
```csharp
|
||||
// Monitor myMonitor = ...
|
||||
bool isSuccess = _client.DeleteMonitor(myMonitor);
|
||||
bool isSuccess = await _client.DeleteMonitor(myMonitor);
|
||||
```
|
||||
|
||||
|
||||
@@ -174,7 +172,7 @@ In order to modify an existing monitor, just alter the properties of the Monitor
|
||||
```csharp
|
||||
// Monitor myMonitor = ...
|
||||
myMonitor.Name = "my new name :-)";
|
||||
bool isSuccess = _client.ModifyMonitor(myMonitor);
|
||||
bool isSuccess = await _client.ModifyMonitor(myMonitor);
|
||||
```
|
||||
|
||||
**Important:** It is not possible to alter the `Type` of a monitor after its creation! In case you want to do this, you have to delete the monitor and create a new one with the changed type.
|
||||
@@ -184,45 +182,45 @@ bool isSuccess = _client.ModifyMonitor(myMonitor);
|
||||
Retrieve all alerts:
|
||||
|
||||
```csharp
|
||||
List<Alert> items = _client.GetAlerts();
|
||||
List<Alert> items = await _client.GetAlerts();
|
||||
```
|
||||
|
||||
Retrieve alerts by IDs:
|
||||
|
||||
```csharp
|
||||
List<Alert> items = _client.GetAlerts(new string[]{ "12897", "98711" });
|
||||
List<Alert> items = await _client.GetAlerts(new string[]{ "12897", "98711" });
|
||||
```
|
||||
|
||||
Retrieve a specific alert:
|
||||
|
||||
```csharp
|
||||
Alert item = _client.GetAlert("12897");
|
||||
Alert item = await _client.GetAlert("12897");
|
||||
```
|
||||
|
||||
Adds an alert _(Due to UptimeRobot API limitations SMS and Twitter alert contact types are not supported yet)_:
|
||||
|
||||
```csharp
|
||||
bool isSuccess = _client.AddAlert(AlertType.Email, "uptimesharp@outlook.com");
|
||||
Alert alert = await _client.AddAlert(AlertType.Email, "uptimesharp@outlook.com");
|
||||
```
|
||||
|
||||
Adds an alert from instance:
|
||||
|
||||
```csharp
|
||||
// Alert myAlert = ...
|
||||
bool isSuccess = _client.AddAlert(myAlert);
|
||||
Alert alert = await _client.AddAlert(myAlert);
|
||||
```
|
||||
|
||||
Deletes an alert:
|
||||
|
||||
```csharp
|
||||
bool isSuccess = _client.DeleteAlert("12897");
|
||||
bool isSuccess = await _client.DeleteAlert("12897");
|
||||
```
|
||||
|
||||
Deletes an alert from instance:
|
||||
|
||||
```csharp
|
||||
// Alert myAlert = ...
|
||||
bool isSuccess = _client.DeleteAlert(myAlert);
|
||||
bool isSuccess = await _client.DeleteAlert(myAlert);
|
||||
```
|
||||
|
||||
## Monitor Types
|
||||
@@ -260,22 +258,28 @@ If you want to monitor a port, you need to specify a **subType** which is a comm
|
||||
|
||||
---
|
||||
|
||||
## Release History
|
||||
|
||||
- 2013-08-28 v0.2.0 Request Validation
|
||||
- 2013-08-26 v0.1.1 Adding a Port monitor works now
|
||||
- 2013-08-25 v0.1.0 Monitor and Alert APIs
|
||||
## Supported platforms
|
||||
|
||||
UptimeSharp is a **Portable Class Library**, therefore it's compatible with multiple platforms:
|
||||
|
||||
- **.NET** >= 4.5 (including WPF)
|
||||
- **Silverlight** >= 4
|
||||
- **Windows Phone** >= 7.5
|
||||
- **Windows Store**
|
||||
|
||||
## Dependencies
|
||||
|
||||
- [RestSharp](http://restsharp.org/)
|
||||
- [ServiceStack.Text](https://github.com/ServiceStack/ServiceStack.Text)
|
||||
- [Microsoft.Bcl.Async](https://www.nuget.org/packages/Microsoft.Bcl.Async/)
|
||||
- [Microsoft.Net.Http](https://www.nuget.org/packages/Microsoft.Net.Http/)
|
||||
- [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/)
|
||||
- [PropertyChanged.Fody](https://github.com/Fody/PropertyChanged)
|
||||
|
||||
## Contributors
|
||||
| [](http://twitter.com/artistandsocial "Follow @artistandsocial on Twitter") |
|
||||
|---|
|
||||
| [Tobias Klika @ceee](https://github.com/ceee) |
|
||||
|
||||
| [](https://github.com/ceee "Tobias Klika") |
|
||||
|---|
|
||||
| [ceee](https://github.com/ceee) |
|
||||
## License
|
||||
|
||||
[MIT License](https://github.com/ceee/UptimeSharp/blob/master/LICENSE-MIT)
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<package >
|
||||
<metadata>
|
||||
<id>UptimeSharp</id>
|
||||
<version>0.2.0</version>
|
||||
<title>UptimeSharp</title>
|
||||
<authors>Tobias Klika</authors>
|
||||
<owners>Tobias Klika</owners>
|
||||
<licenseUrl>https://raw.github.com/ceee/UptimeSharp/master/LICENSE-MIT</licenseUrl>
|
||||
<projectUrl>http://uptimesharp.frontendplay.com</projectUrl>
|
||||
<iconUrl>http://uptimesharp.frontendplay.com/Assets/Images/uptimesharp.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Assembly for accessing the UptimeRobot API</description>
|
||||
<language>en-US</language>
|
||||
<releaseNotes>
|
||||
<![CDATA[
|
||||
For full release notes see https://github.com/ceee/UptimeSharp#release-history
|
||||
]]>
|
||||
</releaseNotes>
|
||||
<copyright>Copyright by cee, 2013</copyright>
|
||||
<tags>UptimeSharp UptimeRobot Uptime Robot API Tobias Klika cee RestSharp</tags>
|
||||
<dependencies>
|
||||
<dependency id="ServiceStack.Text" version="3.9.56" />
|
||||
<dependency id="RestSharp" version="104.1" />
|
||||
</dependencies>
|
||||
<frameworkAssemblies>
|
||||
<frameworkAssembly assemblyName="System" targetFramework="net40" />
|
||||
<frameworkAssembly assemblyName="System.Core" targetFramework="net40" />
|
||||
<frameworkAssembly assemblyName="System.Data" targetFramework="net40" />
|
||||
<frameworkAssembly assemblyName="System.Data.DataSetExtensions" targetFramework="net40" />
|
||||
<frameworkAssembly assemblyName="System.Runtime.Serialization" targetFramework="net40" />
|
||||
<frameworkAssembly assemblyName="System.Xml" targetFramework="net40" />
|
||||
<frameworkAssembly assemblyName="System.Xml.Linq" targetFramework="net40" />
|
||||
<frameworkAssembly assemblyName="Microsoft.CSharp" targetFramework="net40" />
|
||||
</frameworkAssemblies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="UptimeSharp\bin\Release\UptimeSharp.dll" target="lib/net40" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
<package>
|
||||
<metadata>
|
||||
<id>$id$</id>
|
||||
<version>$version$</version>
|
||||
<title>$title$</title>
|
||||
<authors>$author$</authors>
|
||||
<owners>$author$</owners>
|
||||
<licenseUrl>https://raw.github.com/ceee/UptimeSharp/master/LICENSE-MIT</licenseUrl>
|
||||
<projectUrl>https://github.com/ceee/UptimeSharp</projectUrl>
|
||||
<iconUrl>https://raw.github.com/ceee/UptimeSharp/master/Assets/uptimesharp.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>UptimeSharp is a .NET portable class library that integrates the UptimeRobot API.</description>
|
||||
<language>en-US</language>
|
||||
<releaseNotes>
|
||||
<![CDATA[
|
||||
For full release notes see https://github.com/ceee/UptimeSharp/blob/master/CHANGELOG.md
|
||||
]]>
|
||||
</releaseNotes>
|
||||
<copyright>Copyright by cee, 2014</copyright>
|
||||
<tags>UptimeSharp UptimeRobot Uptime Robot Tobias Klika cee SDK Server</tags>
|
||||
</metadata>
|
||||
</package>
|
||||
Reference in New Issue
Block a user