After the initial bad experience with the new Azure Resource Management APIs, I took a different approach – try the old Service Management APIs. While transitioning from old system to new system, the old one may still be the best for an unexpected long period of time. Like VMware vSphere Client, VMware has declared end of life many times, but it’s still the favorite for most customers, while the future Web Client remains “future” since 2011. Read more...
In my previous posts, I showed samples on virtual machine creation, virtual machine instances listing, storage volume listing. This sample shows how to list all the networks that you have.
With the information about your networks, you can get all the private and public IP addresses.
To run the following sample, you can check out the previous post for the pom.xml file and how to get AWS credentials from AWS console.
83f1aa2f1ef6bf0dfda5a224e13e4706012 Read more...
In my previous posts, I showed samples on how to create a new virtual machine instance, and how to list all the virtual machine instances you own. This sample shows how to list all the disk volumes that you have.
To run the following sample, you can check out the previous posts for the pom.xml file and how to get AWS credentials from AWS console.
public class AwsEc2ListVolumes
public static void main(String args) throws Exception
AWSCredentials credentials = new PropertiesCredentials(AwsEc2ListVolumes.class.getResourceAsStream("/AwsCredentials.properties"));
AmazonEC2 ec2 = new AmazonEC2Client(credentials);
DescribeVolumesResult volReq = ec2.describeVolumes();
int count = 1;
for (Volume vol : volReq.getVolumes())
System.out.println("Volume " + count + "\n Details: " + vol);
The output will be something as follows: Read more...
In my previous post, I showed a sample on how to list virtual machine instances. While that is helpful, maybe even more so is to create a new virtual machine. Here comes another sample that creates new virtual machine instance using the Amazon Java SDK. Read more...
I looked at Amazon Web Services SDK a while back and started to work with it recently. While searching it the Internet, I got all the results on the first two pages on Google pointing back to Amazon, which is great. After reading these documents, however, I got headaches. Why? For one thing, they are pretty long and sometimes run over different Web pages. Do you want to read for an hour to get your first program running? Or you are like me who would like to get my first program like Hello World to run in 5 minutes or even shorter. We should then read more if we don’t understand some parts. If you have gone through the Amazon documents, you’d know it’s impossible. Read more...
In my recent consulting projects, I used Python on various projects including the VMware pyVmomi () for managing vSphere. Because XML is ubiqutous these days, I had to use XML for configuration, passing information, etc. Parsing XML is a very basic part of using XML. The following sample code can achieve the same thing (print out may be different) as the C# sample that parses XML I wrote before. Read more...
If you implement REST Web Services, you want to secure them. The simplest approach is to use the basic authentication () with user name and password. To protect all the resources behind the REST APIs, you can simply implement filter as introduced in Java Servlet 2.3 (). Read more...
Yesterday I posted an article introducing the virtual appliance Timo created last week. I am sure some of you have given it a try. I hope you liked it. If you haven’t done so, you can download it from Timo’s post.
The virtual appliance ships with only two samples. Definitely not enough. That is why the community needs to work together so that we can match the functionalities of vSphere PowerCLI.
The following are two samples by David Rousseau who is an independent consultant living in Paris. Thanks for his permission to publish his code here. He owns the copyright of the code. If you want to use it, you can contact him or leave a message in this post.
- jython_rest.py: This code shows how to use the tiny Client REST API I created. Check out this article for more details of the API itself.
- jython_test.py: list all the hosts, resource pools, virtual machines and vApps that are found at the server.
To help you understand the code, I added a little comment before each file. Read more...