Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
Added method to purge Varnish cache for an environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Pliakas committed Dec 17, 2013
1 parent f7ac134 commit 4271ec5
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions src/Acquia/Cloud/Api/CloudApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function environment($site, $env)
* @param string $type
* @param string $source
*
* @return array
* @return \Acquia\Cloud\Api\Response\Task
*
* @throws \Guzzle\Http\Exception\ClientErrorResponseException
*/
Expand Down Expand Up @@ -309,7 +309,7 @@ public function sshKey($site, $id)
* @param string $publicKey
* @param string $nickname
*
* @return array
* @return \Acquia\Cloud\Api\Response\Task
*
* @throws \Guzzle\Http\Exception\ClientErrorResponseException
*/
Expand All @@ -329,7 +329,7 @@ public function addSshKey($site, $publicKey, $nickname)
* @param string $site
* @param int $id
*
* @return array
* @return \Acquia\Cloud\Api\Response\Task
*
* @throws \Guzzle\Http\Exception\ClientErrorResponseException
*/
Expand Down Expand Up @@ -378,7 +378,7 @@ public function svnUser($site, $id)
* @param string $username
* @param string $password
*
* @return array
* @return \Acquia\Cloud\Api\Response\Task
*
* @throws \Guzzle\Http\Exception\ClientErrorResponseException
*
Expand All @@ -400,7 +400,7 @@ public function addSvnUser($site, $username, $password)
* @param string $site
* @param int $id
*
* @return array
* @return \Acquia\Cloud\Api\Response\Task
*
* @throws \Guzzle\Http\Exception\ClientErrorResponseException
*
Expand Down Expand Up @@ -640,4 +640,24 @@ public function domain($site, $env, $domain)
$data = $this->sendGet('{+base_path}/sites/{site}/envs/{env}/domains/{domain}.json', $variables);
return new Response\Domain($data);
}

/**
* @param string $site
* @param string $env
* @param string $domain
*
* @return \Acquia\Cloud\Api\Response\Task
*
* @throws \Guzzle\Http\Exception\ClientErrorResponseException
*/
public function purgeVarnishCache($site, $env, $domain)
{
$variables = array(
'site' => $site,
'env' => $env,
'domain' => $domain,
);
$data = $this->sendDelete('{+base_path}/sites/{site}/envs/{env}/domains/{domain}/cache.json', $variables);
return new Response\Task($data);
}
}

0 comments on commit 4271ec5

Please sign in to comment.