Scalr\Api\Service\User\V1beta0\Controller\CloudCredentials::deleteAction PHP Method

deleteAction() public method

public deleteAction ( $cloudCredentialsId )
    public function deleteAction($cloudCredentialsId)
    {
        $this->checkScopedPermissions('CLOUD_CREDENTIALS');
        $cloudCredentials = $this->getCloudCredentials($cloudCredentialsId, true);
        if ($cloudCredentials->isUsed()) {
            throw new ApiErrorException(409, ErrorMessage::ERR_OBJECT_IN_USE, "Cloud Credentials that are in use can not be removed. Please disassociate them from the Environments first.");
        }
        $cloudCredentials->delete();
        return $this->result(null);
    }