Skip to main content

Import Key Pair

https://infrahub-api.nexgencloud.com/v1/core/keypairs

Imports a new key pair for secure shell (SSH) access to your resources. To import a new key pair, include the key name, environment name, and public key in the request body. For additional information on importing SSH key pairs, click here. If you haven't created a key pair yet, you can generate one by clicking here.


Body parameters


name string   Required

Name of the SSH key pair.
A string with a maximum length of 50 characters.


environment_name string   Required

Name of the environment within which your SSH key pair will be created.


public_key string   Required

The public portion of the SSH keypair generated when you create a new key pair.


Attributes


status boolean

Indicates the success or failure of the request to import a key pair. true, indicates success, while false indicates error.


message string

A message confirming the status of the request to import a key pair.


keypair object

Returns the keypair objects, containing details on the imported key pair.

For descriptions of the fields within the keypair object returned in response to your request, please refer to the documentation here.


Example request
curl -X POST "https://infrahub-api.nexgencloud.com/v1/core/keypairs" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"\
-H "content-type: application/json" \
-d '{
"name": "string"
"environment_name": "string"
"public_key": "string"
}'
Response
{
"status": true,
"message": "string",
"keypair": {
"id": 0,
"name": "string",
"environment": "string",
"public_key": "string",
"fingerprint": "string",
"created_at": "1970-01-01T00:00:00.000Z"
}
}

Returns


The response will include the status of the request and the keypair object, providing detailed information about the newly imported key pair. To learn more about the attributes of the keypair object, click here.


Back to top