All URIs are relative to https://developers.hostinger.com
| Method | HTTP request | Description |
|---|---|---|
| create_public_key_v1 | POST /api/vps/v1/public-keys | Create public key |
| delete_public_key_v1 | DELETE /api/vps/v1/public-keys/{publicKeyId} | Delete public key |
| get_public_keys_v1 | GET /api/vps/v1/public-keys | Get public keys |
VPSV1PublicKeyPublicKeyResource create_public_key_v1(vpsv1_public_key_store_request)
Create public key
Deprecated: account-level public keys have no direct replacement. Root SSH keys are now managed per
virtual machine via POST /api/vps/v1/virtual-machines/{virtualMachineId}/ssh-keys.
Add a new public key to your account.
Use this endpoint to register SSH keys for VPS authentication.
- Bearer Authentication (apiToken):
import hostinger_api
from hostinger_api.models.vpsv1_public_key_public_key_resource import VPSV1PublicKeyPublicKeyResource
from hostinger_api.models.vpsv1_public_key_store_request import VPSV1PublicKeyStoreRequest
from hostinger_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: apiToken
configuration = hostinger_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with hostinger_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = hostinger_api.VPSPublicKeysApi(api_client)
vpsv1_public_key_store_request = hostinger_api.VPSV1PublicKeyStoreRequest() # VPSV1PublicKeyStoreRequest |
try:
# Create public key
api_response = api_instance.create_public_key_v1(vpsv1_public_key_store_request)
print("The response of VPSPublicKeysApi->create_public_key_v1:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VPSPublicKeysApi->create_public_key_v1: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| vpsv1_public_key_store_request | VPSV1PublicKeyStoreRequest |
VPSV1PublicKeyPublicKeyResource
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success response | - |
| 422 | Validation error response | - |
| 401 | Unauthenticated response | - |
| 500 | Error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CommonSuccessEmptyResource delete_public_key_v1(public_key_id)
Delete public key
Deprecated: account-level public keys have no direct replacement. Root SSH keys are now managed per
virtual machine via DELETE /api/vps/v1/virtual-machines/{virtualMachineId}/ssh-keys.
Delete a public key from your account.
Deleting public key from account does not remove it from virtual machine
Use this endpoint to remove unused SSH keys from account.
- Bearer Authentication (apiToken):
import hostinger_api
from hostinger_api.models.common_success_empty_resource import CommonSuccessEmptyResource
from hostinger_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: apiToken
configuration = hostinger_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with hostinger_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = hostinger_api.VPSPublicKeysApi(api_client)
public_key_id = 6672861 # int | Public Key ID
try:
# Delete public key
api_response = api_instance.delete_public_key_v1(public_key_id)
print("The response of VPSPublicKeysApi->delete_public_key_v1:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VPSPublicKeysApi->delete_public_key_v1: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| public_key_id | int | Public Key ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success empty response | - |
| 401 | Unauthenticated response | - |
| 500 | Error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
VPSV1PublicKeyListResponse get_public_keys_v1(page=page)
Get public keys
Deprecated: account-level public keys have no direct replacement. Root SSH keys are now managed per
virtual machine via GET /api/vps/v1/virtual-machines/{virtualMachineId}/ssh-keys.
Retrieve public keys associated with your account.
Use this endpoint to view available SSH keys for VPS authentication.
- Bearer Authentication (apiToken):
import hostinger_api
from hostinger_api.models.vpsv1_public_key_list_response import VPSV1PublicKeyListResponse
from hostinger_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: apiToken
configuration = hostinger_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with hostinger_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = hostinger_api.VPSPublicKeysApi(api_client)
page = 1 # int | Page number (optional)
try:
# Get public keys
api_response = api_instance.get_public_keys_v1(page=page)
print("The response of VPSPublicKeysApi->get_public_keys_v1:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VPSPublicKeysApi->get_public_keys_v1: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| page | int | Page number | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success response | - |
| 401 | Unauthenticated response | - |
| 500 | Error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]