This is the latest (for the time being) integration available for the Warden, that provides an access to the custom HTTP API (with any URL that you’d like to use ) to which you may send a POST request including (or not) a body, headers etc.
Additionally, you can make use of the available extensions that work out of the box with Warden Web Panel running the Azure cloud, which can be also hosted on your own (by cloning the repository) . If you’re interested in such feature, especially in case you’d like to make your own webhooks or just use the Web Panel – take a look at the whole article.
To begin with – installation is done via the NuGet by running the following command:
1 |
Install-Package Warden.Integrations.HttpApi |
Once it’s completed, you may start using this integration, for example in such way:
1 2 3 4 5 6 7 8 9 |
var wardenConfiguration = WardenConfiguration .Create() .IntegrateWithHttpApi("http://my-api.com") .SetGlobalWatcherHooks((hooks, integrations) => { hooks.OnStart(check => GlobalHookOnStart(check)) .OnFailureAsync(result => integrations.HttpApi().PostAsync(new {failure = true})) }) //Configure watchers, hooks etc.. |
Here, we’re configuring the custom URL for the API, and using the OnFailureAsync() hook to send an object which contains a single property failure set to be true.
And below is an example in which the iteration data, thanks to the available extensions, will be sent directly to the Web Panel (in Azure, but could be your own, self-hosted API as well).
1 2 3 4 5 6 7 8 9 10 |
var wardenConfiguration = WardenConfiguration .Create() .IntegrateWithHttpApi("https://panel.getwarden.net/api", "my-api-key", "my-organization-id") .SetHooks((hooks, integrations) => { .OnIterationCompletedAsync(iteration => integrations.HttpApi() .PostIterationToWardenPanelAsync(iteration)); }) //Configure watchers, hooks etc.. |
The HTTP API integration is, of course, configurable, for instance, you may set a request timeout, default headers or custom HTTP service provider. To find out more about this topic, please navigate to the documentation.
In the following days I’m going to officially release the Web Panel, so just keep in mind that this integration is the key to working with this application seamlessly.