Git Product home page Git Product logo

vmwr's Introduction

A curlable API wrapper to vSphere

Wrote this a couple months back as a quick test. I wanted to see how realistic doing something like this would be as an interim solution for VM provisioning while we work out our OpenStack deployment. It turned out that basic functionality was really easy to achieve but for one reason or another the application never got deployed. Now it has been. Code

Examples

Create VM: (Debian 7 using default g1.micro flavor)

curl -X POST -H "Authorization: Basic $API_KEY" "https://vmware-vmwr1.ops.puppetlabs.net/v1/operations/deployed-test"

Create VM: (CentOS 7 using c1.large flavor)

curl -X POST -H "Accept: application/json" -d "{ \"flavor\":\"c1.large\", \"template\":\"centos-7-x86_64\" }" -H "Authorization: Basic $API_KEY" "https://vmware-vmwr1.ops.puppetlabs.net/v1/operations/deployed-test"

Destroy VM:

curl -X DELETE -H "Authorization: Basic $API_KEY" "https://vmware-vmwr1.ops.puppetlabs.net/v1/operations/deployed-test"

Reboot VM:

curl -H "Authorization: Basic $API_KEY" "https://vmware-vmwr1.ops.puppetlabs.net/v1/operations/deployed-test/reboot"

Get some info as JSON: (no key needed, uses read-only account)

curl "https://vmware-vmwr1.ops.puppetlabs.net/v1/operations/deployed-test/info

Get instance ipaddress: (no key needed, uses read-only account)

curl "https://vmware-vmwr1.ops.puppetlabs.net/v1/operations/deployed-test/info/ipAddress

API Key

$[email protected]:$PASSWORD" base64 encoded

a.k.a. basic auth, you can also use curl's -u option. I like base64ing my password because it makes them URL and shell safe

Flavors

name memory (MB) cores
g1.micro 1024 1
m1.small 2048 1
m1.medium 4096 2
m1.large 6144 4
c1.small 1024 2
c1.medium 2048 4
c1.large 4096 6

vmwr's People

Contributors

ody avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.