Skip to content

Instantly share code, notes, and snippets.

@Dalmirog-zz
Created October 14, 2015 16:38
Show Gist options
  • Save Dalmirog-zz/0e05b54e0c49c5ebac87 to your computer and use it in GitHub Desktop.
Save Dalmirog-zz/0e05b54e0c49c5ebac87 to your computer and use it in GitHub Desktop.
filterevents
void Main()
{
var octopusUrl = "http://octopus.url";
var apiKey = "API-XXXXXXXXXXXXXXXXXX";
var octopusServer = new Octopus.Client.OctopusServerEndpoint(octopusUrl, apiKey);
var repo = new Octopus.Client.OctopusRepository(octopusServer);
// Define other methods and classes here
var events = repo.Events.List();
var createdEvents = events.Items.Where(FilterEvents);
while (events.Links.ContainsKey("Page.Next"))
{
events = repo.Events.List(events.ItemsPerPage);
createdEvents = createdEvents.Concat(events.Items.Where(FilterEvents));
//events.Dump();
}
createdEvents.Dump();
}
public bool FilterEvents(Octopus.Client.Model.EventResource e)
{
return e.Category == "Created";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment