示例#1
0
        public static async Task <DomainLogReturnValue> GetLog(int domainID)
        {
            var requestModel = DDnsSharpRuntime.NewRequestModel <DomainInfoRequestModel>();

            requestModel.DomainID = domainID;
            return(await ServiceHelper.AccessAPI <DomainLogReturnValue>(SERVICE_NAME, "Log", requestModel));
        }
示例#2
0
        public static async Task <UserInfoReturnValue> GetUserInfo()
        {
            var requestModel = DDnsSharpRuntime.NewRequestModel <RequestModelBase>();
            var url          = ServiceHelper.BuildAPIUrl("User", "Detail");

            return(await ServiceHelper.AccessAPI <UserInfoReturnValue>(url, requestModel));
        }
示例#3
0
        public static async Task <DomainInfoReturnValue> GetInfo(string domainName)
        {
            var requestModel = DDnsSharpRuntime.NewRequestModel <DomainInfoRequestModel>();

            requestModel.DomainName = domainName;
            return(await ServiceHelper.AccessAPI <DomainInfoReturnValue>(SERVICE_NAME, "Info", requestModel));
        }
示例#4
0
        public static async Task <ReturnValueBase> GetAPIVersion()
        {
            var requestModel = DDnsSharpRuntime.NewRequestModel <RequestModelBase>();
            var url          = ServiceHelper.BuildAPIUrl("Info", "Version");

            return(await ServiceHelper.AccessAPI <ReturnValueBase>(url, requestModel));
        }
示例#5
0
        public static async Task <DomainListRetrunValue> GetList(string domainType = "all", string groupID = null)
        {
            var requestModel = DDnsSharpRuntime.NewRequestModel <DomainListRequestModel>();

            requestModel.Type    = domainType;
            requestModel.GroupID = groupID;
            return(await ServiceHelper.AccessAPI <DomainListRetrunValue>(SERVICE_NAME, "List", requestModel));
        }
示例#6
0
        public static async Task <RecordListReturnValue> GetList(int domainID, string subDomain = null)
        {
            var m = DDnsSharpRuntime.NewRequestModel <RecordListRequestModel>();

            m.DomainID  = domainID;
            m.SubDomain = subDomain;
            return(await ServiceHelper.Current.AccessAPI <RecordListReturnValue>(SERVICE_NAME, "List", m));
        }
示例#7
0
        public static async Task <RecordChangedReturnValue> UpdateDDNS(int domainID, int recordID, string subDomain, string line)
        {
            var model = DDnsSharpRuntime.NewRequestModel <UpdateDDNSRequestModel>();

            model.DomainID  = domainID;
            model.RecordID  = recordID;
            model.SubDomain = subDomain;
            model.LineName  = line;
            return(await ServiceHelper.Current.AccessAPI <RecordChangedReturnValue>(SERVICE_NAME, "Ddns", model));
        }
示例#8
0
        public static async Task <RecordChangedReturnValue> CreateRecord(int domainID, string subDomain, string recordType,
                                                                         string line, string value, int mx, int ttl)
        {
            if (ttl < 1 || ttl > 604800)
            {
                ttl = 600;
            }
            var m = DDnsSharpRuntime.NewRequestModel <CreateRecordRequestModel>();

            m.DomainID   = domainID;
            m.SubDomain  = subDomain;
            m.RecordType = recordType;
            m.LineName   = line;
            m.Value      = value;
            m.MX         = mx;
            m.TTL        = ttl;
            return(await ServiceHelper.Current.AccessAPI <RecordChangedReturnValue>(SERVICE_NAME, "Create", m));
        }