List_VMs: Create a list of available VMs containing the VM Name, Power State, Number of CPUs, and Memory Size in Megabytes.Tagging: Create vSphere Tag Category and associated tags.Connection: Sample framework to successfully connect to the vSphere Automation API endpoint and retrieve the SAML token.There are a couple samples which are included with the SDK, they are: The Samples docs are available in the following location: /docs/apidocs/vsphereautomation-samples Running Samples The API docs are available in the following location: /docs/apidocs/vsphereautomation-bindings One quick item to note, the SDK’s documentation is available locally as part of the cloned repository. We are now all setup to start using the vSphere Automation SDK for Ruby! Gem install vsphere-automation-sdk-2.5.0.gem We can take the Gem filename and run the following command: Once complete, we will have the Gem that we’ll need to then install. Gem build vsphere-automation-sdk-ruby.gemspec To perform the build, switch to the directory where the vsphere-automation-sdk-ruby.gemspec file is located and run the following command: Lastly, we will need to build and then install our Gem. We can install bundler with the following command: Bundler is used to manage the required gems and which versions of those gems are required. In order to easily install all of these dependencies, we will use Bundler. The Gem spec file is named: vsphere-automation-sdk-ruby.gemspec These dependencies are called out in the Gem specification file which is located in the root of our cloned repo directory. This SDK also has a couple dependencies which will also need to be installed. We will do this, through Homebrew, with the following command: Next, we will install the latest version of Ruby available. If you don’t have it already, it can be easily downloaded and installed with the following command: In order to obtain the newer version of Ruby, we will need to install the package manager, Homebrew. On this particular system, which is currently running Mac OS Sierra (10.12), we see that it’s currently running Ruby 2.0.0. We will then need Ruby to be at version 2.3.1 or better. We can do that with the following command: The first thing we’ll want to do before getting started with this SDK is to clone the repo to the local system. Note: If you’re using this SDK on any other OS, check out the ‘ Quick Start Guide‘ section of the GitHub repository for guidance. Before diving in, there are a couple prerequisites we’ll need to download and install. We’ll be taking a look at how to easily get started with this SDK on Mac OS. The posts already available in the series so far are as follows: That means it’s time for another blog post in our series on ‘Getting Started with the vSphere Automation SDKs’. This time, it is the vSphere Automation SDK for Ruby! There has been another exciting open-sourced release in the vSphere Automation SDK lineup.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |