Scalr\Service\Aws\Rds\V20141031\RdsApi::listTagsForResource PHP Méthode

listTagsForResource() public méthode

Lists all tags on an Amazon RDS resource.
public listTagsForResource ( string $resourceName, string $resourceType ) : Scalr\Service\Aws\Rds\DataType\TagsList
$resourceName string Resource identifier for the Amazon RDS resource.
$resourceType string The type of Amazon RDS resource (db|es|og|pg|ri|secgrp|snapshot|subgrp)
Résultat Scalr\Service\Aws\Rds\DataType\TagsList
    public function listTagsForResource($resourceName, $resourceType)
    {
        $result = null;
        $options = ['ResourceName' => $this->rds->getResourceName($resourceName, $resourceType)];
        $action = ucfirst(__FUNCTION__);
        $response = $this->client->call($action, $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            if (!$this->exist($sxml->{$action . 'Result'})) {
                throw new RdsException(sprintf(self::UNEXPECTED, $action));
            }
            $ptr = $sxml->{$action . 'Result'};
            $result = new TagsList();
            $result->setRds($this->rds);
            if (isset($ptr->TagList->Tag)) {
                foreach ($ptr->TagList->Tag as $v) {
                    $item = $this->_loadTagData($v);
                    $result->append($item);
                    unset($item);
                }
            }
        }
        return $result;
    }
RdsApi