Scalr\Service\Aws\Ec2\V20140615\Ec2Api::deleteTags PHP Метод

deleteTags() публичный Метод

Deletes a specific set of tags from a specific set of resources. This call is designed to follow a DescribeTags call. You first determine what tags a resource has, and then you call DeleteTags with the resource ID and the specific tags you want to delete.
public deleteTags ( ListDataType $resourceIdList, Scalr\Service\Aws\Ec2\DataType\ResourceTagSetList $tagList ) : boolean
$resourceIdList Scalr\Service\Aws\DataType\ListDataType The ID of a resource to tag. For example, ami-1a2b3c4d. You can specify multiple resources to assign the tags to.
$tagList Scalr\Service\Aws\Ec2\DataType\ResourceTagSetList The key/value pair list of the Tags.
Результат boolean Returns true on success or throws an exception otherwise
    public function deleteTags(ListDataType $resourceIdList, ResourceTagSetList $tagList)
    {
        $result = false;
        $options = array_merge($resourceIdList->getQueryArrayBare('ResourceId'), array_filter($tagList->getQueryArrayBare('Tag'), function ($val) {
            return $val !== null;
        }));
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            //Success
            $sxml = simplexml_load_string($response->getRawContent());
            if ((string) $sxml->return != 'true') {
                throw new Ec2Exception(sprintf('Amazon Ec2 could not delete the Tags. It returned "%s"', $sxml->return));
            }
            $result = true;
        }
        return $result;
    }
Ec2Api