Skip to content

Commit 0d1519a

Browse files
publish jdcloud-sdk-go version 0.10.45
1 parent ccfb7a7 commit 0d1519a

6 files changed

Lines changed: 296 additions & 2 deletions

File tree

services/cdn/ChangeLog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# 更新历史 #
2-
API版本:0.10.42
2+
API版本:0.10.45
33

44

55

66

77
| 发布时间 | 版本号 | 更新 | 说明 |
88
| ---------- | ------ | ---------------------------------------------------------- | ---- |
9+
| 2023-04-06 | 0.10.45 |domainTxtGenerate、domainTxtValidate txt生成及校验接口对外开放|
10+
| 2023-02-22 | 0.10.44 |增加域名海外CF状态信息|
11+
| 2023-02-06 | 0.10.43 |控制台增加域名备案检查接口|
912
| 2023-01-09 | 0.10.42 |批量下发ip黑名单接口可增加入参可指定下发全部域名|
1013
| 2022-12-29 | 0.10.41 |域名列表详情增加海外状态数据|
1114
| 2022-12-19 | 0.10.40 |商城pin维度离线日志查询接口|
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// Copyright 2018 JDCLOUD.COM
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// NOTE: This class is auto generated by the jdcloud code generator program.
16+
17+
package apis
18+
19+
import (
20+
"github.com/jdcloud-api/jdcloud-sdk-go/core"
21+
)
22+
23+
type DomainTxtGenerateRequest struct {
24+
25+
core.JDCloudRequest
26+
27+
/* 域名 (Optional) */
28+
Domain *string `json:"domain"`
29+
}
30+
31+
/*
32+
*
33+
* @Deprecated, not compatible when mandatory parameters changed
34+
*/
35+
func NewDomainTxtGenerateRequest(
36+
) *DomainTxtGenerateRequest {
37+
38+
return &DomainTxtGenerateRequest{
39+
JDCloudRequest: core.JDCloudRequest{
40+
URL: "/domainTxtGenerate",
41+
Method: "POST",
42+
Header: nil,
43+
Version: "v1",
44+
},
45+
}
46+
}
47+
48+
/*
49+
* param domain: 域名 (Optional)
50+
*/
51+
func NewDomainTxtGenerateRequestWithAllParams(
52+
domain *string,
53+
) *DomainTxtGenerateRequest {
54+
55+
return &DomainTxtGenerateRequest{
56+
JDCloudRequest: core.JDCloudRequest{
57+
URL: "/domainTxtGenerate",
58+
Method: "POST",
59+
Header: nil,
60+
Version: "v1",
61+
},
62+
Domain: domain,
63+
}
64+
}
65+
66+
/* This constructor has better compatible ability when API parameters changed */
67+
func NewDomainTxtGenerateRequestWithoutParam() *DomainTxtGenerateRequest {
68+
69+
return &DomainTxtGenerateRequest{
70+
JDCloudRequest: core.JDCloudRequest{
71+
URL: "/domainTxtGenerate",
72+
Method: "POST",
73+
Header: nil,
74+
Version: "v1",
75+
},
76+
}
77+
}
78+
79+
/* param domain: 域名(Optional) */
80+
func (r *DomainTxtGenerateRequest) SetDomain(domain string) {
81+
r.Domain = &domain
82+
}
83+
84+
85+
// GetRegionId returns path parameter 'regionId' if exist,
86+
// otherwise return empty string
87+
func (r DomainTxtGenerateRequest) GetRegionId() string {
88+
return ""
89+
}
90+
91+
type DomainTxtGenerateResponse struct {
92+
RequestID string `json:"requestId"`
93+
Error core.ErrorResponse `json:"error"`
94+
Result DomainTxtGenerateResult `json:"result"`
95+
}
96+
97+
type DomainTxtGenerateResult struct {
98+
}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
// Copyright 2018 JDCLOUD.COM
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// NOTE: This class is auto generated by the jdcloud code generator program.
16+
17+
package apis
18+
19+
import (
20+
"github.com/jdcloud-api/jdcloud-sdk-go/core"
21+
)
22+
23+
type DomainTxtValidateRequest struct {
24+
25+
core.JDCloudRequest
26+
27+
/* 域名 (Optional) */
28+
Domain *string `json:"domain"`
29+
30+
/* 校验类型,dns or file (Optional) */
31+
ValidateType *string `json:"validateType"`
32+
33+
/* 主机记录,dns验证方式时必传.值为_cdnautover (Optional) */
34+
HostRecord *string `json:"hostRecord"`
35+
36+
/* 主机记录值 (Optional) */
37+
Txt *string `json:"txt"`
38+
39+
/* file验证方式时必传 (Optional) */
40+
Url *string `json:"url"`
41+
}
42+
43+
/*
44+
*
45+
* @Deprecated, not compatible when mandatory parameters changed
46+
*/
47+
func NewDomainTxtValidateRequest(
48+
) *DomainTxtValidateRequest {
49+
50+
return &DomainTxtValidateRequest{
51+
JDCloudRequest: core.JDCloudRequest{
52+
URL: "/domainTxtValidate",
53+
Method: "POST",
54+
Header: nil,
55+
Version: "v1",
56+
},
57+
}
58+
}
59+
60+
/*
61+
* param domain: 域名 (Optional)
62+
* param validateType: 校验类型,dns or file (Optional)
63+
* param hostRecord: 主机记录,dns验证方式时必传.值为_cdnautover (Optional)
64+
* param txt: 主机记录值 (Optional)
65+
* param url: file验证方式时必传 (Optional)
66+
*/
67+
func NewDomainTxtValidateRequestWithAllParams(
68+
domain *string,
69+
validateType *string,
70+
hostRecord *string,
71+
txt *string,
72+
url *string,
73+
) *DomainTxtValidateRequest {
74+
75+
return &DomainTxtValidateRequest{
76+
JDCloudRequest: core.JDCloudRequest{
77+
URL: "/domainTxtValidate",
78+
Method: "POST",
79+
Header: nil,
80+
Version: "v1",
81+
},
82+
Domain: domain,
83+
ValidateType: validateType,
84+
HostRecord: hostRecord,
85+
Txt: txt,
86+
Url: url,
87+
}
88+
}
89+
90+
/* This constructor has better compatible ability when API parameters changed */
91+
func NewDomainTxtValidateRequestWithoutParam() *DomainTxtValidateRequest {
92+
93+
return &DomainTxtValidateRequest{
94+
JDCloudRequest: core.JDCloudRequest{
95+
URL: "/domainTxtValidate",
96+
Method: "POST",
97+
Header: nil,
98+
Version: "v1",
99+
},
100+
}
101+
}
102+
103+
/* param domain: 域名(Optional) */
104+
func (r *DomainTxtValidateRequest) SetDomain(domain string) {
105+
r.Domain = &domain
106+
}
107+
/* param validateType: 校验类型,dns or file(Optional) */
108+
func (r *DomainTxtValidateRequest) SetValidateType(validateType string) {
109+
r.ValidateType = &validateType
110+
}
111+
/* param hostRecord: 主机记录,dns验证方式时必传.值为_cdnautover(Optional) */
112+
func (r *DomainTxtValidateRequest) SetHostRecord(hostRecord string) {
113+
r.HostRecord = &hostRecord
114+
}
115+
/* param txt: 主机记录值(Optional) */
116+
func (r *DomainTxtValidateRequest) SetTxt(txt string) {
117+
r.Txt = &txt
118+
}
119+
/* param url: file验证方式时必传(Optional) */
120+
func (r *DomainTxtValidateRequest) SetUrl(url string) {
121+
r.Url = &url
122+
}
123+
124+
125+
// GetRegionId returns path parameter 'regionId' if exist,
126+
// otherwise return empty string
127+
func (r DomainTxtValidateRequest) GetRegionId() string {
128+
return ""
129+
}
130+
131+
type DomainTxtValidateResponse struct {
132+
RequestID string `json:"requestId"`
133+
Error core.ErrorResponse `json:"error"`
134+
Result DomainTxtValidateResult `json:"result"`
135+
}
136+
137+
type DomainTxtValidateResult struct {
138+
Pass bool `json:"pass"`
139+
ErrMsg string `json:"errMsg"`
140+
}

