-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdomain.py
More file actions
23 lines (17 loc) · 828 Bytes
/
domain.py
File metadata and controls
23 lines (17 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import requests
class DomainService():
def __init__(self, client):
self.client = client
self.url = 'https://domain.labstack.com/api/v1'
def dns(self, request):
return self.client._request('GET', '{}/{}/{}'.
format(self.url, request['type'], request['domain']))
def search(self, request):
return self.client._request('GET', '{}/search'.
format(self.url, params={'q': request['q']}))
def status(self, request):
return self.client._request('GET', '{}/status/{}'.
format(self.url, request['domain']))
def whois(self, request):
return self.client._request('GET', '{}/whois/{}'.
format(self.url, request['domain']))