Skip to content

Instantly share code, notes, and snippets.

View johnddias's full-sized avatar
:octocat:
Being fabulous!

John Dias johnddias

:octocat:
Being fabulous!
View GitHub Profile
@johnddias
johnddias / gist:0265cbb393c293d85fa8900f997e16d4
Created June 9, 2020 10:49
Start Telegraf Agent Bootstrap for vROps 8.1
import requests
import json
def installAgent(context, inputs):
if "verify" not in inputs.keys():
inputs["verify"] = True
print(inputs["verify"])
headers = {'Content-type':'application/json','Accept':'application/json','Authorization':'vRealizeOpsToken '+ inputs["token"]}
payload = {
"resourceCredentials" : [ {
@johnddias
johnddias / gist:50f6c71a9726cdfdd8edd1b314df4f6d
Created June 9, 2020 10:50
Get Bootstrap Status of Agent Install for vROps
import requests
import json
import logging
def getBootstrapStatus(context, inputs):
if "verify" not in inputs.keys():
inputs["verify"] = True
headers = {'Content-type':'application/json','Accept':'application/json','Authorization':'vRealizeOpsToken '+ inputs["token"]}
r = requests.request('GET','https://'+inputs["vropsHost"]+'/suite-api/api/applications/agents/'+inputs["taskId"]+'/status', headers=headers, verify=inputs["verify"])
if (r.status_code == 200):
{
"variables": [],
"info": {
"name": "vRealize Operations 6",
"_postman_id": "8725de8d-4ad6-2dc9-887a-54fe8e1f879b",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@johnddias
johnddias / gist:0a66539ef95ae69fe4aba42495f36120
Created August 8, 2017 14:33
Postman "Pre-Request" script for setting epoch environment var
var epoch = (new Date).getTime();
postman.setEnvironmentVariable("epoch", epoch);
var epochPrev24 = epoch - (24*60*60*1000)
postman.setEnvironmentVariable("epochPrev24", epochPrev24)