예제 #1
0
            /// <summary>
            /// Lists the XenServer virtual machines.
            /// </summary>
            /// <returns>The list of virtual machines.</returns>
            /// <exception cref="XenException">Thrown if the operation failed.</exception>
            public List <XenVirtualMachine> List()
            {
                var response = client.SafeInvokeItems("vm-list", "params=all");
                var vms      = new List <XenVirtualMachine>();

                foreach (var result in response.Results)
                {
                    vms.Add(new XenVirtualMachine(result));
                }

                return(vms);
            }
예제 #2
0
            /// <summary>
            /// Lists the XenServer virtual machine templates.
            /// </summary>
            /// <returns>The list of templates.</returns>
            /// <exception cref="XenException">Thrown if the operation failed.</exception>
            public List <XenTemplate> List()
            {
                var response  = client.SafeInvokeItems("template-list", "params=all");
                var templates = new List <XenTemplate>();

                foreach (var result in response.Results)
                {
                    templates.Add(new XenTemplate(result));
                }

                return(templates);
            }