Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Being fabulous!

John Dias johnddias

:octocat:
Being fabulous!
View GitHub Profile
@johnddias
johnddias / gist:50f6c71a9726cdfdd8edd1b314df4f6d
Created Jun 9, 2020
Get Bootstrap Status of Agent Install for vROps
View gist:50f6c71a9726cdfdd8edd1b314df4f6d
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):
@johnddias
johnddias / gist:0265cbb393c293d85fa8900f997e16d4
Created Jun 9, 2020
Start Telegraf Agent Bootstrap for vROps 8.1
View gist:0265cbb393c293d85fa8900f997e16d4
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" : [ {
View gist:e7375d18676612776fed9bebbeb0561c
import requests
import json
def getResourceId(context, inputs):
if "verify" not in inputs.keys():
inputs["verify"] = True
headers = {'Content-type':'application/json','Accept':'application/json','Authorization':'vRealizeOpsToken '+ inputs["token"]}
payload = {
'propertyName':'summary|UUID',
'propertyValue':inputs["vmUUID"]
View gist:ed61a72883281627296d8ef38811a2bc
import requests
import json
def getAuthToken(context, inputs):
if "verify" not in inputs.keys():
inputs["verify"] = True
headers = {'Content-type':'application/json','Accept':'application/json'}
payload = {
'username':inputs["username"],
'authSource':inputs["authSource"],
@johnddias
johnddias / gist:0a66539ef95ae69fe4aba42495f36120
Created Aug 8, 2017
Postman "Pre-Request" script for setting epoch environment var
View gist:0a66539ef95ae69fe4aba42495f36120
var epoch = (new Date).getTime();
postman.setEnvironmentVariable("epoch", epoch);
var epochPrev24 = epoch - (24*60*60*1000)
postman.setEnvironmentVariable("epochPrev24", epochPrev24)
View gist:ba8d716b1ca108db8d2194bed0056411
<?xml version="1.0" encoding="UTF-8"?>
<AdapterKinds>
<AdapterKind adapterKindKey="APPLICATIONDISCOVERY">
<ResourceKind resourceKindKey="ApplicationDiscoveryAdapterInstance">
<Metric attrkey="Instance Attributes|elapsed_collect_time" label="" unit="" yellow="" orange="" red=""/>
<Metric attrkey="Instance Attributes|new_metrics" label="" unit="" yellow="" orange="" red=""/>
<Metric attrkey="Instance Attributes|new_resources" label="" unit="" yellow="" orange="" red=""/>
<Metric attrkey="Instance Attributes|observations" label="" unit="" yellow="" orange="" red=""/>
</ResourceKind>
</AdapterKind>
@johnddias
johnddias / SDMPTSdashboard.json
Created May 11, 2017
vROps Service Discovery Management Pack Discovery Issues Dashboard
View SDMPTSdashboard.json
{
"dashboards": [{
"autoswitchEnabled": false,
"columnCount": 1,
"columnProportion": "1",
"creationTime": 1492613965544,
"description": "",
"disabled": false,
"id": "8abb8f61-f123-4ca4-8c56-dcfcaaa0aa17",
"importAttempts": 0,
@johnddias
johnddias / Dockerfile
Created Mar 29, 2017
Dockerfile for Webhook-Shims container
View Dockerfile
FROM photon:latest
MAINTAINER John Dias "diasj@vmware.com"
RUN tdnf install python2 python-xml -y \
&& curl -s https://bootstrap.pypa.io/get-pip.py > /tmp/get-pip.py \
&& /usr/bin/python /tmp/get-pip.py \
&& tdnf install git -y \
&& git clone https://github.com/vmw-loginsight/webhook-shims.git ~/webhook-shims
WORKDIR /root/webhook-shims
RUN /usr/bin/pip install -r requirements.txt
#ENTRYPOINT ["python"]
View vrops.postman_environment.json
{
"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": [
{
View gist:8922834a36d12c2c1dea
var launchedFrom = eventPayloadProperties.get("lifecycleState");
externalWFStub=launchedFrom.get("state")+":"+launchedFrom.get("phase");