All URIs are relative to https://api.selectel.ru/domains/v1
Method | HTTP request | Description |
---|---|---|
add_domain | POST / | Create new domain |
delete_domain | DELETE /{domain_id} | Deletes a domain |
get_domain_by_id | GET /{domain_id} | Find domain by ID |
get_domain_by_name | GET /{domain_name} | Find domain by name |
get_domain_zone_file | GET /{domain_id}/export | Find domain by name |
get_domains | GET / | Getting domains info |
update_domain | PATCH /{domain_id} | Updates a domain |
Domain add_domain(body)
Create new domain
from __future__ import print_function
import time
import selectel_dns_api
from selectel_dns_api.rest import ApiException
from pprint import pprint
# Configure API key authorization: X-Token
selectel_dns_api.configuration.api_key['X-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# selectel_dns_api.configuration.api_key_prefix['X-Token'] = 'Bearer'
# create an instance of the API class
api_instance = selectel_dns_api.DomainsApi()
body = selectel_dns_api.NewDomain() # NewDomain | Domain info for creation
try:
# Create new domain
api_response = api_instance.add_domain(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DomainsApi->add_domain: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | NewDomain | Domain info for creation |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_domain(domain_id)
Deletes a domain
from __future__ import print_function
import time
import selectel_dns_api
from selectel_dns_api.rest import ApiException
from pprint import pprint
# Configure API key authorization: X-Token
selectel_dns_api.configuration.api_key['X-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# selectel_dns_api.configuration.api_key_prefix['X-Token'] = 'Bearer'
# create an instance of the API class
api_instance = selectel_dns_api.DomainsApi()
domain_id = 789 # int | ID of domain to delete
try:
# Deletes a domain
api_instance.delete_domain(domain_id)
except ApiException as e:
print("Exception when calling DomainsApi->delete_domain: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
domain_id | int | ID of domain to delete |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Domain get_domain_by_id(domain_id)
Find domain by ID
Returns a single domain
from __future__ import print_function
import time
import selectel_dns_api
from selectel_dns_api.rest import ApiException
from pprint import pprint
# Configure API key authorization: X-Token
selectel_dns_api.configuration.api_key['X-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# selectel_dns_api.configuration.api_key_prefix['X-Token'] = 'Bearer'
# create an instance of the API class
api_instance = selectel_dns_api.DomainsApi()
domain_id = 789 # int | ID of domain to return
try:
# Find domain by ID
api_response = api_instance.get_domain_by_id(domain_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling DomainsApi->get_domain_by_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
domain_id | int | ID of domain to return |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Domain get_domain_by_name(domain_name)
Find domain by name
Returns a single domain
from __future__ import print_function
import time
import selectel_dns_api
from selectel_dns_api.rest import ApiException
from pprint import pprint
# Configure API key authorization: X-Token
selectel_dns_api.configuration.api_key['X-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# selectel_dns_api.configuration.api_key_prefix['X-Token'] = 'Bearer'
# create an instance of the API class
api_instance = selectel_dns_api.DomainsApi()
domain_name = 'domain_name_example' # str | name of domain to return
try:
# Find domain by name
api_response = api_instance.get_domain_by_name(domain_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling DomainsApi->get_domain_by_name: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
domain_name | str | name of domain to return |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str get_domain_zone_file(domain_id)
Find domain by name
Returns a domain's zone file
from __future__ import print_function
import time
import selectel_dns_api
from selectel_dns_api.rest import ApiException
from pprint import pprint
# Configure API key authorization: X-Token
selectel_dns_api.configuration.api_key['X-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# selectel_dns_api.configuration.api_key_prefix['X-Token'] = 'Bearer'
# create an instance of the API class
api_instance = selectel_dns_api.DomainsApi()
domain_id = 789 # int | ID of domain to delete
try:
# Find domain by name
api_response = api_instance.get_domain_zone_file(domain_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling DomainsApi->get_domain_zone_file: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
domain_id | int | ID of domain to delete |
str
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[Domain] get_domains()
Getting domains info
from __future__ import print_function
import time
import selectel_dns_api
from selectel_dns_api.rest import ApiException
from pprint import pprint
# Configure API key authorization: X-Token
selectel_dns_api.configuration.api_key['X-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# selectel_dns_api.configuration.api_key_prefix['X-Token'] = 'Bearer'
# create an instance of the API class
api_instance = selectel_dns_api.DomainsApi()
try:
# Getting domains info
api_response = api_instance.get_domains()
pprint(api_response)
except ApiException as e:
print("Exception when calling DomainsApi->get_domains: %s\n" % e)
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Domain update_domain(domain_id, body)
Updates a domain
from __future__ import print_function
import time
import selectel_dns_api
from selectel_dns_api.rest import ApiException
from pprint import pprint
# Configure API key authorization: X-Token
selectel_dns_api.configuration.api_key['X-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# selectel_dns_api.configuration.api_key_prefix['X-Token'] = 'Bearer'
# create an instance of the API class
api_instance = selectel_dns_api.DomainsApi()
domain_id = 789 # int | ID of domain to update
body = selectel_dns_api.UpdatedDomain() # UpdatedDomain | Domain info for update
try:
# Updates a domain
api_response = api_instance.update_domain(domain_id, body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DomainsApi->update_domain: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
domain_id | int | ID of domain to update | |
body | UpdatedDomain | Domain info for update |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]