feat: Add scripts to query Vultr DNS domains and records, and create a specific DNS record.

This commit is contained in:
Wartana
2026-02-28 08:37:32 +08:00
parent 41c2fa5fcc
commit 0c15ea7b46
2 changed files with 58 additions and 0 deletions

26
query_oncloud.py Normal file
View File

@@ -0,0 +1,26 @@
import sys
import os
from dotenv import load_dotenv
load_dotenv()
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from src.vultr_mcp.server import list_dns_domains, list_dns_records
def main():
domains_response = list_dns_domains()
print("Domains Response:", domains_response)
domains = domains_response if isinstance(domains_response, list) else domains_response.get("domains", [])
for d in domains:
domain_name = d if isinstance(d, str) else d.get('domain', '')
if 'oncloud' in domain_name:
print(f"Found oncloud domain: {domain_name}")
records_response = list_dns_records(domain=domain_name)
print(f"Records for {domain_name}:")
records = records_response if isinstance(records_response, list) else records_response.get("records", [])
for r in records:
print(r)
if __name__ == "__main__":
main()