services/cdn/apis/GetDomainList.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ type GetDomainListRequest struct {
4242

4343
/* 加速区域,(mainLand:中国大陆,nonMainLand:海外加港澳台,all:全球),不传为全球 (Optional) */
4444
AccelerateRegion *string `json:"accelerateRegion"`
45+
46+
/* 筛选依据(false不需要查询, true 需要查询海外状态)默认false (Optional) */
47+
WithThirdPartyStatus *bool `json:"withThirdPartyStatus"`
4548
}
4649

4750
/*
@@ -68,6 +71,7 @@ func NewGetDomainListRequest(
6871
* param status: 根据域名状态查询, 可选值[offline, online, configuring, auditing, audit_reject] (Optional)
6972
* param type_: 域名类型,(web:静态小文件,download:大文件加速,vod:视频加速,live:直播加速),不传查所有 (Optional)
7073
* param accelerateRegion: 加速区域,(mainLand:中国大陆,nonMainLand:海外加港澳台,all:全球),不传为全球 (Optional)
74+
* param withThirdPartyStatus: 筛选依据(false不需要查询, true 需要查询海外状态)默认false (Optional)
7175
*/
7276
func NewGetDomainListRequestWithAllParams(
7377
keyWord *string,
@@ -76,6 +80,7 @@ func NewGetDomainListRequestWithAllParams(
7680
status *string,
7781
type_ *string,
7882
accelerateRegion *string,
83+
withThirdPartyStatus *bool,
7984
) *GetDomainListRequest {
8085

8186
return &GetDomainListRequest{
@@ -91,6 +96,7 @@ func NewGetDomainListRequestWithAllParams(
9196
Status: status,
9297
Type: type_,
9398
AccelerateRegion: accelerateRegion,
99+
WithThirdPartyStatus: withThirdPartyStatus,
94100
}
95101
}
96102

@@ -131,6 +137,10 @@ func (r *GetDomainListRequest) SetType(type_ string) {
131137
func (r *GetDomainListRequest) SetAccelerateRegion(accelerateRegion string) {
132138
r.AccelerateRegion = &accelerateRegion
133139
}
140+
/* param withThirdPartyStatus: 筛选依据(false不需要查询, true 需要查询海外状态)默认false(Optional) */
141+
func (r *GetDomainListRequest) SetWithThirdPartyStatus(withThirdPartyStatus bool) {
142+
r.WithThirdPartyStatus = &withThirdPartyStatus
143+
}
134144

135145

136146
// GetRegionId returns path parameter 'regionId' if exist,

services/cdn/client/CdnClient.go

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func NewCdnClient(credential *core.Credential) *CdnClient {
4040
Credential: *credential,
4141
Config: *config,
4242
ServiceName: "cdn",
43-
Revision: "0.10.42",
43+
Revision: "0.10.45",
4444
Logger: core.NewDefaultLogger(core.LogInfo),
4545
}}
4646
}
@@ -2437,6 +2437,26 @@ func (c *CdnClient) DisableWafBlackRules(request *cdn.DisableWafBlackRulesReques
24372437
return jdResp, err
24382438
}
24392439

2440+
/* 域名txt记录生成 */
2441+
func (c *CdnClient) DomainTxtGenerate(request *cdn.DomainTxtGenerateRequest) (*cdn.DomainTxtGenerateResponse, error) {
2442+
if request == nil {
2443+
return nil, errors.New("Request object is nil. ")
2444+
}
2445+
resp, err := c.Send(request, c.ServiceName)
2446+
if err != nil {
2447+
return nil, err
2448+
}
2449+
2450+
jdResp := &cdn.DomainTxtGenerateResponse{}
2451+
err = json.Unmarshal(resp, jdResp)
2452+
if err != nil {
2453+
c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
2454+
return nil, err
2455+
}
2456+
2457+
return jdResp, err
2458+
}
2459+
24402460
/* 查询web防护开关 */
24412461
func (c *CdnClient) QueryWebProtectSettings(request *cdn.QueryWebProtectSettingsRequest) (*cdn.QueryWebProtectSettingsResponse, error) {
24422462
if request == nil {
@@ -2777,6 +2797,26 @@ func (c *CdnClient) ConfigBackSourceRules(request *cdn.ConfigBackSourceRulesRequ
27772797
return jdResp, err
27782798
}
27792799

2800+
/* 域名txt校验 */
2801+
func (c *CdnClient) DomainTxtValidate(request *cdn.DomainTxtValidateRequest) (*cdn.DomainTxtValidateResponse, error) {
2802+
if request == nil {
2803+
return nil, errors.New("Request object is nil. ")
2804+
}
2805+
resp, err := c.Send(request, c.ServiceName)
2806+
if err != nil {
2807+
return nil, err
2808+
}
2809+
2810+
jdResp := &cdn.DomainTxtValidateResponse{}
2811+
err = json.Unmarshal(resp, jdResp)
2812+
if err != nil {
2813+
c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
2814+
return nil, err
2815+
}
2816+
2817+
return jdResp, err
2818+
}
2819+
27802820
/* 查询统计数据并进行汇总加和 */
27812821
func (c *CdnClient) QueryStatisticsDataGroupSum(request *cdn.QueryStatisticsDataGroupSumRequest) (*cdn.QueryStatisticsDataGroupSumResponse, error) {
27822822
if request == nil {

services/cdn/models/ListDomainItem.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,7 @@ type ListDomainItem struct {
4848

4949
/* (Optional) */
5050
AccelerateRegion string `json:"accelerateRegion"`
51+
52+
/* 海外状态(-1:不涉及海外加速,0:未激活,1:已激活,2:域名在cf不存在) (Optional) */
53+
OverseaStatus int64 `json:"overseaStatus"`
5154
}

0 commit comments

Comments
 (0)