'Create a keypair
:param name: name for the keypair to create
:param public_key: existing public key to import
:param key_type: keypair type to create'

@api_versions.wraps('2.2', '2.9')
def create(self, name, public_key=None, key_type='ssh'):

    body = {'keypair': {'name': name, 'type': key_type}}
    if public_key:
        body['keypair']['public_key'] = public_key
    return self._create(('/%s' % self.keypair_prefix), body, 'keypair')
