Git Product home page Git Product logo

vim25's Introduction

GoDoc

Deprecated in favour of https://github.com/vmware/govmomi

vim25

Experimental Go interface to the VMware vSphere API. The purpose of this project is to create a small set of funcions to provide basic operations to deploy, run and manage virtual machines inside vSphere environment.

vim25's People

Contributors

igm avatar ikarishinjieva avatar

Stargazers

 avatar Yann Hodique avatar  avatar Xiaolong avatar

Watchers

 avatar James Cloos avatar Xiaolong avatar  avatar

Forkers

ikarishinjieva

vim25's Issues

vmware ESXi 4.1 support

Hi @igm,

I tried vim25 on vmware ESXi 4.1, and got server error:

undefined TraversalSpec name

The root cause is that ESXi 4.1 cannot recognize following tags correctly:

<selectSet xmlns:XMLSchema-instance="http://www.w3.org/2001/XMLSchema-instance" XMLSchema-instance:type="TraversalSpec">

And it should be:

<selectSet xsi:type="TraversalSpec">

I tried go-lang XML tags, but failed to get it work. So I did a hack on service.go:

--- a/service.go
+++ b/service.go
@@ -45,6 +45,12 @@ func (s *Service) SoapRequest(body *Body) (*Body, error) {
    if err != nil {
        return nil, err
    }
+
+   //4.1 hacks
+   xmlEnvelope = []byte(strings.Replace(string(xmlEnvelope), "XMLSchema-instance:type", "xsi:type", -1))
+   xmlEnvelope = []byte(strings.Replace(string(xmlEnvelope), "xmlns:XMLSchema-instance=\"http://www.w3.org/2001/XMLSchema-instance\"", "", -1))
+   xmlEnvelope = []byte(strings.Replace(string(xmlEnvelope), "<Body xmlns=\"http://schemas.xmlsoap.org/soap/envelope/\">", "<Body xmlns=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">", -1))
+
    req, err := http.NewRequest("POST", s.Url, bytes.NewReader(xmlEnvelope))
    if err != nil {
        return nil, err

It works for me on ESXi 4.1 & 5.1, but I don't think it's a good practice.

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.