Skip to content

annotation

LUYONGQIANG edited this page Dec 3, 2019 · 4 revisions

/api/annotation
These endpoints provides a means of adding, editing or deleting annotations stored in the OpenTSDB backend. Annotations are very basic objects used to record a note of an arbitrary event at some point, optionally associated with a timeseries. Annotations are not meant to be used as a tracking or event based system, rather they are useful for providing links to such systems by displaying a notice on graphs or via API query calls.

C# Code

 AnnotationRequest requst = new AnnotationRequest()
 {
  StartTime = ConvertDateTimeInt(DateTime.Now.AddDays(-30)),
  Tsuid = "000001000001000001",
  Description = "test annotation",
  Notes = "details",
  Custom = new Dictionary<string, string>()
  {
    {"owner","jdoe" },
    {"dept","ops" }
  }
 };
 var result = await apiClient.PostAsync<dynamic>("/api/annotation", requst);
 if (result != null)
 {
    Console.WriteLine(result);
 }

Result

{
  "tsuid": "000001000001000001",
  "description": "test annotation",
  "notes": "details",
  "custom": {
    "owner": "jdoe",
    "dept": "ops"
  },
  "startTime": 1572848249,
  "endTime": 0
}

Clone this wiki locally