@param string $site
@param int $keyId

@return \Acquia\Cloud\Api\Response\SshKey

@throws \Guzzle\Http\Exception\ClientErrorResponseException

@see http://cloudapi.acquia.com/#GET__sites__site_sshkeys__sshkeyid-instance_route
164116
public function sshKey($site, $keyId)
    {
        $variables = array(
            'site' => $site,
            'id' => $keyId,
        );
        $request = $this->get(array('{+base_path}/sites/{site}/sshkeys/{id}.json', $variables));
        return new Response\SshKey($request);
    }
303023
private function createV1Website($name, $ipAddress, $https, array $domains, array...$siteApps)
    {

        return $this->send('create_website', $name, $ipAddress, $https, $domains, ...$siteApps);
    }
624650
public function addSiteFilter($site)
    {
        if ($site instanceof Site) {
            $site = $site->getUid();
        }

        if (!empty($site)) {
            $this->andWhere(
                'cc._uid IN (SELECT i.content_uid FROM BackBee\ClassContent\Indexes\IdxSiteContent i WHERE i.site_uid = :site_uid)'
            )->setParameter('site_uid', $site);
        }
    }
1204352
public function findBySite($siteId)
    {
        $qb = $this->createQueryBuilder();
        $qb->field('siteId')->equals($siteId);

        return $qb;
    }
75518
public function save(Site $site)
    {
        $id = $site->getId();
        if ($id == 0) {
            return $this->getTableGateway()->insert($site->toArray());
        } elseif ($this->findById($id)) {
            return $this->getTableGateway()->update($site->toArray(), array("id" => $id));
        } else {
            return NULL;
        }
    }
25008
def useKeyID(self, keyID):
        
        if keyID not in self._data['keys']:
            raise ConfigException('keyID does not exist: %s' % keyID)
        self._keyID = keyID
471848
public function task($site, $taskId)
    {
        $variables = array(
            'site' => $site,
            'task' => $taskId,
        );
        $request = $this->get(array('{+base_path}/sites/{site}/tasks/{task}.json', $variables));
        return new Response\Task($request);
    }
184374
protected Object getLock (int siteId)
    {
        Object lock = null;

        synchronized (_locks) {
            lock = _locks.get(siteId);

            // create a lock object if we haven't one already
            if (lock == null) {
                _locks.put(siteId, lock = new Object());
            }
        }

        return lock;
    }
774294
private function getCurrentSite(Site $site = null)
    {
        if (null !== $site) {
            return $site;
        }

        if (null !== $this->application) {
            return $this->application->getSite();
        }

        return null;
    }
870321
public function gpgSign($keyId = null)
    {
        $this->gpgSignIsset = true;
        $this->arguments[]  = '--gpg-sign' . ($keyId ? '=' . $keyId : '');
        return $this;
    }
637203
protected function postKeyToLaravelForgeServer($keyName=null)
    {
        $keyName ? $keyName : $this->getUniqueKeyNameFromEmail();
        return $this->http->post($this->url,
            [
                'form_params' => [
                    'name' => $keyName,
                    'key' => file_get_contents($_SERVER['HOME'] . self::SSH_ID_RSA_PUB)
                ],
                'headers' => [
                    'X-Requested-With' => 'XMLHttpRequest',
                    'Authorization' => 'Bearer ' . fp_env('ACACHA_FORGE_ACCESS_TOKEN')
                ]
            ]
        );
    }
620073
protected function getPriority(ReadNodeInterface $node, ReadSiteInterface $site)
    {
        $sitemapPriority = $node->getSitemapPriority();

        if (is_null($sitemapPriority)) {
            $sitemapPriority = $site->getSitemapPriority();
        }

        return $sitemapPriority;
    }
268250
public function getShowBySiteID($site, $ID){
		$site = strtolower($site);
		$url = self::APIURL.'/lookup/shows?'.$site.'='.$ID;
		$show = $this->getFile($url);

		return new TVShow($show);
	}
235099
public function createForSite(SiteInterface $site)
    {
        $listRedirection = $this->redirectionRepository->findBySiteId($site->getSiteId());
        $siteLanguages = $site->getLanguages();
        $routes = array();

        foreach ($siteLanguages as $language) {
            $nodes = $this->nodeRepository->findPublishedByLanguageAndSiteId($language, $site->getSiteId());
            $routePattern = $this->nodeRepository->findAllRoutePattern($language, $site->getSiteId());
            $routePattern = $this->computeRoutePattern($routePattern);
            foreach ($nodes as $node) {
                $routes = array_merge($this->generateRoutesForNode($node, $site, $routePattern), $routes);
            }
        }

        foreach ($listRedirection as $redirection) {
            $routes = array_merge($this->generateRoutesForRedirection($redirection, $site), $routes);
        }

        return $routes;
    }
893575
def get_keyid(keyname):
    '''
    
    '''
    if not keyname:
        return None
    keypairs = list_keypairs(call='function')
    keyid = keypairs[keyname]['id']
    if keyid:
        return keyid
    raise SaltCloudNotFound('The specified ssh key could not be found.')
640379
public function getCloningMapping(Site $site)
    {
        if (isset($this->cloningMapping[$site->getId()])) {
            return $this->cloningMapping[$site->getId()];
        }

        $q = $this->db
            ->select('node', 'n')
            ->fields('n', ['parent_nid', 'nid'])
            ->isNotNull('parent_nid')
            ->condition('site_id', $site->id)
            ->condition('status', NODE_PUBLISHED)
            ->orderBy('created', 'ASC')
        ;

        $mapping = [];

        foreach ($q->execute()->fetchAll() as $row) {
            if (isset($mapping[(int) $row->parent_nid])) {
                continue;
            }
            $mapping[(int) $row->parent_nid] = (int) $row->nid;
        }

        $this->cloningMapping[$site->getId()] = $mapping;

        return $mapping;
    }
1087491
public function compose($keyId = null, $head = null) {
        if (!$this->payload)
            throw new \Firebase\JWT\BeforeValidException(ExceptionMessages::JWT_PAYLOAD_NOT_FOUND);

        return parent::encode($this->payload, $this->key, $this->algorithm, $keyId, $head);
    }