Skip to content

Instantly share code, notes, and snippets.

View AaronMcCaughan's full-sized avatar

AaronMcCaughan

View GitHub Profile
@AaronMcCaughan
AaronMcCaughan / Create_Health_Check_Status_history_via_API.js
Created August 13, 2020 05:03
Create_Health_Check_Status_history_via_API
/*
This script will connect to Plutora using Oauth 2.0 Authentication and retrieve a list of environments to be based on the search parameters defined in the Plutora UI.
It will then console.log the response to the execution log in Plutora.
This script uses credentials that are defined in Plutora UI as Job Parameters. Refer to the knowledge base in Plutora for more information on adding parameters
To execute this script on your own instance of Plutora, create a new Job, upload the script and define the parameters in the Plutora UI as follows (Note the parameter names are case sensitive):
- oauthurl = <This is the oauth url of your instance of Plutora>
- apiUrl = <This is the API url of your instance of Plutora>
- username = <This is the user email to authenticate with your instance of Plutora>
/**************************************************************
**********ENVIRONMENT HEALTH CHECK SAMPLE SCRIPT *************
**************************************************************
This script will connect to Jenkins using Basic Authentication and trigger the execution of a Job using API' requests. It will then copy the log file from Jenkins to the execution log in Plutora
The script accepts the input parameters below, triggers the execution of a Jenkins job and captures the console output in Plutora.
The paramaters entered into the UI need to be named as follows and are case sensitive:
- host = <This is the url of your instance of Jenkins>
- user = <This is the user to authenticate with Jenkins>
@AaronMcCaughan
AaronMcCaughan / Execute a test against Plutora APIs.js
Last active August 14, 2019 01:33
Environment Health Check - Test Plutora APIs
/**************************************************************
**********ENVIRONMENT HEALTH CHECK SAMPLE SCRIPT *************
**************************************************************
The following scripts executes a plain JS Test script.
The script accepts a URL and API Credentials as parameters passed in from the UI, generates a Oauth token and makes a simple API call
The paramaters entered into the UI need to be named as follows and are case sensitive:
- url = <The API oauth url of your Plutora Instance>
- clientId = <The API clientId for your instance of Plutora>
@AaronMcCaughan
AaronMcCaughan / Test Plutora SSO Login using a Selenium Test.js
Last active August 14, 2019 01:37
Environment Health Check - Test Plutora SSO Login
/**************************************************************
**********ENVIRONMENT HEALTH CHECK SAMPLE SCRIPT *************
**************************************************************
The following scripts accepts a URL and SSO Credentials as parameters passed in from the UI and logs into the Plutora Application using SSO
The script executes a headless selenium script to perform the test.
The script accepts a URL, email, password and failure email address as parameters passed in from the UI and logs into Plutora using SSO
The paramaters entered into the UI need to be named as follows and are case sensitive:
@AaronMcCaughan
AaronMcCaughan / Barclays Schedule.css
Last active January 16, 2019 08:02
Barclays Schedule
imdashboard .barclays-envs-panel {
border-width: 0;
}
imdashboard .barclays-envs-panel .panel-heading {
border-bottom-width: 0;
}
imdashboard .barclays-envs-panel .panel-heading h4 {
font-size: 16px;
line-height: 36px;
}
@AaronMcCaughan
AaronMcCaughan / Barclays TECR Grid View.css
Last active January 16, 2019 08:00
Barclays TECR Grid View
.barclays-tecr {
position: relative;
}
imdashboard .barclays-tecr-panel {
border-width: 0;
/*background-color: transparent;*/
}
imdashboard .barclays-tecr-panel .panel-heading {
border-bottom-width: 0;
}
@AaronMcCaughan
AaronMcCaughan / Barclays TEBR Grid View.css
Last active January 16, 2019 07:59
Barclays TEBR Grid View
.barclays-tebr {
position: relative;
}
imdashboard .barclays-tebr-panel {
border-width: 0;
/*background-color: transparent;*/
}
imdashboard .barclays-tebr-panel .panel-heading {
border-bottom-width: 0;
}
@AaronMcCaughan
AaronMcCaughan / Barclays Banner & Widgets.css
Last active January 16, 2019 07:57
Barclays Banner & Widgets
imdashboard .barclays-promo-panel {
background-color: #607;
border-color: #888;
background: #000 url("http://help.plutora.com/wp-content/uploads/2019/01/barc.png") no-repeat center;
background-size: contain;
}
imdashboard .barclays-promo-panel .panel-heading {
border-color: transparent;
}
imdashboard .barclays-promo-panel .panel-heading h4 {
@AaronMcCaughan
AaronMcCaughan / Sample script to trigger email notifications.js
Last active June 28, 2020 10:33
Sample script to trigger email notifications
let run = function (args) {
return new Promise((resolve,reject)=>{
console.log('Sending email');
mailData = {
to: 'email@email.com', // Required - Address data can be passed as a single string with commmas separating addresses or an array of single address strings. ie: ['a@a.com', 'b@b.com']
//cc: 'a@a.com', //optional
//bcc: 'a@a.com', //optional
subject: 'Test Email', //Required
/*Copy this snippet of code into the html section of the widget editor*/
<div class="user-info-tooltip">
<div class="user-info-wrapper">
<div class="user-info-top">
<div class="user-location"><span>Sydney, Australia</span></div>
<div class="user-weather"><span class="icon-weather"></span><span class="degree"></span><span class="unit">℃</span></div>
</div>
</div>
</div>