Created
October 14, 2015 16:38
-
-
Save Dalmirog-zz/0e05b54e0c49c5ebac87 to your computer and use it in GitHub Desktop.
filterevents
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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