feat: Add scripts to query Vultr DNS domains and records, and create a specific DNS record.
This commit is contained in:
32
create_label_app_record.py
Normal file
32
create_label_app_record.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import sys
|
||||
import os
|
||||
import asyncio
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from src.vultr_mcp.server import create_dns_record
|
||||
|
||||
def main():
|
||||
domain = 'oncloud.my.id'
|
||||
record_name = 'label.app'
|
||||
record_type = 'A'
|
||||
record_data = '103.138.63.186'
|
||||
ttl = 300 # 5 minutes
|
||||
|
||||
print(f"Creating record {record_name}.{domain} -> {record_data}")
|
||||
try:
|
||||
response = create_dns_record(
|
||||
domain=domain,
|
||||
name=record_name,
|
||||
type=record_type,
|
||||
data=record_data,
|
||||
ttl=ttl
|
||||
)
|
||||
print("Response:", response)
|
||||
except Exception as e:
|
||||
print("Error:", e)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user