{"id":21038813,"url":"https://github.com/sircamp/xenapi","last_synced_at":"2025-10-05T07:53:21.993Z","repository":{"id":30504788,"uuid":"34059168","full_name":"sirCamp/Xenapi","owner":"sirCamp","description":"A Xen PHP API for managment of Hypervisor and Citrix Server and their Virtual Machines for Laravel","archived":false,"fork":false,"pushed_at":"2018-12-15T21:59:04.000Z","size":53,"stargazers_count":28,"open_issues_count":4,"forks_count":19,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-08-13T22:58:29.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sirCamp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-16T14:01:17.000Z","updated_at":"2025-03-31T15:00:20.000Z","dependencies_parsed_at":"2022-09-01T13:01:05.551Z","dependency_job_id":null,"html_url":"https://github.com/sirCamp/Xenapi","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sirCamp/Xenapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirCamp%2FXenapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirCamp%2FXenapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirCamp%2FXenapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirCamp%2FXenapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sirCamp","download_url":"https://codeload.github.com/sirCamp/Xenapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirCamp%2FXenapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278425497,"owners_count":25984686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T13:36:32.972Z","updated_at":"2025-10-05T07:53:21.949Z","avatar_url":"https://github.com/sirCamp.png","language":"PHP","readme":"# Xenapi for PHP\n\nA Xen PHP API for managment of Hypervisor and Citrix Server and their Virtual Machines for PHP, it works on Laravel 4, Laravel 5, Codeigniter and other PHP framework.\nBefore install this library make sure to have installed *xmlrpc php* module\n\nAPI in PHP to communicate with Xen Server . \nThis packages is available on Composer's repositories .\nThe package Allows to completely Manage an Hypervisvor Citrix .\nWith this , you can clone , start , stop and reboot any VPS of your Hypervisor\nAlso, this APi allow you toi have a realtime graph of your Hypervisor's VPS!\nI've create the Method that obtain XML realtime stats of Machine and convert it to RRD file, needed for the FlotJS library to draw the graph.\nThis API is available for all the major PHP Frameworks, such as Laravel, Symfony or Codeigniter.\n\n## Table Of Contents\n\n1. [Installation](#installation)\n2. [Documentation](#documentation)\n\t+ [Namespace Import](#namespace-import)\n\t+ [Connect With an Hypervisor](#connect-with-an-hypervisor)\n\t+ [Get Virtual Machine](#get-virtual-machine)\n\t+ [Virtual Machine Managment](#virtual-machine-managment)\n\t+ [Get Host](#get-host)\n\t+ [Host Management](#host-management)\n\t+ [Response Management](#response-management)\n\t+ [Exceptions](#exceptions)\n\n## Installation :\n\nPackage is available on [Packagist](https://packagist.org/packages/sircamp/xenapi),\nyou can install it using [Composer](http://getcomposer.org).\n\nIn the **require** key of **composer.json** file add the following:\n\n```php\n\"sircamp/xenapi\": \"2.1\"\n```\nOr type this command from your project folder\n\n```bash\ncomposer require sircamp/xenapi\n```\n\n## Documentation: \n\n#### Namespace Import\nSircamp\\Xenapi is namespaced, but you can make your life easier by importing\na single class into your context:\n\n```php\nuse Sircamp\\Xenapi\\Xen as Xen;\n```\n\n#### Connect With an Hypervisor\n\nMake sure that you have IP, User and Password of your hypervisor:\n\n```php\n$ip = \"123.123.123.123\";\n$user = \"username\";\n$password = \"password\";\n$xen = new Xen($ip,$user,$password); //OK now you have an open connection to Hypervisor\n```\n\n#### Get Virtual Machine \n\nThis serves to have a virtual machine (by the hostname) that is on selected hypervisor :\n\n```php\n$vm = $xen-\u003egetVMByNameLabel(\"virtual.machine.hostaname\");\n```\n\n\n#### Virtual Machine Management\n\nNow you have the an XenVirtualMachine object that map your virtual machine, so we are ready to manage the VM\n\n##### Start VM\n\nThis method starts a stopped VM\n\n```php\n$vm-\u003estart(); \n```\nYou can, also, pass two parameters at this method:\n```php\n$pause = true; // start VM in pause status , dafault is false\n$force = true; // force the boot of VM, default is true\n$vm-\u003estart($pause, $force); \n```\n\n##### StartOn VM\n\nThis method starts the specified VM on a particular host. This function can only be called with the VM is in the Halted State.\n*This method needs an XenHost object as parameter, but if you want you can pass a UUID host string*\n\n```php\n$host // this is a XenHost object istance or a string istance\n$hostRef = $host;\n$pause = true; // start VM in pause status , dafault is false\n$force = true; // force the boot of VM, default is true\n$vm-\u003estartOn($hostRef,$pause, $force); \n```\n\n##### Shutdown VM\n\nThis method sends a shutdown command to the Virtual Machine\n\n```php\n$vm-\u003ecleanShutdown(); \n```\n\n##### Hard Shutdown VM\nThis method immediatly a shutdown  the Virtual Machine\n\n```php\n$vm-\u003ehardShutdown(); \n```\n\n##### Reboot VM\nThis method sends a reboot command to the Virtual Machine\n```php\n$vm-\u003ecleanShutdown(); \n```\n\n##### Hard Reboot VM\n\nThis method immediatly restarts  the Virtual Machine\n\n```php\n$vm-\u003ehardShutdown(); \n```\n\n##### Suspend VM\n\nThis method puts Virtual Machine in a suspend mode (read the Citrix manual)\n\n```php\n$vm-\u003esuspend(); \n```\n\n##### Resume VM\n\nThis method resumes a Virtual Machine that is in a suspend mode (read the Citrix manual)\n\n```php\n$vm-\u003eresume(); \n```\n##### ResumeOn VM\n\nThis method awaken the specified VM and resume it on a particular Host. This can only be called when the specified VM is in the Suspended state.\n*This method needs an XenHost object as parameter, but if you want you can pass a UUID host string*\n\n```php\n$host // this is a XenHost object istance or a string istance\n$hostRef = $host;\n$vm-\u003eresumeOn($hostRef); \n```\n\n##### Pause VM\n\nThis method puts a Virtual Machine in pause \n\n```php\n$vm-\u003epause(); \n```\n\n##### Unpause VM\n\nThis method restores a Virtual Machine that is in pause\n\n```php\n$vm-\u003eunpause(); \n```\n\n##### Clone VM\n\nThis method clones the selected Virtual Machine into another ( please check if your hypervisor supports another machine).\n\nbefore this, you must stop the virtual machine that you want clone\n\n```php\n$name = \"new_cloned_vm\"; // name of cloned vm\n$vm-\u003ecleanShudown(); // stop  vm\n$vm-\u003eclonevm($name); \n```\n\n##### Power Status of VM\n\nThis method gets the power status of the selected Virtual Machine \n\n```php\n$vm-\u003egetPowerState();\n```\n\n##### Power State Reset of VM\n\nReset the power-state of the VM to halted in the database only. (Used to recover from slave failures in pooling scenarios by resetting the power-states of VMs running on dead slaves to halted.) This  is a potentially dangerous operation; use with care.\n\n```php\n$vm-\u003epowerStateReset();\n```\n\n##### UUID of VM\n\nThis method obtains the UUID of the selected Virtual Machine.\n\n\n```php\n$vm-\u003egetUUID();\n```\n\n##### Consoles of VM\n\nThis method returns the all console instances of  selected Virtual Machine.\nThe console istance allows you to have  and manage a SSH or RDP session of Virtual Machine\n\n\n```php\n$vm-\u003egetConsoles()\n```\n##### UUID of VM Console\n\nThis method returns the UUID of selected Virtual Machine's console.\nThe UUID is very usefull for console istance mangement.\n\n```php\n$vm-\u003egetConsoleUUID($console)\n```\n\n##### Guest Metrics of VM\n\nThis method returns the guest metrics of selected Virtual Machine.\nThis metrics contains:\n\n+ uuid\n+ os_version (name, uname, distro, relase version)\n+ memory\n+ disks\n+ networks\n+ other\n\n*in the future, i will write an example*\n\n```php\n$vm-\u003egetGuestMetrics()\n```\n\n\n##### Metrics of VM\n\nThis method returns the metrics of selected Virtual Machine.\nThis metrics contains:\n\n+ uuid\n+ memory_actual\n+ VCPUs_number\n+ VCPUs_utilisation\n\n*as for guest metrics, in the future, i will write an example*\n\n```php\n$vm-\u003egetMetrics()\n```\n##### Statistics of VM \n\nThis method returns the current stats of the running selected Virtual Machine.\nWith this method, you can obtain the stats of  CPUs, RAM and DISK I/O  in ***realtime***!\n\nHowever, this method return an response object that contains a XML string in the ***value*** attribute.\nInside this XML string you find the required statistics.\n\n*as for last two methods, in the future, i will write an example. Also, i would to show you how to obtain a realtime stats graph, stay tuned ;)*\n\n```php\n$vm-\u003egetStats()\n```\n##### Disks Total Space of VM\n\nThis method returns the total amount of Virtual Machine's Disks space.\nActually this method return the total in bytes.\n\n```php\n$vm-\u003egetDiskSpace()\n```\nAlso, you can pass an argument:\n\n```php\n$format = \"GB\";\n$vm-\u003egetDiskSpace($format);\n```\nThis allow you to have the disk space in the format as you want.\n**NB: this feature is not yet implemented**\n\n##### Name of VM\nThis method returns the name of VM\n\n```php\n$vm-\u003egetName()\n```\n\n##### GetAll VMs\nThis method returns a list of all the VMs known to the system.\n\n```php\n$vm-\u003egetAll()\n```\n\n##### PoolMigrate  VM\nMigrate a VM to another Host. This can only be called when the specified VM is in the Running state.\n*This method needs an XenHost object as parameter, but if you want you can pass a UUID host string*\nThe *optionsMap* parameter is a map that contains the options for pool migrating.\n\n```php\n$optionsMap = array(\n\t'option1' =\u003e \"option first\",\n\t'option2' =\u003e \"option second\"\n)\n$host // this is a XenHost object istance or a string istance\n$hostRef = $host;\n$vm-\u003epoolMigrate($refHost, $optionsMap);\n```\n\n##### MigrateSend  VM\nAssert whether a VM can be migrated to the specified destination.\nIn this method the first parameter, *dest*, is the result of a **Host.migrate** receive call.\nThe *vdiMap* parameter is the map of source VDI to destination SR.\nThe *vifMap* parameter is the map of VIF to destination network.\nThe *optionsMap*  Extra configuration operations.\nThe *live* parameter allows to migrate the VM in *live mode* or nothing, on default this paramter is set to *false*.\n\n```php\n$dest // Host.migrate call result\n$vdiMap //map of source VDI\n$vifMap //map of source VFI\n$options = array(\n\t'option1' =\u003e \"option first\",\n\t'option2' =\u003e \"option second\"\n);\n$live = true;\n$vm-\u003emigrateSend($dest,$vdiMap,$vifMap,$options,$live)\n```\n**NB: this method is still in testing mode**\n\n##### AssertCanMigrate  VM\nAssert whether a VM can be migrated to the specified destination.\nIn this method the first parameter, *dest*, is the result of a **Host.migrate** receive call.\nThe *vdiMap* parameter is the map of source VDI to destination SR.\nThe *vifMap* parameter is the map of VIF to destination network.\nThe *optionsMap*  Extra configuration operations.\nThe *live* parameter allows to migrate the VM in *live mode* or nothing, on default this paramter is set to *false*.\n\n```php\n$dest // Host.migrate call result\n$vdiMap //map of source VDI\n$vifMap //map of source VFI\n$options = array(\n\t'option1' =\u003e \"option first\",\n\t'option2' =\u003e \"option second\"\n);\n$live = true;\n$vm-\u003eassertCanMigrate($dest,$vdiMap,$vifMap,$options,$live)\n```\n**NB: this method is still in testing mode**\n\n##### Snapshot of VM\nSnapshots the specified VM, making a new VM. Snapshot automatically exploits the capabilities of the underlying storage repository in which the VM’s disk images are stored\n\n```php\n$name = \"name of snapshot\";\n$vm-\u003esnapshot($name)\n```\n\n##### Snapshot of VM\nSnapshots the specified VM with quiesce, making a new VM. \nSnapshot automatically exploits the capabilities of the underlying storage repository in which the VM’s disk images are stored\n\n```php\n$name = \"name of snapshot\";\n$vm-\u003esnapshotWithQuiesce($name)\n```\n##### GetSnapshot of VM\nGet the snapshot info field of the given VM.\n\n```php\n$vm-\u003egetSnapshotInfo()\n```\n\n##### Revert of VM\nReverts the specified VM to a previous state\n\n```php\n$snapshotID // the snaoshot id\n$vm-\u003erevert($snapshotID)\n```\n\n##### Copy VM\nCopied the specified VM, making a new VM. Unlike clone, copy does not exploits the capabilities of the underlying storage repository in which the VM’s disk images are stored. Instead, copy guarantees that the disk images of the newly created VM will be ’full disks’ - i.e. not part of a  CoW chain. This function can only be called when the VM is in the Halted State\n\n```php\n$name = \"nameOfCopy\";\n$vm-\u003ecopy($name);\n```\n\n##### Destroy VM\nDestroy the specified VM. The VM is completely removed from the system. This function can only be called when the VM is in the Halted State.\n\n```php\n$vm-\u003edestroy();\n```\n\n##### Checkpoints of VM\nCheckpoints the specified VM, making a new VM. Checkpoint automatically exploits the capabil-ities of the underlying storage repository in which the VM’s disk images are stored (e.g. Copy on Write) and saves the memory image as well\n\n```php\n$name = \"nameOfVM\";\n$vm-\u003echeckpoint($name);\n```\n\n##### SetStartDelay of VM\nSet this VM’s start delay in seconds.\n\n```php\n$seconds = 5;\n$vm-\u003esetStartDelay($seconds);\n```\n\n##### SetShutdownDelay of VM\nSet this VM’s start delay in seconds.\n\n```php\n$seconds = 5;\n$vm-\u003esetShutdownDelay($seconds);\n```\n\n##### GetStartDelay of VM\nGet this VM’s start delay in seconds.\n\n```php\n$vm-\u003egetStartDelay();\n```\n\n##### GetShutdownDelay of VM\nGet this VM’s start delay in seconds.\n\n```php\n$vm-\u003egetShutdownDelay();\n```\n##### GetCurrentOperations of VM\nGet the current operations field of the given VM.\n\n```php\n$vm-\u003egetCurrentOperations();\n```\n##### GetAllowedOperations of VM\nGet the allowed operations field of the given VM.\n\n```php\n$vm-\u003egetAllowedOperations();\n```\n##### GetNameDescription of VM\nGet the name/description field of the given VM.\n\n```php\n$vm-\u003egetNameDescription();\n```\n\n##### SetNameDescription of VM\nSet the name/description field of the given VM.\n\n```php\n$description = \"description\";\n$vm-\u003esetNameDescription($description);\n```\n\n##### GetIsATemplate of VM\nGet the is a template field of the given VM.\n\n```php\n$vm-\u003egetIsATemplate();\n```\n\n##### SetIsATemplate of VM\nSet the is a template field of the given VM.\n\n```php\n$template = false;\n$vm-\u003esetIsATemplate($template);\n```\n\n##### GetResidentOn of VM\nGet the resident on field of the given VM.\nIn the response of this method you’ll find a XenHost object that you can use.\n\n```php\n$vm-\u003egetResidentOn();\n```\n##### GetPlatform of VM\nGet the platform field of the given VM.\n\n```php\n$vm-\u003egetPlatform();\n```\n\n##### SetPlatform of VM\nSet the platform field of the given VM.\n\n```php\n$array = array(\n\t'data'=\u003e'value',\n\t'data2'=\u003e'value'\n);\n$vm-\u003esetPlatform($array);\n```\n\t\n##### GetOtherConfig of VM\nGet the other config field of the given VM.\n\n```php\n$vm-\u003egetOtherConfig();\n```\n\n##### SetOtherConfig of VM\nSet the other config field of the given VM.\n\n```php\n$array = array(\n\t'config'=\u003e'value',\n\t'config2'=\u003e'value'\n);\n$vm-\u003esetOtherConfig($array);\n```\n\n##### AddToOtherConfig of VM\nSet the other config field of the VM given key-value pair to the other config field of the given vm.\n\n```php\n$key = \"key\";\n$value = \"value\"\n\n$vm-\u003eaddToOtherConfig($key, value);\n```\n\n##### RemoveFromOtherConfig of VM\nRemove the given key and its corresponding value from the other config field of the given vm. If the key is not in that Map, then do nothing.\n\n```php\n$key = \"key\";\n$value = \"value\"\n\n$vm-\u003eremoveFromOtherConfig($key);\n```\n\n##### GetNameLabel of VM\nGet name label VM.\n\n```php\n$vm-\u003egetNameLabel();\n```\n\n#### Get Host\n\nThis serves to obtain the target host (by the hostname) :\n\n```php\n$host = $xen-\u003egetHOSTByNameLabel(\"host.machine.hostaname\");\n```\n\n#### Host Management\n\nNow you have the an XenHost object that map your hypervisor, so we are ready to manage the HOST\n\n##### Disable HOST\nPuts the host into a state in which no new VMs can be started. Currently active VMs on the host continue to execute.\n```php\n$host-\u003edisable()\n```\n##### Enable HOST\nPuts the host into a state in which  new VMs can be started.\n```php\n$host-\u003eenable()\n```\n##### Shutdown HOST\nShutdown the host. (This function can only be called if there are no currently running VMs on the host and it is disabled.).\n\n```php\n$host-\u003eshutdown()\n```\n##### Reboot HOST\nReboot the host. (This function can only be called if there are no currently running VMs on the host and it is disabled.).\n\n```php\n$host-\u003ereboot()\n```\n##### Dmesg of HOST\nGet the host xen dmesg.\n\n```php\n$host-\u003edmesg()\n```\n##### DmesgClear of HOST\nGet the host xen dmesg, and clear the buffer\n\n```php\n$host-\u003edmesgClear()\n```\n##### GetLog of HOST\nGet the host’s log file.\n\n```php\n$host-\u003egetLog()\n```\n##### ListMethods of HOST\nList all supported methods.\n\n```php\n$host-\u003elistMethods()\n```\n\n##### LicenseApply of HOST\nApply a new license to a host.\nThe default value of *$license* is an empty string\n\n```php\n$file = file_get_contents(\"/path/license/file\");\n$license = base64_encode($file);\n$host-\u003elicenseApply($license)\n```\n**NB: $license must be an base64 encoded file**\n\n\n##### AssertCanEvacuate  HOST\nCheck this host can be evacuated.\n\n```php\n$host-\u003eassertCanEvacuate()\n```\n  \n##### Evacuate  HOST\nMigrate all VMs off of this host, where possible.\n\n```php\n$host-\u003eevacuate()\n```  \n\n##### GetServerTime of HOST\nThis call queries the host’s clock for the current time.\n\n```php\n$host-\u003egetServertime()\n```     \n\n##### GetServerLocaltime of HOST\nThis call queries the host's clock for the current time in the host’s local timezone.\n\n```php\n$host-\u003egetServerLocaltime()\n```\n##### GetServerCertificate of HOST\nGet the installed server SSL certificate.\n\n```php\n$host-\u003egetServerCertificate()\n```\n**NB: This method returns the SSL certificate in .pem format**\n\n##### ApplyEdition of HOST\nChange to another edition, or reactivate the current edition after a license has expired. This may be subject to the successful checkout of an appropriate license.\nDefault *$force* param is *false*, this means which you want force an update edition.\n\n```php\n$edition = \"newedition\";\n$force = true;\n$host-\u003egetServerCertificate()\n```\n##### RefreshPackInfo of HOST\nRefresh the list of installed Supplemental Packs.\n\n```php\n$host-\u003erefreshPackInfo()\n```\n    \n##### EnableLocalStorageCaching of HOST\nEnable the use of a local SR for caching purposes.\n\n```php\n$srRef = \"srReferID\";\n$host-\u003eenableLocalStorageCaching($srRef);\n```\n\n##### DisableLocalStorageCaching of HOST\nDisable the use of a local SR for caching purposes. \n\n```php\n$host-\u003edisableLocalStorageCaching();\n```\n\n##### MigrateReceive of HOST\nPrepare to receive a VM, returning a token which can be passed to *VM-\u003emigrate().*\nThe *$features* is an associative array that cotains the configuration value that you need to run the migrating machine, it default value is an *empty* array.\n\n```php\n$networkRef = \"networkRef\" // shorty you can pass the obeject that map network\n$features = array(\n\t'options1'=\u003e\"youroption\",\n\t'options2'=\u003e\"youroption\",\n);\n$host-\u003emigrateReceive($networkRef, $features);\n```\n##### GETUUID of HOST\nGet the uuid field of the given host. \t\n\n```php\n$host-\u003egetUUID()\n```\n\n##### GetNameLabel of HOST\nGet the name/label field of the given host. \t\n\n```php\n$host-\u003egetNameLabel()\n```\n##### SetNameLabel of HOST\nSet the name/label field of the given host. \t\n\n```php\n$name = \"server.yourname.com\";\n$host-\u003esetNameLabel($name);\n```   \n\n##### GetNameDescription of HOST\nGet the name/description field of the given HOST.\t\n\n```php\n$host-\u003egetNameDescription()\n```\n##### SetNameDescription of HOST\nSet the name/description field of the given HOST.\t\n\n```php\n$description = \"long long text\";\n$host-\u003esetNameDescription($description)\n```\n##### SetNameDescription of HOST\nSet the name/description field of the given HOST.\t\n\n```php\n$description = \"long long text\";\n$host-\u003esetNameDescription($description)\n```\n##### GetAllowedOperations of HOST\nGet the allowed operations field of the given HOST.\t\n\n```php\n$host-\u003egetAllowedOperations()\n```\n\n##### GetSoftwareVersion of HOST\nGet the software version field of the given host.\t\n\n```php\n$host-\u003egetSoftwareVersion()\n```\n\n##### GetOtherConfig of HOST\n Get the other config field of the given HOST.\t\n\n```php\n$host-\u003egetOtherConfig()\n```\n##### SetOtherConfig of HOST\n Set the other config field of the given HOST.\t\n\n```php\n$config = array(\n\t'config1' =\u003e \"first config\",\n\t'config2' =\u003e \"second config\"\n);\n$host-\u003esetOtherConfig($config)\n```\n\n##### AddOtherConfig of HOST\nAdd the given key-value pair to the other config field of the given host.\t\n\n```php\n$key = \"config1\";\n$value = \"first config\";\n$host-\u003eaddOtherConfig($key,$value)\n```\n##### RemoveOtherConfig of HOST\nRemove the given key and its corresponding value from the other config field of the given host. *If the key is not in that Map, then do nothing.*\n\n```php\n$key = \"config1\";\n$host-\u003eremoveOtherConfig($key)\n```\n\n##### GetSupportedBootloaders of HOST\nGet the supported bootloaders field of the given host.\t\n\n```php\n$host-\u003egetSupportedBootloaders()\n```\n##### GetResidentVMs of HOST\nGet the resident VMs field of the given host.\nIn the response of this method you'll find, if there exists at least a VM inside this Host, an array of VMs object that you can use.\t\n\n```php\n$host-\u003egetResidentVMs()\n```\n##### GetPatches of HOST\nGet the patches field of the given host.\n\n```php\n$host-\u003egetPatches()\n```\n\n##### GetHostCPUs of HOST\nGet the host CPUs field of the given host.\n\n```php\n$host-\u003egetHostCPUs()\n```\n##### GetCPUInfo of HOST\nGet the cpu info field of the given host.\n\n```php\n$host-\u003egetCPUInfo()\n```\n##### GetHostname of HOST\nGet the hostname of the given host.\n\n```php\n$host-\u003egetHostname()\n```\n##### SetHostname of HOST\nSet the hostname of the given host.\n\n```php\n$name = \"new.hostname.com\"\n$host-\u003esetHostname($name);\n```\n##### GetAddress of HOST\nGet the address field of the given host.\n\n```php\n$host-\u003egetAddress()\n```\n\n##### SetAddress of HOST\nSet the address field of the given host. \n\n```php\n$address = \"123.123.123.123\"\n$host-\u003esetAddress($address);\n```\n\n##### GetMetrics of HOST\nGet the metrics field of the given host.\n\n```php\n$host-\u003egetMetrics()\n```\n\t\n##### GetLicenseParam of HOST\nGet the license params field of the given host.\n\n```php\n$host-\u003egetLicenseParam()\n```\n##### GetEdition of HOST\nGet the edition field of the given host. \n\n```php\n$host-\u003egetEdition()\n```\n\n##### GetLicenseServer of HOST\nGet the license server field of the given host.\n\n```php\n$host-\u003egetLicenseServer()\n```\n##### SetLicenseServer of HOST\nSet the license server field of the given host.\n\n```php\n$license = \"newlicense\"\n$host-\u003esetLicenseServer($license);\n```\n##### AddToLicenseServer of HOST\nAdd the given key-value pair to the license server field of the given host.\n\n```php\n$key = \"licenseName\";\n$value = \"licenseValue\";\n$host-\u003eaddToLicenseServer($key,$value);\n```\n\n##### RemoveFromLicenseServer of HOST\nRemove the given key and its corresponding value from the license server field of the given host. *If the key is not in that Map, then do nothing.*\n\n```php\n$key = \"licenseName\";\n$host-\u003eremoveFromLicenseServer($key);\n```\n\n##### GetChipsetInfo of HOST\nGet the chipset info field of the given host.\n\n```php\n$host-\u003egetChipsetInfo()\n```\n#### Response Management\n\nEvery method return an istance of *XenResponse* class.\nThis object contains three attributes:\n\n+ Value\n+ Status\n+ ErrorDescription\n\n##### Value attribute\nThis attribute contains the value of response, sach as message, XML string or something else.\n\nuse this method to obtain it:\n```php\n$response = $vm-\u003ehardReboot();\n$response-\u003egetValue();\n```\n##### Status attribute\nThis attribute contains the status of response.\nIf status is **Success** the request is OK.\nOtherwise is request is KO, use this for check the result of your operations\n\nuse this method to obtain it:\n```php\n$response = $vm-\u003ehardReboot();\n$response-\u003egetStatus();\n```\n##### ErrorDescription attribute\nThis attribute contains message of KO response.\nJust take the value of this attribute and check why the response isn't OK.\n\nFor example if your connection credentials are wrong:\n```php\n$console = \"wrong_console\";\n$response = $vm-\u003egetConsolesUUID($console);\n$response-\u003egetStatus(); //return Failure\n$response-\u003egetErrorDescription(); // return an array with some error message\n```\n\n#### Exceptions\n\nThis is exaplained the custom excetions\n\n##### XenConnectionException\n\nThis exception is launched when you try to connect to a hypervisor with a wrong credentials.\n\nTo catch this exception, remember to use the namespace of this class:\n```php\nuse Sircamp\\Xenapi\\Exception\\XenConnectionException as XenConnectionException;\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsircamp%2Fxenapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsircamp%2Fxenapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsircamp%2Fxenapi/lists"}