Exemplo n.º 1
0
        public async Task <DnspodDomainListResult> List()
        {
            var args    = framework.getArgs();
            var content = new FormUrlEncodedContent(args);

            return(await DnspodApi.post <DnspodDomainListResult>("Domain.List", content));
        }
Exemplo n.º 2
0
        public async Task <DnspodRecordListResult> List(int domain_id)
        {
            var args = framework.getArgs();

            args["domain_id"] = domain_id.ToString();
            var content = new FormUrlEncodedContent(args);

            return(await DnspodApi.post <DnspodRecordListResult>("Record.List", content));
        }
Exemplo n.º 3
0
        public async Task <DnspodResult> Remove(int domain_id, int record_id)
        {
            var args = framework.getArgs();

            args["domain_id"] = domain_id.ToString();
            args["record_id"] = record_id.ToString();
            var content = new FormUrlEncodedContent(args);

            return(await DnspodApi.post <DnspodRecordCreateResult>("Record.Remove", content));
        }
Exemplo n.º 4
0
        public static async Task <DnspodApiItem> Create(string token)
        {
            var api     = new DnspodApi(token);
            var domains = (await api.Domain.List()).domains;

            return(new DnspodApiItem()
            {
                api = api,
                domains = domains,
            });
        }
Exemplo n.º 5
0
        /// <summary>
        /// 创建dns记录
        /// </summary>
        /// <param name="domain_id"></param>
        /// <param name="name"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public async Task <DnspodRecordCreateResult> Create(int domain_id, string sub_domain, string value)
        {
            var args = framework.getArgs();

            args["domain_id"]   = domain_id.ToString();
            args["sub_domain"]  = sub_domain;
            args["record_type"] = "TXT";
            args["record_line"] = "默认";
            args["value"]       = value;
            var content = new FormUrlEncodedContent(args);

            return(await DnspodApi.post <DnspodRecordCreateResult>("Record.Create", content));
        }
Exemplo n.º 6
0
 public DomainApi(DnspodApi framework)
 {
     this.framework = framework;
 }
Exemplo n.º 7
0
 public RecordApi(DnspodApi framework)
 {
     this.framework = framework;
 }