private void ProcessRecordProperties(string bond)
        {
            RunApiCall(() =>
            {
                var dict = XenAPI.Bond.get_properties(session, bond);

                Hashtable ht = CommonCmdletFunctions.ConvertDictionaryToHashtable(dict);
                WriteObject(ht, true);
            });
        }
        private void ProcessRecordOtherConfig(string secret)
        {
            RunApiCall(() =>
            {
                var dict = XenAPI.Secret.get_other_config(session, secret);

                Hashtable ht = CommonCmdletFunctions.ConvertDictionaryToHashtable(dict);
                WriteObject(ht, true);
            });
        }
        private void ProcessRecordPowerOnConfig(string host)
        {
            RunApiCall(() =>
            {
                var dict = XenAPI.Host.get_power_on_config(session, host);

                Hashtable ht = CommonCmdletFunctions.ConvertDictionaryToHashtable(dict);
                WriteObject(ht, true);
            });
        }
        private void ProcessRecordChipsetInfo(string host)
        {
            RunApiCall(() =>
            {
                var dict = XenAPI.Host.get_chipset_info(session, host);

                Hashtable ht = CommonCmdletFunctions.ConvertDictionaryToHashtable(dict);
                WriteObject(ht, true);
            });
        }
        private void ProcessRecordLicenseServer(string host)
        {
            RunApiCall(() =>
            {
                var dict = XenAPI.Host.get_license_server(session, host);

                Hashtable ht = CommonCmdletFunctions.ConvertDictionaryToHashtable(dict);
                WriteObject(ht, true);
            });
        }
        private void ProcessRecordExternalAuthConfiguration(string host)
        {
            RunApiCall(() =>
            {
                var dict = XenAPI.Host.get_external_auth_configuration(session, host);

                Hashtable ht = CommonCmdletFunctions.ConvertDictionaryToHashtable(dict);
                WriteObject(ht, true);
            });
        }
        private void ProcessRecordSoftwareVersion(string host)
        {
            RunApiCall(() =>
            {
                var dict = XenAPI.Host.get_software_version(session, host);

                Hashtable ht = CommonCmdletFunctions.ConvertDictionaryToHashtable(dict);
                WriteObject(ht, true);
            });
        }
        private void ProcessRecordAPIVersionVendorImplementation(string host)
        {
            RunApiCall(() =>
            {
                var dict = XenAPI.Host.get_API_version_vendor_implementation(session, host);

                Hashtable ht = CommonCmdletFunctions.ConvertDictionaryToHashtable(dict);
                WriteObject(ht, true);
            });
        }
        private void ProcessRecordGuestVCPUsParams(string host)
        {
            RunApiCall(() =>
            {
                var dict = XenAPI.Host.get_guest_VCPUs_params(session, host);

                Hashtable ht = CommonCmdletFunctions.ConvertDictionaryToHashtable(dict);
                WriteObject(ht, true);
            });
        }
예제 #10
0
        protected override void ProcessRecord()
        {
            GetSession();
            if (Record != null)
            {
                NameLabel       = Record.name_label;
                NameDescription = Record.name_description;
                PhysicalSize    = Record.physical_size;
                Type            = Record.type;
                ContentType     = Record.content_type;
                Shared          = Record.shared;
                SmConfig        = CommonCmdletFunctions.ConvertDictionaryToHashtable(Record.sm_config);
            }
            else if (HashTable != null)
            {
                NameLabel       = Marshalling.ParseString(HashTable, "name_label");
                NameDescription = Marshalling.ParseString(HashTable, "name_description");
                PhysicalSize    = Marshalling.ParseLong(HashTable, "physical_size");
                Type            = Marshalling.ParseString(HashTable, "type");
                ContentType     = Marshalling.ParseString(HashTable, "content_type");
                Shared          = Marshalling.ParseBool(HashTable, "shared");
                SmConfig        = (Marshalling.ParseHashTable(HashTable, "sm_config"));
            }
            if (!ShouldProcess(session.Url, "SR.create"))
            {
                return;
            }

            RunApiCall(() =>
            {
                var contxt = _context as XenServerCmdletDynamicParameters;

                if (contxt != null && contxt.Async)
                {
                    taskRef = XenAPI.SR.async_create(session, XenHost, CommonCmdletFunctions.ConvertHashTableToDictionary <string, string>(DeviceConfig), PhysicalSize, NameLabel, NameDescription, Type, ContentType, Shared, CommonCmdletFunctions.ConvertHashTableToDictionary <string, string>(SmConfig));

                    if (PassThru)
                    {
                        XenAPI.Task taskObj = null;
                        if (taskRef != "OpaqueRef:NULL")
                        {
                            taskObj            = XenAPI.Task.get_record(session, taskRef.opaque_ref);
                            taskObj.opaque_ref = taskRef.opaque_ref;
                        }

                        WriteObject(taskObj, true);
                    }
                }
                else
                {
                    string objRef = XenAPI.SR.create(session, XenHost, CommonCmdletFunctions.ConvertHashTableToDictionary <string, string>(DeviceConfig), PhysicalSize, NameLabel, NameDescription, Type, ContentType, Shared, CommonCmdletFunctions.ConvertHashTableToDictionary <string, string>(SmConfig));

                    if (PassThru)
                    {
                        XenAPI.SR obj = null;

                        if (objRef != "OpaqueRef:NULL")
                        {
                            obj            = XenAPI.SR.get_record(session, objRef);
                            obj.opaque_ref = objRef;
                        }

                        WriteObject(obj, true);
                    }
                }
            });

            UpdateSessions();
        }
