Пример #1
0
        public StatusIoClient(StatusIoConfiguration configuration)
        {
            Configuration = configuration;
            network       = new StatusIoNetwork(configuration);

            components  = new ComponentApi(this);
            incidents   = new IncidentApi(this);
            maintenance = new MaintenanceApi(this);
            metrics     = new MetricApi(this);
            status      = new StatusApi(this);
            subscribers = new SubscriberApi(this);
        }
Пример #2
0
        private static async Task Test(IncidentApi incidents)
        {
            var listIncidentBefore = await incidents.GetListAsync();

            var firstActiveMessage = listIncidentBefore.Result.Active.First().Messages.First();
            var getMessage         = await incidents.GetMessageAsync(firstActiveMessage.Id);

            var newIncident = await incidents.CreateAsync(new CreateIncident
            {
                Name          = "Test " + DateTime.Now,
                Details       = "Automatically created.",
                CurrentStatus = IncidentStatus.PartialServiceDisruption,
                CurrentState  = OperationalState.Investigating,
                ComponentIds  = getMessage.Result.ComponentIds,
                ContainerIds  = getMessage.Result.ContainerIds
            });

            var listIncidentAfter = await incidents.GetListAsync();

            var lastActiveIncident = listIncidentAfter.Result.Active.Last();

            var deleteIncident = await incidents.DeleteAsync(lastActiveIncident.Id);
        }