BerkanYildiz / Cachet.NET

.NET library to communicate with the CachetHQ API to create, manage, and handle outages.
MIT License
6 stars 7 forks source link

Metrics Points support? #3

Open ghost opened 5 years ago

ghost commented 5 years ago

I didn't find an API for adding or removing point(s) form a metric. Any thought of adding one?

ghost commented 5 years ago

I've done some code. It works for me.

public class PointCollection : GeneralCollectionResponse<PointData>{ }
public class AddPointResonse : GeneralSimpleResponse<PointData>{ }
public class PointData : ICachetItem
{
    public int value { get; set; }
    public int counter { get; set; }
    public int metric_id { get; set; }
    public DateTime created_at { get; set; }
    public DateTime updated_at { get; set; }
    public long CalculatedValue { get; set; }
    public int Id { get; set; }
}
BerkanYildiz commented 5 years ago

Commit 85a88300d891c3b325a77c49cb19ac0ff3856db9 adds the capability to Get metric points, and other things. Commit 5b5a1168c8214b1af4827d4905096b4a5de5a1c8 adds the capability to Add metric points, and other things. Commit 667e6d49fd3a3abcca27b515c0b7b3e97152b9dc adds the capability to Delete metric points.

ghost commented 5 years ago

Great, it's now supporting all Cachet features, isn't it?

BerkanYildiz commented 5 years ago

A few features are missing but they can be implement easily, the most important requests are there. I'll implement them when I get the time.

ghost commented 5 years ago

I see @michalblaha has done quite a lot of work, is it possible to combine those two repositories? michalblaha/Cachet.NET

villainoustourist commented 5 years ago

@lhy0403 Since the other repo is forked - a pull request would be a great way to merge the repos.

ghost commented 5 years ago

Well I chose not to do so was because of the mismatch of the code styles. At that time I didn't have enough time to solve the merge conflict as well... Unfortunately.