src/Actions/ManagesSSHKeys.php
public function createSSHKey($serverId, array $data, $wait = true)
    {
        $key = $this->post("servers/$serverId/keys", $data)['key'];

        if ($wait) {
            return $this->retry($this->getTimeout(), function () use ($serverId, $key) {
                $key = $this->SSHKey($serverId, $key['id']);

                return $key->status == 'installed' ? $key : null;
            });
        }

        return new SSHKey($key + ['server_id' => $serverId], $this);
    }
public function createSSHKey($serverId, array $data, $wait = true)
    {
        $key = $this->post("servers/$serverId/keys", $data)['key'];

        if ($wait) {
            return $this->retry($this->getTimeout(), function () use ($serverId, $key) {
                $key = $this->SSHKey($serverId, $key['id']);

                return $key->status == 'installed' ? $key : null;
            });
        }

        return new SSHKey($key + ['server_id' => $serverId], $this);
    }
public function createSSHKey ( $ serverId , array $ data , $ wait = true ) { $ key = $ this -> post ( "servers/$serverId/keys" , $ data ) [ 'key' ] ; if ( $ wait ) { return $ this -> retry ( $ this -> getTimeout ( ) , function ( ) use ( $ serverId , $ key ) { $ key = $ this -> SSHKey ( $ serverId , $ key [ 'id' ] ) ; return $ key -> status == 'installed' ? $ key : null ; } ) ; } return new SSHKey ( $ key + [ 'server_id' => $ serverId ] , $ this ) ; }
Create a new SSH key.

@param  integer $serverId
@param  array $data
@param  boolean $wait
@return SSHKey
Create a new SSH key .