You're reading from VMware vRealize Orchestrator Cookbook. - Second Edition
These plugins are just normal plugins that are used regularly (well...at least by me). All the plugins shown in this recipe will add a lot of possibilities in your programming kit bag.
Let's have a look at an example: You have a workflow that deploys a VM and after it is finished you would like to send an acknowledgment e-mail to a user and a CSV file to a CMDB (Content Management Database).
Another example would be current or legacy systems that have an SSH interface but no API or plug-in available. The SSH plug-in could be used to SCP files/scripts to and from the target system, automatically backup configurations, or apply approved configurations.
In this recipe, we will learn how to interact with e-mails and discuss configuring, sending, and receiving e-mails with Orchestrator. We will discuss both e-mail objects that the API currently has.
Unsurprisingly, we need an e-mail server. If you don't have one handy, you can use hMailServer for Windows; refer to the There's more... section of this recipe to learn how to install and configure this free, open source e-mail server.
For this recipe, we will use IMAP and SMTP to connect to the e-mail server. In the How it works... section, we also take a quick look at POP3 and SSL. We will also need two e-mail addresses. In our example, we will use vcotest@mylab.local
and vcotest2@mylab.local
.
There are two API objects that can be used when working with e-mail: the MailClient
object and the EmailMessage
object. We will use EmailMessage
to send messages and MailClient
to receive e-mail.
Here we will explore how Orchestrator can interact with the filesystem of its operating system. We will also take a look at how to access a network share and execute local files.
Orchestrator needs to be able to access a directory on the local filesystem. To configure this access and set the access rights, take a look at the Configuring access to the local filesystem recipe in Chapter 2, Optimizing Orchestrator Configuration.
In my example, I will simply use the default Orchestrator file location that is set to rwx
the directory /var/run/vco/
.
In addition to this, you should have administrative (root) access to Orchestrator's operating system.
We have a bit of ground to cover, so let's start!
This part showcases how to write into a file with, and without, a line feed as well as how to append to an existing file:
Create a new workflow and create the following variables:
Name
Type
Section
Use
fileName
String
IN
The name...
This recipe centers on using the SSH plugin. With this plugin, you are able to connect to appliances (think managed routers, switches, and so on...) or a Linux- or Solaris-based system, run programs, or transfer files.
We need to be able to create a new workflow. We also need a Linux or Solaris system that we can access via SSH (for example, as root). If you don't have a Linux system handy, you can use the Orchestrator appliance itself.
For the SCP example, you need to allow Orchestrator access to its local filesystem, or use the default
/var/run/vco
directory. Refer to the Configuring access to the local filesystem recipe in Chapter 2, Optimizing Orchestrator Configuration.If you want to connect to the appliance itself (
127.0.0.1
) you need to enable SSH access as shown in the Tuning the appliance recipe in Chapter 2, Optimizing Orchestrator Configuration.In this recipe, we will use the REST plugin. We will use it to connect to the Orchestrator Control Center REST API.
We need a REST-capable host you can contact. As every REST host handles things a little differently, we will use the REST interface Orchestrator and the Orchestrator Control Center, to showcase the functionality.
I have also collected some other Orchestrator-REST integration examples in the See also section of this recipe.
If you are new to REST, I would like to point you to the Accessing Orchestrator REST API recipe in Chapter 7, Interacting with Orchestrator.
This recipe is divided into connecting, gathering information, sending information, as well as creating workflows.
The rest of the chapter is lockedYou have been reading a chapter fromVMware vRealize Orchestrator Cookbook. - Second EditionPublished in: Nov 2016Publisher: PacktISBN-13: 9781786462787© 2016 Packt Publishing Limited All Rights ReservedRegister for a free Packt account to unlock a world of extra content!A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.undefinedUnlock this book and the full library FREE for 7 daysGet unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think ofRenews at €14.99/month. Cancel anytimePersonalised recommendations for you
Based on your interests and search pattern