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

deleteAction() public method

Delete an Farm from this Environment
public deleteAction ( string $farmId ) : Scalr\Api\DataType\ResultEnvelope
$farmId string Unique identifier of the script
return Scalr\Api\DataType\ResultEnvelope
    public function deleteAction($farmId)
    {
        $farm = $this->getFarm($farmId, Acl::PERM_FARMS_DELETE);
        try {
            $farm->delete();
        } catch (FarmInUseException $e) {
            throw new ApiErrorException(409, ErrorMessage::ERR_OBJECT_IN_USE, $e->getMessage());
        }
        return $this->result(null);
    }