All URIs are relative to https://developers.hostinger.com
Method | HTTP request | Description |
---|---|---|
create_ptr_record_v1 | POST /api/vps/v1/virtual-machines/{virtualMachineId}/ptr | Create PTR record |
delete_ptr_record_v1 | DELETE /api/vps/v1/virtual-machines/{virtualMachineId}/ptr | Delete PTR record |
VPSV1ActionActionResource create_ptr_record_v1(virtual_machine_id)
Create PTR record
This endpoint creates or updates a PTR (Pointer) record for a specified virtual machine.
- Bearer Authentication (apiToken):
import hostinger_api
from hostinger_api.models.vpsv1_action_action_resource import VPSV1ActionActionResource
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.VPSPTRRecordsApi(api_client)
virtual_machine_id = 1268054 # int | Virtual Machine ID
try:
# Create PTR record
api_response = api_instance.create_ptr_record_v1(virtual_machine_id)
print("The response of VPSPTRRecordsApi->create_ptr_record_v1:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VPSPTRRecordsApi->create_ptr_record_v1: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
virtual_machine_id | int | Virtual Machine ID |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success response | - |
401 | Unauthenticated | - |
500 | Error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
VPSV1ActionActionResource delete_ptr_record_v1(virtual_machine_id)
Delete PTR record
This endpoint deletes a PTR (Pointer) record for a specified virtual machine.
Once deleted, reverse DNS lookups to the virtual machine's IP address will no longer return the previously configured hostname.
- Bearer Authentication (apiToken):
import hostinger_api
from hostinger_api.models.vpsv1_action_action_resource import VPSV1ActionActionResource
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.VPSPTRRecordsApi(api_client)
virtual_machine_id = 1268054 # int | Virtual Machine ID
try:
# Delete PTR record
api_response = api_instance.delete_ptr_record_v1(virtual_machine_id)
print("The response of VPSPTRRecordsApi->delete_ptr_record_v1:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VPSPTRRecordsApi->delete_ptr_record_v1: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
virtual_machine_id | int | Virtual Machine ID |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success response | - |
401 | Unauthenticated | - |
500 | Error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]