예제 #11
0
        protected override void ProcessRecord()
        {
            GetSession();
            if (Record != null)
            {
                VM          = Record.VM;
                USBGroup    = Record.USB_group;
                OtherConfig = CommonCmdletFunctions.ConvertDictionaryToHashtable(Record.other_config);
            }
            else if (HashTable != null)
            {
                VM          = Marshalling.ParseRef <VM>(HashTable, "VM");
                USBGroup    = Marshalling.ParseRef <USB_group>(HashTable, "USB_group");
                OtherConfig = (Marshalling.ParseHashTable(HashTable, "other_config"));
            }
            if (!ShouldProcess(session.Url, "VUSB.create"))
            {
                return;
            }

            RunApiCall(() =>
            {
                var contxt = _context as XenServerCmdletDynamicParameters;

                if (contxt != null && contxt.Async)
                {
                    taskRef = XenAPI.VUSB.async_create(session, VM, USBGroup, CommonCmdletFunctions.ConvertHashTableToDictionary <string, string>(OtherConfig));

                    if (PassThru)
                    {
                        XenAPI.Task taskObj = null;
                        if (taskRef != "OpaqueRef:NULL")
                        {
                            taskObj            = XenAPI.Task.get_record(session, taskRef.opaque_ref);
                            taskObj.opaque_ref = taskRef.opaque_ref;
                        }

                        WriteObject(taskObj, true);
                    }
                }
                else
                {
                    string objRef = XenAPI.VUSB.create(session, VM, USBGroup, CommonCmdletFunctions.ConvertHashTableToDictionary <string, string>(OtherConfig));

                    if (PassThru)
                    {
                        XenAPI.VUSB obj = null;

                        if (objRef != "OpaqueRef:NULL")
                        {
                            obj            = XenAPI.VUSB.get_record(session, objRef);
                            obj.opaque_ref = objRef;
                        }

                        WriteObject(obj, true);
                    }
                }
            });

            UpdateSessions();
        }
        protected override void ProcessRecord()
        {
            GetSession();
            if (Record != null)
            {
                NameLabel       = Record.name_label;
                NameDescription = Record.name_description;
                OtherConfig     = CommonCmdletFunctions.ConvertDictionaryToHashtable(Record.other_config);
            }
            else if (HashTable != null)
            {
                NameLabel       = Marshalling.ParseString(HashTable, "name_label");
                NameDescription = Marshalling.ParseString(HashTable, "name_description");
                OtherConfig     = (Marshalling.ParseHashTable(HashTable, "other_config"));
            }
            if (!ShouldProcess(session.Url, "GPU_group.create"))
            {
                return;
            }

            RunApiCall(() =>
            {
                var contxt = _context as XenServerCmdletDynamicParameters;

                if (contxt != null && contxt.Async)
                {
                    taskRef = XenAPI.GPU_group.async_create(session, NameLabel, NameDescription, CommonCmdletFunctions.ConvertHashTableToDictionary <string, string>(OtherConfig));

                    if (PassThru)
                    {
                        XenAPI.Task taskObj = null;
                        if (taskRef != "OpaqueRef:NULL")
                        {
                            taskObj            = XenAPI.Task.get_record(session, taskRef.opaque_ref);
                            taskObj.opaque_ref = taskRef.opaque_ref;
                        }

                        WriteObject(taskObj, true);
                    }
                }
                else
                {
                    string objRef = XenAPI.GPU_group.create(session, NameLabel, NameDescription, CommonCmdletFunctions.ConvertHashTableToDictionary <string, string>(OtherConfig));

                    if (PassThru)
                    {
                        XenAPI.GPU_group obj = null;

                        if (objRef != "OpaqueRef:NULL")
                        {
                            obj            = XenAPI.GPU_group.get_record(session, objRef);
                            obj.opaque_ref = objRef;
                        }

                        WriteObject(obj, true);
                    }
                }
            });

            UpdateSessions();
        }