All URIs are relative to https://developers.hostinger.com
Method | HTTP request | Description |
---|---|---|
get_snapshot_list_v1 | GET /api/dns/v1/snapshots/{domain} | Get snapshot list |
get_snapshot_v1 | GET /api/dns/v1/snapshots/{domain}/{snapshotId} | Get snapshot |
restore_snapshot_v1 | POST /api/dns/v1/snapshots/{domain}/{snapshotId}/restore | Restore snapshot |
List[DNSV1SnapshotSnapshotResource] get_snapshot_list_v1(domain)
Get snapshot list
This endpoint retrieves list of DNS snapshots.
- Bearer Authentication (apiToken):
import hostinger_api
from hostinger_api.models.dnsv1_snapshot_snapshot_resource import DNSV1SnapshotSnapshotResource
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.DNSSnapshotApi(api_client)
domain = 'mydomain.tld' # str | Domain name
try:
# Get snapshot list
api_response = api_instance.get_snapshot_list_v1(domain)
print("The response of DNSSnapshotApi->get_snapshot_list_v1:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DNSSnapshotApi->get_snapshot_list_v1: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
domain | str | Domain name |
List[DNSV1SnapshotSnapshotResource]
- 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]
DNSV1SnapshotSnapshotWithContentResource get_snapshot_v1(domain, snapshot_id)
Get snapshot
This endpoint retrieves particular DNS snapshot with the contents of DNS zone records.
- Bearer Authentication (apiToken):
import hostinger_api
from hostinger_api.models.dnsv1_snapshot_snapshot_with_content_resource import DNSV1SnapshotSnapshotWithContentResource
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.DNSSnapshotApi(api_client)
domain = 'mydomain.tld' # str | Domain name
snapshot_id = 53513053 # int | Snapshot ID
try:
# Get snapshot
api_response = api_instance.get_snapshot_v1(domain, snapshot_id)
print("The response of DNSSnapshotApi->get_snapshot_v1:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DNSSnapshotApi->get_snapshot_v1: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
domain | str | Domain name | |
snapshot_id | int | Snapshot ID |
DNSV1SnapshotSnapshotWithContentResource
- 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]
CommonSuccessEmptyResource restore_snapshot_v1(domain, snapshot_id)
Restore snapshot
This endpoint restores DNS zone to the selected snapshot.
- 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.DNSSnapshotApi(api_client)
domain = 'mydomain.tld' # str | Domain name
snapshot_id = 53513053 # int | Snapshot ID
try:
# Restore snapshot
api_response = api_instance.restore_snapshot_v1(domain, snapshot_id)
print("The response of DNSSnapshotApi->restore_snapshot_v1:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DNSSnapshotApi->restore_snapshot_v1: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
domain | str | Domain name | |
snapshot_id | int | Snapshot 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]