Пример #1
0
 private StatusHistory GetSampleStatusHistory(string teamId, DateTime date, DowntimeStatus status)
 {
     return(new StatusHistory
     {
         TeamId = teamId,
         Date = date,
         Status = status
     });
 }
Пример #2
0
 /* Path: /api/nodes/my/downtimes?key=<apikey>&page=<pageservernumber>&rows=<rowcount>
  * Optional Parameters:  &nid=<nodeid>  return only for specified node. e.g. &nid=435, &status=<status>  where <status> is 'o' for open or 'c' for closed.  e.g. &status=o
  * Return: Downtimes for all nodes associated with the API key.
  * Expected return: {"page":1,"total":79,"rowsperpage":"10","records":781,"rows":[{"id":120679,"fqdn":"zen1.secnodes.com","home":"ts1-testnet.na","curserver":"ts1-testnet.na","start":"2018-06-12T06:06:20.000Z","check":"2018-06-12T06:19:14.000Z","end":"2018-06-12T06:19:29.000Z","duration":789000,"dtype":"sys","nid":9}]}
  */
 public static HorizenNodeAPIDataModels.MyDowntimes GetMyDowntimes(APIKey apikey, int pageservernumber, int rowcount, int?servernumber, int nodeid = 0, string category = null, DowntimeStatus downtimestatus = DowntimeStatus.NONE, ServerRegion serverregion = ServerRegion.NONE)
 {
     return(JsonConvert.DeserializeObject <HorizenNodeAPIDataModels.MyDowntimes>(GetQueryJson(apikey.APINodeType, serverregion, servernumber, APIPagedCallUrlParts.MyDowntimes(apikey, pageservernumber, rowcount, nodeid, downtimestatus, category))));
 }
Пример #3
0
        public static string MyDowntimes(APIKey apiKey, int pageNumber, int rowCount, int nodeId = 0, DowntimeStatus downtimeStatus = DowntimeStatus.NONE, string category = null)
        {
            var retVal = "/api/nodes/my/downtimes?key=" + apiKey.APIkey + "&page=" + pageNumber + "&rows=" + rowCount + (nodeId > 0 ? "&nid=" + nodeId : "") + (!string.IsNullOrEmpty(category) ? "&cat=" + category : "");

            switch (downtimeStatus)
            {
            case DowntimeStatus.OPEN:
                return(retVal + "&status=o");

            case DowntimeStatus.CLOSED:
                return(retVal + "&status=c");

            case DowntimeStatus.EXCLUDE:
                return(retVal + "&status=x");

            case DowntimeStatus.NONE:
            default:
                return(retVal);
            }
        }