Esempio n. 1
0
 /**
  * Get information about the instance view of a virtual machine.
  *
  * @param string $subscriptionId    Subscription Id
  * @param string $resourceGroup     Name of Resource Group
  * @param string $name              Name of the needle Virtual Machine
  *
  * @return VirtualInstanceViewData Object with Virtual Machine instance-view info
  */
 public function getInstanceViewInfo($subscriptionId, $resourceGroup, $name)
 {
     $result = null;
     $path = '/subscriptions/' . $subscriptionId . '/resourceGroups/' . $resourceGroup . ComputeService::ENDPOINT_MICROSOFT_COMPUTE . '/virtualMachines/' . $name . '/InstanceView';
     $request = $this->getClient()->prepareRequest($path, 'GET', $this->getApiVersion(), $this->getServiceUrl());
     $response = $this->getClient()->call($request);
     if (!$response->hasError()) {
         $result = VirtualInstanceViewData::initArray($response->getResult());
     }
     return $result;
 }
Esempio n. 2
0
 /**
  * Sets instance view data
  *
  * @param array|VirtualInstanceViewData $instanceView
  * @return VirtualMachineProperties
  */
 public function setInstanceView($instanceView = null)
 {
     if (!$instanceView instanceof VirtualInstanceViewData) {
         $instanceView = VirtualInstanceViewData::initArray($instanceView);
     }
     return $this->__call(__FUNCTION__, [$instanceView]);
 }