ovh\Cloud\CloudClient::setSshKey PHP Метод

setSshKey() публичный Метод

Set a SSH public key to PCA
public setSshKey ( string $pp, string $pca, string $key )
$pp string OVH cloud passport
$pca string PCA service name
$key string
    public function setSshKey($pp, $pca, $key)
    {
        if (!$pp) {
            throw new BadMethodCallException('Missing parameter $pp (OVH cloud passport).');
        }
        if (!$pca) {
            throw new BadMethodCallException('Missing parameter $pca (PCA ServiceName).');
        }
        if (!$key) {
            throw new BadMethodCallException('Missing parameter $key (Public key for this pca).');
        }
        $payload = array('sshkey' => $key);
        try {
            $this->put('cloud/' . $pp . '/pca/' . $pca, array('Content-Type' => 'application/json;charset=UTF-8'), json_encode($payload))->send();
        } catch (\Exception $e) {
            throw new CloudException($e->getMessage(), $e->getCode(), $e);
        }
    }