public AlarmManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
Ejemplo n.º 2
0
 public EventHistoryCollector(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
Ejemplo n.º 3
0
 public object WaitForTask(ManagedObjectReference taskReference)
 {
     return this._client.WaitForTask(taskReference);
 }
 public LicenseManager(VimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
Ejemplo n.º 5
0
        public List <EntityViewBase> FindEntityViews(System.Type viewType, ManagedObjectReference beginEntity, NameValueCollection filter, string[] properties)
        {
            if (viewType == (System.Type)null)
            {
                throw new ArgumentNullException("viewType");
            }
            if (this._vimService == null)
            {
                throw new InvalidOperationException(Resources.VimWebServiceNotInitialized);
            }
            if (this._serviceContent == null)
            {
                throw new InvalidOperationException(Resources.ServiceContentNotInitialized);
            }
            if (!viewType.IsSubclassOf(typeof(EntityViewBase)))
            {
                throw new InvalidOperationException(Resources.InvalidViewTypeParam);
            }
            IList <ViewBase>       viewBaseList = (IList <ViewBase>)null;
            ManagedObjectReference beginEntity1 = beginEntity ?? this._serviceContent.RootFolder;

            string[] strArray = (string[])null;
            if (filter != null && filter.Count > 0)
            {
                string[] propertyList = new string[filter.Count];
                filter.AllKeys.CopyTo((Array)propertyList, 0);
                strArray = VimClient.ValidatePropertyPathList(viewType, propertyList);
            }
            ObjectContent[] objectContentArray = new PropertyCollector((VimClient)this, this._serviceContent.PropertyCollector).RetrieveProperties(new PropertyFilterSpec[1]
            {
                EntityViewBase.GetSearchFilterSpec((VimClient)this, beginEntity1, new PropertySpec()
                {
                    All     = new bool?(false),
                    Type    = viewType.Name,
                    PathSet = strArray
                })
            });
            List <ManagedObjectReference> managedObjectReferenceList = new List <ManagedObjectReference>();

            if (objectContentArray != null)
            {
                foreach (ObjectContent objectContent in objectContentArray)
                {
                    if (beginEntity == null || !objectContent.Obj.Value.Equals(beginEntity.Value) || !objectContent.Obj.Type.Equals(beginEntity.Type))
                    {
                        if (filter != null && filter.Count > 0)
                        {
                            DynamicProperty[] propSet = objectContent.PropSet;
                            if (propSet != null)
                            {
                                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                                foreach (DynamicProperty dynamicProperty in propSet)
                                {
                                    dictionary.Add(dynamicProperty.Name, dynamicProperty.Val);
                                }
                                if (dictionary.Count > 0 && VimClient.MatchProperyList(filter, viewType, (IDictionary <string, object>)dictionary))
                                {
                                    managedObjectReferenceList.Add(objectContent.Obj);
                                }
                            }
                        }
                        else
                        {
                            managedObjectReferenceList.Add(objectContent.Obj);
                        }
                    }
                }
            }
            if (managedObjectReferenceList.Count > 0)
            {
                viewBaseList = (IList <ViewBase>) this.GetViewsByMorefs((IEnumerable <ManagedObjectReference>)managedObjectReferenceList, properties);
            }
            List <EntityViewBase> entityViewBaseList = (List <EntityViewBase>)null;

            if (viewBaseList != null)
            {
                entityViewBaseList = new List <EntityViewBase>();
                foreach (ViewBase viewBase in (IEnumerable <ViewBase>)viewBaseList)
                {
                    EntityViewBase entityViewBase = viewBase as EntityViewBase;
                    entityViewBaseList.Add(entityViewBase);
                }
            }
            return(entityViewBaseList);
        }
 public ManagedObjectReference MoveVirtualDisk_Task(string sourceName, ManagedObjectReference sourceDatacenter, string destName, ManagedObjectReference destDatacenter, bool?force)
 {
     return(this.MoveVirtualDisk_Task(sourceName, sourceDatacenter, destName, destDatacenter, force, null));
 }
 public HostAutoStartManager(VimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public SessionManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
Ejemplo n.º 9
0
 public ProfileManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
        public HostProfileManagerConfigTaskList GenerateHostProfileTaskList(HostConfigSpec configSpec, ManagedObjectReference host)
        {
            HostProfileManagerConfigTaskList result;

            try
            {
                VersionUtils.RequiresVersion(this.Client, VimVersion.Vim55);
                ManagedObjectReference taskReference = this.GenerateHostProfileTaskList_Task(configSpec, host);
                result = (HostProfileManagerConfigTaskList)this.Client.WaitForTask(taskReference);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }
Ejemplo n.º 11
0
 public HealthUpdateManager(VimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
        public ManagedObjectReference GenerateHostProfileTaskList_Task(HostConfigSpec configSpec, ManagedObjectReference host)
        {
            ManagedObjectReference result;

            try
            {
                VersionUtils.RequiresVersion(this.Client, VimVersion.Vim55);
                GenerateHostProfileTaskListRequestType generateHostProfileTaskListRequestType = new GenerateHostProfileTaskListRequestType();
                generateHostProfileTaskListRequestType._this      = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
                generateHostProfileTaskListRequestType.configSpec = (VimApi_65.HostConfigSpec)VIConvert.ToWsdlType(configSpec);
                generateHostProfileTaskListRequestType.host       = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(host);
                result = (ManagedObjectReference)VIConvert.ToVim(this.VimServiceProxy.GenerateHostProfileTaskList_Task(new GenerateHostProfileTaskList_TaskRequest(generateHostProfileTaskListRequestType)).GenerateHostProfileTaskList_TaskResponse.returnval);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }
        public ApplyProfile CreateDefaultProfile(string profileType, string profileTypeName, ManagedObjectReference profile)
        {
            ApplyProfile result;

            try
            {
                VersionUtils.RequiresVersion(this.Client, VimVersion.Vim4);
                CreateDefaultProfileRequestType createDefaultProfileRequestType = new CreateDefaultProfileRequestType();
                createDefaultProfileRequestType._this           = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
                createDefaultProfileRequestType.profileType     = profileType;
                createDefaultProfileRequestType.profileTypeName = profileTypeName;
                createDefaultProfileRequestType.profile         = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(profile);
                result = (ApplyProfile)VIConvert.ToVim(this.VimServiceProxy.CreateDefaultProfile(new CreateDefaultProfileRequest(createDefaultProfileRequestType)).CreateDefaultProfileResponse.returnval);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }
Ejemplo n.º 14
0
 public HostEsxAgentHostManager(VimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
        public string CopyVirtualDisk(string sourceName, ManagedObjectReference sourceDatacenter, string destName, ManagedObjectReference destDatacenter, VirtualDiskSpec destSpec, bool?force)
        {
            string result;

            try
            {
                ManagedObjectReference taskReference = this.CopyVirtualDisk_Task(sourceName, sourceDatacenter, destName, destDatacenter, destSpec, force);
                result = (string)this.Client.WaitForTask(taskReference);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }
Ejemplo n.º 16
0
 public FailoverClusterManager(VimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public VirtualDiskManager(VimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
Ejemplo n.º 18
0
 public ManagedEntity(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
        public ManagedObjectReference MoveVirtualDisk_Task(string sourceName, ManagedObjectReference sourceDatacenter, string destName, ManagedObjectReference destDatacenter, bool?force, VirtualMachineProfileSpec[] profile)
        {
            ManagedObjectReference result;

            try
            {
                MoveVirtualDiskRequestType moveVirtualDiskRequestType = new MoveVirtualDiskRequestType();
                moveVirtualDiskRequestType._this            = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
                moveVirtualDiskRequestType.sourceName       = sourceName;
                moveVirtualDiskRequestType.sourceDatacenter = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(sourceDatacenter);
                moveVirtualDiskRequestType.destName         = destName;
                moveVirtualDiskRequestType.destDatacenter   = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(destDatacenter);
                moveVirtualDiskRequestType.force            = force.GetValueOrDefault();
                moveVirtualDiskRequestType.forceSpecified   = force.HasValue;
                moveVirtualDiskRequestType.profile          = (VimApi_65.VirtualMachineProfileSpec[])VIConvert.ToWsdlType(profile);
                result = (ManagedObjectReference)VIConvert.ToVim(this.VimServiceProxy.MoveVirtualDisk_Task(new MoveVirtualDisk_TaskRequest(moveVirtualDiskRequestType)).MoveVirtualDisk_TaskResponse.returnval);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }
Ejemplo n.º 20
0
 public void CopyDatastoreFile(string sourceName, ManagedObjectReference sourceDatacenter, string destinationName, ManagedObjectReference destinationDatacenter, bool?force)
 {
     try
     {
         ManagedObjectReference taskReference = this.CopyDatastoreFile_Task(sourceName, sourceDatacenter, destinationName, destinationDatacenter, force);
         this.Client.WaitForTask(taskReference);
     }
     catch (FaultException ex)
     {
         throw FaultUtility.HandleFault(ex);
     }
 }
 public VmwareDistributedVirtualSwitch(VimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
Ejemplo n.º 22
0
 public Datacenter(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
Ejemplo n.º 23
0
 public View(VimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public HostDatastoreBrowser(VimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
Ejemplo n.º 25
0
 public HostKernelModuleSystem(VimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
Ejemplo n.º 26
0
 public HostCertificateManager(VimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
Ejemplo n.º 27
0
 internal static void SetViewData(ViewBase currentObject, string currentPropertyPath, Dictionary<string, List<string>> allowedPropertyPath, Dictionary<string, ObjectContent> objectContentList, Dictionary<string, ViewBase> generatedManagedObjectList)
 {
     if (currentPropertyPath == null)
         currentPropertyPath = string.Empty;
     if (!objectContentList.ContainsKey(currentObject.MoRef.Value))
         return;
     if (!generatedManagedObjectList.ContainsKey(currentObject.MoRef.Value))
         generatedManagedObjectList.Add(currentObject.MoRef.Value, currentObject);
     ObjectContent objectContent = objectContentList[currentObject.MoRef.Value];
     if (allowedPropertyPath != null)
         ViewBase.ClearViewData(currentObject, currentPropertyPath, new List<string>((IEnumerable<string>)allowedPropertyPath.Keys));
     else
         ViewBase.ClearViewData(currentObject, currentPropertyPath, (List<string>)null);
     if (objectContent.PropSet != null)
     {
         foreach (DynamicProperty prop in objectContent.PropSet)
         {
             bool flag1 = false;
             string key1 = string.Empty;
             if (allowedPropertyPath != null)
             {
                 key1 = string.Format("{0}{1}{2}", (object)currentPropertyPath, currentPropertyPath != "" ? (object)"." : (object)"", (object)prop.Name.ToLower());
                 string str = string.Format("{0}{1}{2}", (object)currentPropertyPath, currentPropertyPath != "" ? (object)"." : (object)"", (object)"*");
                 bool flag2 = false;
                 bool flag3 = false;
                 foreach (string key2 in allowedPropertyPath.Keys)
                 {
                     if (key2.StartsWith(key1))
                         flag2 = true;
                     if (key2.Equals(str) && ViReflectionCache.GetTypeProperties(currentObject.GetType()).ContainsKey(prop.Name.ToLower()))
                     {
                         flag3 = true;
                         break;
                     }
                     if (key2.Equals(key1))
                         flag3 = true;
                     if (flag2 & flag3)
                         break;
                 }
                 if (!flag3 & flag2)
                     flag1 = true;
                 if (!flag3 && !flag2)
                     continue;
             }
             string[] strArray = prop.Name.Split('.');
             Type type = currentObject.GetType();
             object currentObject1 = (object)currentObject;
             for (int index = 0; index < strArray.Length - 1; ++index)
             {
                 string name = "_" + strArray[index];
                 FieldInfo field = type.GetTypeInfo().GetField(name, BindingFlags.Instance | BindingFlags.NonPublic);
                 object obj = field.GetValue(currentObject1);
                 type = field.FieldType;
                 if (obj == null)
                 {
                     obj = type.GetConstructor(Type.EmptyTypes).Invoke((object[])null);
                     field.SetValue(currentObject1, obj);
                 }
                 currentObject1 = obj;
             }
             FieldInfo field1 = type.GetField("_" + strArray[strArray.Length - 1], BindingFlags.Instance | BindingFlags.NonPublic);
             if (!flag1)
             {
                 foreach (FieldInfo fieldInfo in ViewBase.GetAllFieldsWithName("_" + strArray[strArray.Length - 1], type))
                     fieldInfo.SetValue(currentObject1, prop.Val);
             }
             ManagedObjectReference[] moList = (ManagedObjectReference[])null;
             if (field1.FieldType == typeof(ManagedObjectReference))
                 moList = new ManagedObjectReference[1]
                 {
       (ManagedObjectReference) prop.Val
                 };
             else if (field1.FieldType == typeof(ManagedObjectReference[]))
             {
                 List<string> stringList = new List<string>();
                 if (allowedPropertyPath != null)
                 {
                     if (allowedPropertyPath.ContainsKey(key1) && allowedPropertyPath[key1] != null)
                         stringList.AddRange((IEnumerable<string>)allowedPropertyPath[key1]);
                     if (allowedPropertyPath.ContainsKey(key1 + "->") && allowedPropertyPath[key1 + "->"] != null)
                         stringList.AddRange((IEnumerable<string>)allowedPropertyPath[key1 + "->"]);
                 }
                 List<ManagedObjectReference> managedObjectReferenceList = new List<ManagedObjectReference>();
                 foreach (ManagedObjectReference managedObjectReference in (ManagedObjectReference[])prop.Val)
                 {
                     if (stringList.Count == 0 || stringList.Contains(managedObjectReference.Type))
                     {
                         managedObjectReferenceList.Add(managedObjectReference);
                     }
                     else
                     {
                         foreach (string typeName in stringList)
                         {
                             if (ViReflectionCache.GetTypeByRemoteTypeAndName(typeof(ManagedObjectReference), typeName).IsAssignableFrom(ViReflectionCache.GetTypeByRemoteTypeAndName(typeof(ManagedObjectReference), managedObjectReference.Type)))
                             {
                                 managedObjectReferenceList.Add(managedObjectReference);
                                 break;
                             }
                         }
                     }
                 }
                 moList = managedObjectReferenceList.ToArray();
             }
             if (moList != null)
             {
                 string str = string.Format("{0}{1}{2}", (object)currentPropertyPath, currentPropertyPath != "" ? (object)"." : (object)"", (object)prop.Name.ToLower());
                 if (ViewBase.IsNonTerminalPath(allowedPropertyPath, str))
                     ViewBase.SetExtView(currentObject1, field1.Name, currentObject._client, moList, objectContentList, generatedManagedObjectList, str, allowedPropertyPath);
             }
         }
     }
     else if (objectContent.MissingSet != null && objectContent.MissingSet.Length != 0)
     {
         MethodFault fault = objectContent.MissingSet[0].Fault.Fault;
         throw new VimException(objectContent.MissingSet[0].Fault.LocalizedMessage, fault);
     }
 }
        public ManagedObjectReference CopyVirtualDisk_Task(string sourceName, ManagedObjectReference sourceDatacenter, string destName, ManagedObjectReference destDatacenter, VirtualDiskSpec destSpec, bool?force)
        {
            ManagedObjectReference result;

            try
            {
                CopyVirtualDiskRequestType copyVirtualDiskRequestType = new CopyVirtualDiskRequestType();
                copyVirtualDiskRequestType._this            = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
                copyVirtualDiskRequestType.sourceName       = sourceName;
                copyVirtualDiskRequestType.sourceDatacenter = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(sourceDatacenter);
                copyVirtualDiskRequestType.destName         = destName;
                copyVirtualDiskRequestType.destDatacenter   = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(destDatacenter);
                copyVirtualDiskRequestType.destSpec         = (VimApi_65.VirtualDiskSpec)VIConvert.ToWsdlType(destSpec);
                copyVirtualDiskRequestType.force            = force.GetValueOrDefault();
                copyVirtualDiskRequestType.forceSpecified   = force.HasValue;
                result = (ManagedObjectReference)VIConvert.ToVim(this.VimServiceProxy.CopyVirtualDisk_Task(new CopyVirtualDisk_TaskRequest(copyVirtualDiskRequestType)).CopyVirtualDisk_TaskResponse.returnval);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }
Ejemplo n.º 29
0
 public GuestProcessManager(VimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public ClusterEVCManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }