Пример #1
0
 /// <summary>
 /// Fire is used to fire a new user event. Only the Name, Payload and Filters are respected. This returns the ID or an associated error. Cross DC requests are supported.
 /// </summary>
 /// <param name="ue">A User Event definition</param>
 /// <param name="q">Customized write options</param>
 /// <returns></returns>
 public WriteResult<string> Fire(UserEvent ue, WriteOptions q)
 {
     var req =
         _client.CreateWrite<byte[], EventCreationResult>(string.Format("/v1/event/fire/{0}", ue.Name),
             ue.Payload, q);
     if (!string.IsNullOrEmpty(ue.NodeFilter))
     {
         req.Params["node"] = ue.NodeFilter;
     }
     if (!string.IsNullOrEmpty(ue.ServiceFilter))
     {
         req.Params["service"] = ue.ServiceFilter;
     }
     if (!string.IsNullOrEmpty(ue.TagFilter))
     {
         req.Params["tag"] = ue.TagFilter;
     }
     var res = req.Execute();
     var ret = new WriteResult<string>()
     {
         RequestTime = res.RequestTime,
         Response = res.Response.ID
     };
     return ret;
 }
Пример #2
0
 /// <summary>
 /// Fire is used to fire a new user event. Only the Name, Payload and Filters are respected. This returns the ID or an associated error. Cross DC requests are supported.
 /// </summary>
 /// <param name="ue">A User Event definition</param>
 /// <param name="q">Customized write options</param>
 /// <returns></returns>
 public async Task<WriteResult<string>> Fire(UserEvent ue, WriteOptions q)
 {
     var req = _client.Put<byte[], EventCreationResult>(string.Format("/v1/event/fire/{0}", ue.Name), ue.Payload, q);
     if (!string.IsNullOrEmpty(ue.NodeFilter))
     {
         req.Params["node"] = ue.NodeFilter;
     }
     if (!string.IsNullOrEmpty(ue.ServiceFilter))
     {
         req.Params["service"] = ue.ServiceFilter;
     }
     if (!string.IsNullOrEmpty(ue.TagFilter))
     {
         req.Params["tag"] = ue.TagFilter;
     }
     var res = await req.Execute().ConfigureAwait(false);
     return new WriteResult<string>(res, res.Response.ID);
 }
Пример #3
0
 public WriteResult<string> Fire(UserEvent ue)
 {
     return Fire(ue, WriteOptions.Empty);
 }
Пример #4
0
 public Task <WriteResult <string> > Fire(UserEvent ue, CancellationToken ct = default(CancellationToken))
 {
     return(Fire(ue, WriteOptions.Default, ct));
 }
Пример #5
0
 public async Task<WriteResult<string>> Fire(UserEvent ue)
 {
     return await Fire(ue, WriteOptions.Default).ConfigureAwait(false);
 }
Пример #6
0
 public Task<WriteResult<string>> Fire(UserEvent ue)
 {
     return Fire(ue, WriteOptions.Default);
 }
Пример #7
0
 public WriteResult <string> Fire(UserEvent ue)
 {
     return(Fire(ue, WriteOptions.Empty));
 }
Пример #8
0
 public Task <WriteResult <string> > Fire(UserEvent ue)
 {
     return(Fire(ue, WriteOptions.Default));
 }