/** * Lists all availability sets in a resource group. * * @param string $subscriptionId Subscription Id * @param string $resourceGroupName Name of Resource Group with Availability Sets * * @return AvailabilitySetList Object with response */ public function getList($subscriptionId, $resourceGroupName) { $result = null; $path = '/subscriptions/' . $subscriptionId . '/resourceGroups/' . $resourceGroupName . ComputeService::ENDPOINT_MICROSOFT_COMPUTE . '/availabilitySets'; $request = $this->getClient()->prepareRequest($path, 'GET', $this->getApiVersion()); $response = $this->getClient()->call($request); if (!$response->hasError()) { $resultArray = $response->getResult(); $result = new AvailabilitySetList(); foreach ($resultArray as $array) { $result->append(AvailabilitySetData::initArray($array)); } } return $result; }
/** * Sets availability set data * * @param array|AvailabilitySetData $availabilitySet * @return VirtualMachineProperties */ public function setAvailabilitySet($availabilitySet = null) { if (!$availabilitySet instanceof AvailabilitySetData) { $availabilitySet = AvailabilitySetData::initArray($availabilitySet); } return $this->__call(__FUNCTION__, [$availabilitySet]); }