-
Notifications
You must be signed in to change notification settings - Fork 6
/
apwCheckEnvironmentsStatus.txt
32 lines (32 loc) · 1.78 KB
/
apwCheckEnvironmentsStatus.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<p>
Notify Apwide Golive about environments status based on check provided as closure. (notify status change only if different of what is in Golive)
If criteria is provided, will search environments using criteria, otherwise, will use application parameter.
To know what are the available criteria<a href="https://confluence.apwide.com/display/TEM/Search+Environments">Apwide documentation</a>
Apwide environment is passed to the check status closure.
</p>
<p></p>
<dl>
<dt>criteria</dt><dd>Search criteria map</a>
<dt>application</dt><dd>Environment Application name. (if null, read from env.APW_APPLICATION)</dd>
<dt>unavailableStatus</dt><dd>Status name when environment is unavailable. (if null, read from env.APW_UNAVAILABLE_STATUS, default is 'Down')</dd>
<dt>availableStatus</dt><dd>Status name when environment is available. (if null, read from env.APW_AVAILABLE_STATUS, default is 'Up')</dd>
<dt>checkStatus</dt><dd>Closure used to check environment status. If exception is thrown, environment considered not available. If not provided,
A simple http request will be triggered on the environment URL</dd>
</dl>
<br/>
<p>Usage example:</p>
<pre><code>
apwCheckEnvironmentStatus application:'eCommerce',unavailableStatus:'Down', availableStatus:'Up', checkStatus:{ environment ->
sh "timeout 5 wget --retry-connrefused --tries=5 --waitretry=1 -q ${environment.url} -O /dev/null"
}
</code></pre>
<p>Using criteria:</pa>
<pre><code>
apwCheckEnvironmentStatus criteria:[
applicationName:'eCommerce',
statusName:['Up', 'Down'],
'# servers':'4'
], unavailableStatus:'Down', availableStatus:'Up', checkStatus:{ environment ->
sh "timeout 5 wget --retry-connrefused --tries=5 --waitretry=1 -q ${environment.url} -O /dev/null"
}
</code></pre>