From 1a7927aef5eb53600d443b0676f783a9e595f4d3 Mon Sep 17 00:00:00 2001 From: Tachikoma Date: Tue, 28 Oct 2014 13:09:31 +0800 Subject: [PATCH 1/4] add property collector.CreatePropertyCollector --- propertycollector.go | 11 +++++++++++ soap.go | 2 ++ 2 files changed, 13 insertions(+) diff --git a/propertycollector.go b/propertycollector.go index fffd29b..ee05746 100644 --- a/propertycollector.go +++ b/propertycollector.go @@ -93,3 +93,14 @@ type MissingProperty struct { // Fault LocalizedMethodFault `xml:"fault"` // TODO(igm) Path string `xml:"path"` } + +// http://pubs.vmware.com/vsphere-55/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvmodl.query.PropertyCollector.html +type CreatePropertyCollector struct { + XMLName xml.Name `xml:"urn:vim25 CreatePropertyCollector"` + This *PropertyCollector `xml:"_this"` +} + +type CreatePropertyCollectorResponse struct { + XMLName xml.Name `xml:"urn:vim25 CreatePropertyCollectorResponse"` + PropertyCollector *PropertyCollector `xml:"returnval"` +} diff --git a/soap.go b/soap.go index 99dc9cf..319367d 100644 --- a/soap.go +++ b/soap.go @@ -60,6 +60,8 @@ type Body struct { ContinueRetrievePropertiesExRequest *ContinueRetrievePropertiesEx ContinueRetrievePropertiesExResponse *ContinueRetrievePropertiesExResponse CancelRetrievePropertiesExRequest *CancelRetrievePropertiesEx + CreatePropertyCollectorRequest *CreatePropertyCollector + CreatePropertyCollectorResponse *CreatePropertyCollectorResponse // VirtualMachine PowerOnVM_Task *PowerOnVM_Task From c99163784e077d537eaf5d78cda17f0506ac5902 Mon Sep 17 00:00:00 2001 From: Tachikoma Date: Tue, 28 Oct 2014 13:13:17 +0800 Subject: [PATCH 2/4] add propertycollector.DestroyPropertyCollectorRequest --- propertycollector.go | 10 ++++++++++ soap.go | 2 ++ 2 files changed, 12 insertions(+) diff --git a/propertycollector.go b/propertycollector.go index ee05746..e7977c9 100644 --- a/propertycollector.go +++ b/propertycollector.go @@ -104,3 +104,13 @@ type CreatePropertyCollectorResponse struct { XMLName xml.Name `xml:"urn:vim25 CreatePropertyCollectorResponse"` PropertyCollector *PropertyCollector `xml:"returnval"` } + +// http://pubs.vmware.com/vsphere-55/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvmodl.query.PropertyCollector.html +type DestroyPropertyCollector struct { + XMLName xml.Name `xml:"urn:vim25 DestroyPropertyCollector"` + This *PropertyCollector `xml:"_this"` +} + +type DestroyPropertyCollectorResponse struct { + XMLName xml.Name `xml:"urn:vim25 DestroyPropertyCollectorResponse"` +} diff --git a/soap.go b/soap.go index 319367d..097e2ef 100644 --- a/soap.go +++ b/soap.go @@ -62,6 +62,8 @@ type Body struct { CancelRetrievePropertiesExRequest *CancelRetrievePropertiesEx CreatePropertyCollectorRequest *CreatePropertyCollector CreatePropertyCollectorResponse *CreatePropertyCollectorResponse + DestroyPropertyCollectorRequest *DestroyPropertyCollector + DestroyPropertyCollectorResponse *DestroyPropertyCollectorResponse // VirtualMachine PowerOnVM_Task *PowerOnVM_Task From c4e090b009f95cc2df4c6e5b1b820bb79e2b8744 Mon Sep 17 00:00:00 2001 From: Tachikoma Date: Tue, 28 Oct 2014 13:14:54 +0800 Subject: [PATCH 3/4] add sessionmanager.Logout --- sessionmanager.go | 8 ++++++++ soap.go | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sessionmanager.go b/sessionmanager.go index 842cb5b..0911033 100644 --- a/sessionmanager.go +++ b/sessionmanager.go @@ -16,6 +16,14 @@ type LoginResponse struct { UserSession UserSession `xml:"urn:vim25 returnval"` } +type Logout struct { + XMLName xml.Name `xml:"urn:vim25 Logout"` + This *SessionManager `xml:"_this"` +} + +type LogoutResponse struct { +} + type UserSession struct { Key string `xml:"key"` UserName string `xml:"userName"` diff --git a/soap.go b/soap.go index 097e2ef..766058b 100644 --- a/soap.go +++ b/soap.go @@ -47,8 +47,10 @@ type Body struct { CurrentTimeResponse *CurrentTimeResponse // SessionManager - LoginRequest *Login - LoginResponse *LoginResponse + LoginRequest *Login + LoginResponse *LoginResponse + LogoutRequest *Logout + LogoutResponse *LogoutResponse // ViewManager CreateContainerViewRequest *CreateContainerView From dae9a4a61013937c3ee152a06afcd17796066467 Mon Sep 17 00:00:00 2001 From: Tachikoma Date: Tue, 28 Oct 2014 13:28:39 +0800 Subject: [PATCH 4/4] add TraversalSpec.SelectSet --- propertycollector.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/propertycollector.go b/propertycollector.go index e7977c9..b5dbda0 100644 --- a/propertycollector.go +++ b/propertycollector.go @@ -50,10 +50,11 @@ type SelectionSpec struct { // http://pubs.vmware.com/vsphere-55/index.jsp#com.vmware.wssdk.apiref.doc/vmodl.query.PropertyCollector.TraversalSpec.html type TraversalSpec struct { SelectionSpec - XsiType string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"` - Type string `xml:"type"` - Path string `xml:"path"` - Skip bool `xml:"skip"` + XsiType string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"` + Type string `xml:"type"` + Path string `xml:"path"` + Skip bool `xml:"skip"` + SelectSet []*SelectionSpec `xml:"selectSet"` } // http://pubs.vmware.com/vsphere-55/index.jsp#com.vmware.wssdk.apiref.doc/vmodl.query.PropertyCollector.PropertySpec.html