Ejemplo n.º 1
0
 public void UpdateVAppConfig(VAppConfigSpec spec)
 {
     try
     {
         VersionUtils.RequiresVersion(this.Client, VimVersion.Vim4);
         UpdateVAppConfigRequestType updateVAppConfigRequestType = new UpdateVAppConfigRequestType();
         updateVAppConfigRequestType._this = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
         updateVAppConfigRequestType.spec  = (VimApi_65.VAppConfigSpec)VIConvert.ToWsdlType(spec);
         this.VimServiceProxy.UpdateVAppConfig(new UpdateVAppConfigRequest(updateVAppConfigRequestType));
     }
     catch (FaultException ex)
     {
         throw FaultUtility.HandleFault(ex);
     }
 }
Ejemplo n.º 2
0
        public ManagedObjectReference CreateVApp(string name, ResourceConfigSpec resSpec, VAppConfigSpec configSpec, ManagedObjectReference vmFolder)
        {
            ManagedObjectReference result;

            try
            {
                VersionUtils.RequiresVersion(this.Client, VimVersion.Vim4);
                CreateVAppRequestType createVAppRequestType = new CreateVAppRequestType();
                createVAppRequestType._this      = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
                createVAppRequestType.name       = name;
                createVAppRequestType.resSpec    = (VimApi_65.ResourceConfigSpec)VIConvert.ToWsdlType(resSpec);
                createVAppRequestType.configSpec = (VimApi_65.VAppConfigSpec)VIConvert.ToWsdlType(configSpec);
                createVAppRequestType.vmFolder   = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(vmFolder);
                result = (ManagedObjectReference)VIConvert.ToVim(this.VimServiceProxy.CreateVApp(new CreateVAppRequest(createVAppRequestType)).CreateVAppResponse.returnval);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }