All posts by Steve

VMware vSphere SDKs explained

I currently manage the vSphere/VMware Cloud on AWS SDK team and I find that looking at the SDK’s page on VMware Code it can be a bit daunting to figure out exactly which SDK you might need. So, to clarify the landscape for vSphere specific SDKs a bit I thought I’d flesh out some of the unwritten details.

SDKs & Tools for Calling VMware SOAP API’s

As of this writing the bulk of VMware’s vSphere API’s are SOAP API’s which can be used from a variety of languages built using VMware’s WSDL including the Management SDK (for Java and .NET), the family of  “vmomi” tools: Pyvmomi, Govmomi, rbvmomi and last but not least the Perl SDK.

Ok, on to REST APIs…

SDKs for VMware REST APIs

Prior to the release of vSphere 6.5 in 2016, VMware released a set of “vCloud Suite *” SDK’s for use with the Tagging and Content Library REST API’s. With the release of 6.5 VMware created a new set of SDKs named “vSphere Automation SDK for *” where “*” is a language like Java, Python or Ruby. These new SDK’s were released on Github and are available here.

VMware Cloud on AWS APIs

At VMworld in 2017 VMware announced the release of VMware Cloud on AWS (VMC) and with it a new set of API’s for managing this new IaaS environment. As part of this expansion we’ve since added support for these API’s to the vSphere Automation SDK’s to include language bindings for the VMC Console API’s as well as NSX-T Policy API’s.

So there you have it. Hopefully, this helps explain some of the links on the SDK page the VMware {code} website.

Please post a comment with any questions.

VMware Automation SDK for Python API Reference Documentation

Accessing VMware vcenter REST API Authentication from curl

Here’s a simple example of calling the vSphere REST API using curl. These commands first authenticate to the API which creates a vmware-api-session-id cookie which is stored to cookie-jar.txt then makes a request to get a list of VMs:

curl -k -i -u administrator@vsphere.local:password -X POST -c cookie-jar.txt https://sc-rdops-vm12-dhcp-118-200/rest/com/vmware/cis/session
curl -k -i -b cookie-jar.txt https://vcenter/rest/vcenter/vm

NOTE: Use with caution as your credentials will likely be caught in your command line history!

Here’s a related post on vSphere SDKs.

Highway 17 Santa Cruz Mountains Traffic Commuter Resources

Resources for information on Highway 17 Traffic over the Santa Cruz mountains to/from Los Gatos.

Installing R and Shiny on Cloud 9

I wanted to see if I could run an instance of RStudio’s Shiny server on Cloud 9 and after a bit of finagling with the right set of steps to get it set up I have an instance running. Here’s what I did starting from a workspace using the stock HTML template.

strefethen:~/workspace/ $ sudo sh -c 'echo &quot;deb http://cran.rstudio.com/bin/linux/ubuntu trusty/&quot; &amp;gt;&amp;gt; /etc/apt/sources.list<br />
strefethen:~/workspace/ $ gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9<br />
strefethen:~/workspace/ $ sudo apt-get update<br />
strefethen:~/workspace/ $ sudo su - \<br />
-c &quot;R -e \&quot;install.packages('shiny', repos='https://cran.rstudio.com/')\&quot;&quot;<br />
strefethen:~/workspace/ $ sudo su - -c &quot;R -e \&quot;install.packages('shiny', repos='https://cran.rstudio.com/')\&quot;&quot;<br />
strefethen:/etc/shiny-server $ sudo shiny-server<br />
[2016-09-02 02:25:04.460] [INFO] shiny-server - Shiny Server v1.4.4.801 (Node.js v0.10.46)<br />
[2016-09-02 02:25:04.463] [INFO] shiny-server - Using config file &quot;/etc/shiny-server/shiny-server.conf&quot;<br />
[2016-09-02 02:25:04.535] [WARN] shiny-server - Running as root unnecessarily is a security risk! You could be running more securely as non-root.<br />
[2016-09-02 02:25:04.539] [INFO] shiny-server - Starting listener on 0.0.0.0:8081<br />

I need to look into the user “shiny” to see about fixing the above warning. Then edit /etc/shiny-server/shiny-server.conf and change the port from 3838 -> 8081 so Cloud 9 will server the content and start the server:
<br />
sudo shiny-server<br />

Browse to http://<project-name>-<username>.c9users.io:8081/ and you should see:

Default Shiny app running on Cloud 9

React Native bundle loading failing on a physical device

I’m building a React Native application and recently updated to v0.31.0 and at first things were working well debugging on the device benefiting from a feature of the react-native-xcode.sh script. The script copies your Dev machine’s IP address to a text file called ip.txt which is used for establishing the connection to your machine from your device since localhost points to the wrong place. Here’s the line of code in ./node_modules/react-native/packager/react-native-xcode.sh:

echo "$IP.xip.io" &gt; "$DEST/ip.txt"

Continue reading React Native bundle loading failing on a physical device

Using Google Sheets, Pivot Tables and Charts as a Startup Dashboard – Part II

In my previous post I wrote about the process that lead me to build a dashboard but first I want to talk a bit about the structure of the data in the Google Sheet where the whole process started. I first started by looking to quickly create a few charts to visualize some of our KPI‘s. To source the data I created a text file containing the SQL statements and used psql to fetch Postgres data which I dumped it to data into .CSV files for import into separate “data” only tabs in Google Sheets.

<br />
psql -h pgserver -d mydb -U myuser -w -t -A -F $'\t'  -f ~/Campaigns.sql &amp;gt; campaign.csv

Continue reading Using Google Sheets, Pivot Tables and Charts as a Startup Dashboard – Part II

From Google Sheets to an Automated Shiny Dashboard (Part I)

Over the past several months I’ve been building what’s become a large Google Sheet (which is now at the 2M cell limit) tracking Find&Save Cash Dash offers. Like a lot of data projects this one started out small but over many months grew to a point where it no longer makes sense to cut/paste SQL data into a Google Sheet for pivot tables and charts. I wanted a solution that could pull data from REST APIs, MSSQL and Postgres and present data in an internal dashboard. Unfortunately, Google Sheet’s JDBC support doesn’t include Postgres otherwise Google Apps Script might have been a viable choice for automating data collection notwithstanding size limitations. Finally, another issue with Sheets was that I couldn’t seem to get pivot tables to resize automatically as more data was added. So, 3 strikes and Google Sheets was out.

Continue reading From Google Sheets to an Automated Shiny Dashboard (Part I)

Plotting Weekly Mobile Retention from the Localytics API using R and ggplot2

Part of building mobile web apps is understanding the myriad of mobile analytics and in part visualizing the data to shed light on trends that my otherwise be difficult to see in tabular data or even a colorful cohort table. I’ve been building a dashboard using R, RStudio, Shiny, and Shiny Dashboards aggregating data from MSSQL, Postgres, Google Analytics, and Localytics.
Continue reading Plotting Weekly Mobile Retention from the Localytics API using R and ggplot2