2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* esx_vi_methods.c: client for the VMware VI API 2.5 to manage ESX hosts
|
|
|
|
*
|
2010-03-01 23:38:28 +00:00
|
|
|
* Copyright (C) 2010 Red Hat, Inc.
|
2010-02-23 00:06:58 +00:00
|
|
|
* Copyright (C) 2009-2010 Matthias Bolte <matthias.bolte@googlemail.com>
|
2009-07-23 20:21:08 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "buf.h"
|
|
|
|
#include "memory.h"
|
|
|
|
#include "logging.h"
|
|
|
|
#include "uuid.h"
|
|
|
|
#include "virterror_internal.h"
|
|
|
|
#include "esx_vi_methods.h"
|
|
|
|
#include "esx_util.h"
|
|
|
|
|
|
|
|
#define VIR_FROM_THIS VIR_FROM_ESX
|
|
|
|
|
2010-03-01 23:38:28 +00:00
|
|
|
#define ESX_VI_ERROR(code, ...) \
|
2010-01-15 22:05:26 +00:00
|
|
|
virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
|
2010-03-01 23:38:28 +00:00
|
|
|
__LINE__, __VA_ARGS__)
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
#define ESX_VI__SOAP__REQUEST_HEADER \
|
|
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" \
|
|
|
|
"<soapenv:Envelope " \
|
|
|
|
"xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" " \
|
|
|
|
"xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" " \
|
|
|
|
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " \
|
|
|
|
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" \
|
|
|
|
"<soapenv:Body>"
|
|
|
|
|
|
|
|
#define ESX_VI__SOAP__REQUEST_FOOTER \
|
|
|
|
"</soapenv:Body>" \
|
|
|
|
"</soapenv:Envelope>"
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
#define ESX_VI__METHOD(_name, _parameters, _occurrence, _prolog, _validate, \
|
|
|
|
_serialize, _deserialize) \
|
|
|
|
int \
|
|
|
|
esxVI_##_name _parameters \
|
|
|
|
{ \
|
|
|
|
int result = 0; \
|
|
|
|
const char* method_name = #_name; \
|
|
|
|
virBuffer buffer = VIR_BUFFER_INITIALIZER; \
|
|
|
|
char *request = NULL; \
|
|
|
|
esxVI_Response *response = NULL; \
|
|
|
|
\
|
|
|
|
_prolog \
|
|
|
|
\
|
|
|
|
_validate \
|
|
|
|
\
|
|
|
|
virBufferAddLit(&buffer, ESX_VI__SOAP__REQUEST_HEADER); \
|
|
|
|
virBufferAddLit(&buffer, "<"#_name" xmlns=\"urn:vim25\">"); \
|
|
|
|
\
|
|
|
|
_serialize \
|
|
|
|
\
|
|
|
|
virBufferAddLit(&buffer, "</"#_name">"); \
|
|
|
|
virBufferAddLit(&buffer, ESX_VI__SOAP__REQUEST_FOOTER); \
|
|
|
|
\
|
|
|
|
if (virBufferError(&buffer)) { \
|
|
|
|
virReportOOMError(); \
|
|
|
|
goto failure; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
request = virBufferContentAndReset(&buffer); \
|
|
|
|
\
|
|
|
|
if (esxVI_Context_Execute(ctx, #_name, request, &response, \
|
|
|
|
esxVI_Occurrence_##_occurrence) < 0) { \
|
|
|
|
goto failure; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
if (response->node != NULL) { \
|
|
|
|
_deserialize \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
cleanup: \
|
|
|
|
VIR_FREE(request); \
|
|
|
|
esxVI_Response_Free(&response); \
|
|
|
|
\
|
|
|
|
return result; \
|
|
|
|
\
|
|
|
|
failure: \
|
|
|
|
virBufferFreeAndReset(&buffer); \
|
|
|
|
\
|
|
|
|
result = -1; \
|
|
|
|
\
|
|
|
|
goto cleanup; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ESX_VI__METHOD__CHECK_SERVICE() \
|
|
|
|
if (ctx->service == NULL) { \
|
|
|
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid call"); \
|
|
|
|
return -1; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(_name) \
|
|
|
|
if (_name == NULL || *_name != NULL) { \
|
|
|
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
|
|
|
|
return -1; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A required parameter must be != 0 (NULL for pointers, "undefined" == 0 for
|
|
|
|
* enumeration values).
|
|
|
|
*
|
|
|
|
* To be used as part of ESX_VI__METHOD.
|
|
|
|
*/
|
|
|
|
#define ESX_VI__METHOD__PARAMETER__REQUIRE(_name) \
|
|
|
|
if (_name == 0) { \
|
|
|
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
|
|
|
"Required parameter '%s' is missing for call to %s", \
|
|
|
|
#_name, method_name); \
|
|
|
|
return -1; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(_name) \
|
|
|
|
if (_name == 0) { \
|
|
|
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
|
|
|
"Required parameter '_this' is missing for call to %s", \
|
|
|
|
method_name); \
|
|
|
|
return -1; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ESX_VI__METHOD__PARAMETER__SERIALIZE(_type, _name) \
|
|
|
|
if (esxVI_##_type##_Serialize(_name, #_name, &buffer) < 0) { \
|
|
|
|
goto failure; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ESX_VI__METHOD__PARAMETER__SERIALIZE_LIST(_type, _name) \
|
|
|
|
if (esxVI_##_type##_SerializeList(_name, #_name, &buffer) < 0) { \
|
|
|
|
goto failure; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ESX_VI__METHOD__PARAMETER__SERIALIZE_VALUE(_type, _name) \
|
|
|
|
if (esxVI_##_type##_SerializeValue(_name, #_name, &buffer) < 0) { \
|
|
|
|
goto failure; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(_type, _name) \
|
|
|
|
if (esxVI_##_type##_Serialize(_name, "_this", &buffer) < 0) { \
|
|
|
|
goto failure; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-23 20:21:08 +00:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
* VI Methods
|
|
|
|
*/
|
|
|
|
|
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVI_RetrieveServiceContent(esxVI_Context *ctx,
|
2009-07-23 20:21:08 +00:00
|
|
|
esxVI_ServiceContent **serviceContent)
|
|
|
|
{
|
|
|
|
int result = 0;
|
2009-09-04 16:24:25 +00:00
|
|
|
const char *request = ESX_VI__SOAP__REQUEST_HEADER
|
|
|
|
"<RetrieveServiceContent xmlns=\"urn:vim25\">"
|
|
|
|
"<_this xmlns=\"urn:vim25\" "
|
|
|
|
"xsi:type=\"ManagedObjectReference\" "
|
|
|
|
"type=\"ServiceInstance\">"
|
|
|
|
"ServiceInstance"
|
|
|
|
"</_this>"
|
|
|
|
"</RetrieveServiceContent>"
|
|
|
|
ESX_VI__SOAP__REQUEST_FOOTER;
|
|
|
|
esxVI_Response *response = NULL;
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
if (serviceContent == NULL || *serviceContent != NULL) {
|
2010-01-15 22:05:26 +00:00
|
|
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
2009-07-23 20:21:08 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2010-01-15 22:05:26 +00:00
|
|
|
if (esxVI_Context_Execute(ctx, "RetrieveServiceContent", request,
|
2009-11-22 20:32:23 +00:00
|
|
|
&response, esxVI_Occurrence_RequiredItem) < 0 ||
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVI_ServiceContent_Deserialize(response->node, serviceContent) < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
|
|
|
|
|
|
|
cleanup:
|
2009-09-04 16:24:25 +00:00
|
|
|
esxVI_Response_Free(&response);
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
failure:
|
|
|
|
result = -1;
|
|
|
|
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_Login */
|
|
|
|
ESX_VI__METHOD(Login,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
const char *userName, const char *password,
|
|
|
|
esxVI_UserSession **userSession),
|
|
|
|
RequiredItem,
|
2009-07-23 20:21:08 +00:00
|
|
|
{
|
2010-02-23 00:06:58 +00:00
|
|
|
ESX_VI__METHOD__CHECK_SERVICE()
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(userSession)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(ctx->service->sessionManager)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(userName)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(password)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
ctx->service->sessionManager)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_VALUE(String, userName)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_VALUE(String, password)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_UserSession_Deserialize(response->node, userSession) < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_Logout */
|
|
|
|
ESX_VI__METHOD(Logout, (esxVI_Context *ctx), None,
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__CHECK_SERVICE()
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(ctx->service->sessionManager)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
ctx->service->sessionManager)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_SessionIsActive */
|
|
|
|
ESX_VI__METHOD(SessionIsActive,
|
|
|
|
(esxVI_Context *ctx, const char *sessionID,
|
|
|
|
const char *userName, esxVI_Boolean *active),
|
|
|
|
RequiredItem,
|
2009-07-23 20:21:08 +00:00
|
|
|
{
|
2010-02-23 00:06:58 +00:00
|
|
|
ESX_VI__METHOD__CHECK_SERVICE()
|
2009-07-23 20:21:08 +00:00
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
if (active == NULL) {
|
|
|
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
2009-07-23 20:21:08 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(ctx->service->sessionManager)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(sessionID)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(userName)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
ctx->service->sessionManager)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_VALUE(String, sessionID)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_VALUE(String, userName)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_Boolean_Deserialize(response->node, active) < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|
|
|
|
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_RetrieveProperties */
|
|
|
|
ESX_VI__METHOD(RetrieveProperties,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_PropertyFilterSpec *specSet, /* list */
|
|
|
|
esxVI_ObjectContent **objectContentList),
|
|
|
|
List,
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__CHECK_SERVICE()
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(objectContentList)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(ctx->service->propertyCollector)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(specSet)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
ctx->service->propertyCollector)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_LIST(PropertyFilterSpec, specSet)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_ObjectContent_DeserializeList(response->node,
|
|
|
|
objectContentList) < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|
|
|
|
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_PowerOnVM_Task */
|
|
|
|
ESX_VI__METHOD(PowerOnVM_Task,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *virtualMachine,
|
|
|
|
esxVI_ManagedObjectReference **task),
|
|
|
|
RequiredItem,
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(task)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(virtualMachine)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
virtualMachine)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_ManagedObjectReference_Deserialize(response->node, task,
|
|
|
|
"Task") < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_PowerOffVM_Task */
|
|
|
|
ESX_VI__METHOD(PowerOffVM_Task,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *virtualMachine,
|
|
|
|
esxVI_ManagedObjectReference **task),
|
|
|
|
RequiredItem,
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(task)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(virtualMachine)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
virtualMachine)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_ManagedObjectReference_Deserialize(response->node, task,
|
|
|
|
"Task") < 0) {
|
|
|
|
goto failure;
|
|
|
|
}
|
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_SuspendVM_Task */
|
|
|
|
ESX_VI__METHOD(SuspendVM_Task,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *virtualMachine,
|
|
|
|
esxVI_ManagedObjectReference **task),
|
|
|
|
RequiredItem,
|
2009-07-23 20:21:08 +00:00
|
|
|
{
|
2010-02-23 00:06:58 +00:00
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(task)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(virtualMachine)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
virtualMachine)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_ManagedObjectReference_Deserialize(response->node, task,
|
|
|
|
"Task") < 0) {
|
|
|
|
goto failure;
|
2009-07-23 20:21:08 +00:00
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_MigrateVM_Task */
|
|
|
|
ESX_VI__METHOD(MigrateVM_Task,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *virtualMachine,
|
|
|
|
esxVI_ManagedObjectReference *pool,
|
|
|
|
esxVI_ManagedObjectReference *host,
|
|
|
|
esxVI_VirtualMachineMovePriority priority,
|
|
|
|
esxVI_VirtualMachinePowerState state,
|
|
|
|
esxVI_ManagedObjectReference **task),
|
|
|
|
RequiredItem,
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(task)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(virtualMachine)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(priority)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
virtualMachine)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(ManagedObjectReference, pool)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(ManagedObjectReference, host)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(VirtualMachineMovePriority, priority)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(VirtualMachinePowerState, state)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_ManagedObjectReference_Deserialize(response->node, task,
|
|
|
|
"Task") < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
|
|
|
|
/* esxVI_ReconfigVM_Task */
|
|
|
|
ESX_VI__METHOD(ReconfigVM_Task,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *virtualMachine,
|
|
|
|
esxVI_VirtualMachineConfigSpec *spec,
|
|
|
|
esxVI_ManagedObjectReference **task),
|
|
|
|
RequiredItem,
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(task)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(virtualMachine)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(spec)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
virtualMachine)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(VirtualMachineConfigSpec, spec)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_ManagedObjectReference_Deserialize(response->node, task,
|
|
|
|
"Task") < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|
|
|
|
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_RegisterVM_Task */
|
|
|
|
ESX_VI__METHOD(RegisterVM_Task,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *folder,
|
|
|
|
const char *path, const char *name,
|
|
|
|
esxVI_Boolean asTemplate,
|
|
|
|
esxVI_ManagedObjectReference *pool,
|
|
|
|
esxVI_ManagedObjectReference *host,
|
|
|
|
esxVI_ManagedObjectReference **task),
|
|
|
|
RequiredItem,
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(task)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(folder)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(path)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference, folder)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_VALUE(String, path)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_VALUE(String, name)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(Boolean, asTemplate)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(ManagedObjectReference, pool)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(ManagedObjectReference, host)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_ManagedObjectReference_Deserialize(response->node, task,
|
|
|
|
"Task") < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_CancelTask */
|
|
|
|
ESX_VI__METHOD(CancelTask,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *task),
|
|
|
|
None,
|
|
|
|
{
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(task)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference, task)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_UnregisterVM */
|
|
|
|
ESX_VI__METHOD(UnregisterVM,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *virtualMachine),
|
|
|
|
None,
|
2009-07-23 20:21:08 +00:00
|
|
|
{
|
2010-02-23 00:06:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(virtualMachine)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
virtualMachine)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_AnswerVM */
|
|
|
|
ESX_VI__METHOD(AnswerVM,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *virtualMachine,
|
|
|
|
const char *questionId,
|
|
|
|
const char *answerChoice),
|
|
|
|
None,
|
|
|
|
{
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(virtualMachine)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(questionId)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(answerChoice)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
virtualMachine)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_VALUE(String, questionId)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_VALUE(String, answerChoice)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_CreateFilter */
|
|
|
|
ESX_VI__METHOD(CreateFilter,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_PropertyFilterSpec *spec,
|
|
|
|
esxVI_Boolean partialUpdates,
|
|
|
|
esxVI_ManagedObjectReference **propertyFilter),
|
|
|
|
RequiredItem,
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__CHECK_SERVICE()
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(propertyFilter)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(ctx->service->propertyCollector)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(spec)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(partialUpdates)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
ctx->service->propertyCollector)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(PropertyFilterSpec, spec)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(Boolean, partialUpdates)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_ManagedObjectReference_Deserialize(response->node, propertyFilter,
|
|
|
|
"PropertyFilter") < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_DestroyPropertyFilter */
|
|
|
|
ESX_VI__METHOD(DestroyPropertyFilter,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *propertyFilter),
|
|
|
|
None,
|
|
|
|
{
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(propertyFilter)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
propertyFilter)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_WaitForUpdates */
|
|
|
|
ESX_VI__METHOD(WaitForUpdates,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
const char *version,
|
|
|
|
esxVI_UpdateSet **updateSet),
|
|
|
|
RequiredItem,
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__CHECK_SERVICE()
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(updateSet)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(ctx->service->propertyCollector)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(version)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
ctx->service->propertyCollector)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_VALUE(String, version)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_UpdateSet_Deserialize(response->node, updateSet) < 0) {
|
|
|
|
goto failure;
|
|
|
|
}
|
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_RebootGuest */
|
|
|
|
ESX_VI__METHOD(RebootGuest,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *virtualMachine),
|
|
|
|
None,
|
2009-07-23 20:21:08 +00:00
|
|
|
{
|
2010-02-23 00:06:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(virtualMachine)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
virtualMachine)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_ShutdownGuest */
|
|
|
|
ESX_VI__METHOD(ShutdownGuest,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *virtualMachine),
|
|
|
|
None,
|
2009-07-23 20:21:08 +00:00
|
|
|
{
|
2010-02-23 00:06:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(virtualMachine)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
virtualMachine)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_ValidateMigration */
|
|
|
|
ESX_VI__METHOD(ValidateMigration,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *vm, /* list */
|
|
|
|
esxVI_VirtualMachinePowerState state,
|
|
|
|
esxVI_String *testType, /* list */
|
|
|
|
esxVI_ManagedObjectReference *pool,
|
|
|
|
esxVI_ManagedObjectReference *host,
|
|
|
|
esxVI_Event **eventList),
|
|
|
|
List,
|
2009-07-23 20:21:08 +00:00
|
|
|
{
|
2010-02-23 00:06:58 +00:00
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(eventList)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(vm)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
virBufferAddLit(&buffer, "<_this xmlns=\"urn:vim25\" "
|
|
|
|
"xsi:type=\"ManagedObjectReference\" "
|
|
|
|
"type=\"ServiceInstance\">"
|
|
|
|
"ServiceInstance"
|
|
|
|
"</_this>");
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_LIST(ManagedObjectReference, vm)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(VirtualMachinePowerState, state)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_LIST(String, testType)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(ManagedObjectReference, pool)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(ManagedObjectReference, host)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_Event_DeserializeList(response->node, eventList) < 0) {
|
|
|
|
goto failure;
|
|
|
|
}
|
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_FindByIp */
|
|
|
|
ESX_VI__METHOD(FindByIp,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *datacenter,
|
|
|
|
const char *ip,
|
|
|
|
esxVI_Boolean vmSearch,
|
|
|
|
esxVI_ManagedObjectReference **managedObjectReference),
|
|
|
|
OptionalItem,
|
2009-07-23 20:21:08 +00:00
|
|
|
{
|
2010-02-23 00:06:58 +00:00
|
|
|
ESX_VI__METHOD__CHECK_SERVICE()
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(managedObjectReference)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(ctx->service->searchIndex)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(ip)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(vmSearch)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
ctx->service->searchIndex)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(ManagedObjectReference, datacenter)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_VALUE(String, ip)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(Boolean, vmSearch)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_ManagedObjectReference_Deserialize
|
|
|
|
(response->node, managedObjectReference,
|
|
|
|
vmSearch == esxVI_Boolean_True ? "VirtualMachine"
|
|
|
|
: "HostSystem") < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|
|
|
|
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_FindByUuid */
|
|
|
|
ESX_VI__METHOD(FindByUuid,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *datacenter,
|
|
|
|
const char *uuid, /* string */
|
|
|
|
esxVI_Boolean vmSearch,
|
|
|
|
esxVI_ManagedObjectReference **managedObjectReference),
|
|
|
|
OptionalItem,
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__CHECK_SERVICE()
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(managedObjectReference)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(ctx->service->searchIndex)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(uuid)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(vmSearch)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
ctx->service->searchIndex)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(ManagedObjectReference, datacenter)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_VALUE(String, uuid)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(Boolean, vmSearch)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_ManagedObjectReference_Deserialize
|
|
|
|
(response->node, managedObjectReference,
|
|
|
|
vmSearch == esxVI_Boolean_True ? "VirtualMachine"
|
|
|
|
: "HostSystem") < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
|
|
|
|
/* esxVI_QueryAvailablePerfMetric */
|
|
|
|
ESX_VI__METHOD(QueryAvailablePerfMetric,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_ManagedObjectReference *entity,
|
|
|
|
esxVI_DateTime *beginTime,
|
|
|
|
esxVI_DateTime *endTime,
|
|
|
|
esxVI_Int *intervalId,
|
|
|
|
esxVI_PerfMetricId **perfMetricIdList),
|
|
|
|
List,
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__CHECK_SERVICE()
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(perfMetricIdList)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(ctx->service->perfManager)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(entity)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
ctx->service->perfManager)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(ManagedObjectReference, entity)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(DateTime, beginTime)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(DateTime, endTime)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE(Int, intervalId)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_PerfMetricId_DeserializeList(response->node,
|
|
|
|
perfMetricIdList) < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_QueryPerfCounter */
|
|
|
|
ESX_VI__METHOD(QueryPerfCounter,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_Int *counterId, /* list */
|
|
|
|
esxVI_PerfCounterInfo **perfCounterInfoList),
|
|
|
|
List,
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__CHECK_SERVICE()
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(perfCounterInfoList)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(ctx->service->perfManager)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(counterId)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
ctx->service->perfManager)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_LIST(Int, counterId)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
if (esxVI_PerfCounterInfo_DeserializeList(response->node,
|
|
|
|
perfCounterInfoList) < 0) {
|
|
|
|
goto failure;
|
|
|
|
}
|
|
|
|
})
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-23 00:06:58 +00:00
|
|
|
/* esxVI_QueryPerf */
|
|
|
|
ESX_VI__METHOD(QueryPerf,
|
|
|
|
(esxVI_Context *ctx,
|
|
|
|
esxVI_PerfQuerySpec *querySpec, /* list */
|
|
|
|
esxVI_PerfEntityMetric **perfEntityMetricList),
|
|
|
|
List,
|
2009-07-23 20:21:08 +00:00
|
|
|
{
|
2010-02-23 00:06:58 +00:00
|
|
|
ESX_VI__METHOD__CHECK_SERVICE()
|
|
|
|
ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(perfEntityMetricList)
|
|
|
|
},
|
2009-07-23 20:21:08 +00:00
|
|
|
{
|
2010-02-23 00:06:58 +00:00
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE_THIS(ctx->service->perfManager)
|
|
|
|
ESX_VI__METHOD__PARAMETER__REQUIRE(querySpec)
|
|
|
|
},
|
2009-07-23 20:21:08 +00:00
|
|
|
{
|
2010-02-23 00:06:58 +00:00
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_THIS(ManagedObjectReference,
|
|
|
|
ctx->service->perfManager)
|
|
|
|
ESX_VI__METHOD__PARAMETER__SERIALIZE_LIST(PerfQuerySpec, querySpec)
|
|
|
|
},
|
2009-07-23 20:21:08 +00:00
|
|
|
{
|
2010-02-23 00:06:58 +00:00
|
|
|
if (esxVI_PerfEntityMetric_DeserializeList(response->node,
|
2009-09-04 16:08:52 +00:00
|
|
|
perfEntityMetricList) < 0) {
|
2009-07-23 20:21:08 +00:00
|
|
|
goto failure;
|
|
|
|
}
|
2010-02-23 00:06:58 +00:00
|
|
|
})
|