DescribeDomainQueryTraffic.go raw
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/go-acme/jdcloud-sdk-go/core"
21 )
22
23 type DescribeDomainQueryTrafficRequest struct {
24 core.JDCloudRequest
25
26 /* 实例所属的地域ID */
27 RegionId string `json:"regionId"`
28
29 /* 域名ID,请使用describeDomains接口获取。 */
30 DomainId string `json:"domainId"`
31
32 /* 主域名,请使用describeDomains接口获取 */
33 DomainName string `json:"domainName"`
34
35 /* 时间段的起始时间, UTC时间格式,例如2017-11-10T23:00:00Z */
36 Start string `json:"start"`
37
38 /* 时间段的终止时间, UTC时间格式,例如2017-11-10T23:00:00Z */
39 End string `json:"end"`
40 }
41
42 /*
43 * param regionId: 实例所属的地域ID (Required)
44 * param domainId: 域名ID,请使用describeDomains接口获取。 (Required)
45 * param domainName: 主域名,请使用describeDomains接口获取 (Required)
46 * param start: 时间段的起始时间, UTC时间格式,例如2017-11-10T23:00:00Z (Required)
47 * param end: 时间段的终止时间, UTC时间格式,例如2017-11-10T23:00:00Z (Required)
48 *
49 * @Deprecated, not compatible when mandatory parameters changed
50 */
51 func NewDescribeDomainQueryTrafficRequest(
52 regionId string,
53 domainId string,
54 domainName string,
55 start string,
56 end string,
57 ) *DescribeDomainQueryTrafficRequest {
58
59 return &DescribeDomainQueryTrafficRequest{
60 JDCloudRequest: core.JDCloudRequest{
61 URL: "/regions/{regionId}/domain/{domainId}/queryTraffic",
62 Method: "GET",
63 Header: nil,
64 Version: "v2",
65 },
66 RegionId: regionId,
67 DomainId: domainId,
68 DomainName: domainName,
69 Start: start,
70 End: end,
71 }
72 }
73
74 /*
75 * param regionId: 实例所属的地域ID (Required)
76 * param domainId: 域名ID,请使用describeDomains接口获取。 (Required)
77 * param domainName: 主域名,请使用describeDomains接口获取 (Required)
78 * param start: 时间段的起始时间, UTC时间格式,例如2017-11-10T23:00:00Z (Required)
79 * param end: 时间段的终止时间, UTC时间格式,例如2017-11-10T23:00:00Z (Required)
80 */
81 func NewDescribeDomainQueryTrafficRequestWithAllParams(
82 regionId string,
83 domainId string,
84 domainName string,
85 start string,
86 end string,
87 ) *DescribeDomainQueryTrafficRequest {
88
89 return &DescribeDomainQueryTrafficRequest{
90 JDCloudRequest: core.JDCloudRequest{
91 URL: "/regions/{regionId}/domain/{domainId}/queryTraffic",
92 Method: "GET",
93 Header: nil,
94 Version: "v2",
95 },
96 RegionId: regionId,
97 DomainId: domainId,
98 DomainName: domainName,
99 Start: start,
100 End: end,
101 }
102 }
103
104 /* This constructor has better compatible ability when API parameters changed */
105 func NewDescribeDomainQueryTrafficRequestWithoutParam() *DescribeDomainQueryTrafficRequest {
106
107 return &DescribeDomainQueryTrafficRequest{
108 JDCloudRequest: core.JDCloudRequest{
109 URL: "/regions/{regionId}/domain/{domainId}/queryTraffic",
110 Method: "GET",
111 Header: nil,
112 Version: "v2",
113 },
114 }
115 }
116
117 /* param regionId: 实例所属的地域ID(Required) */
118 func (r *DescribeDomainQueryTrafficRequest) SetRegionId(regionId string) {
119 r.RegionId = regionId
120 }
121
122 /* param domainId: 域名ID,请使用describeDomains接口获取。(Required) */
123 func (r *DescribeDomainQueryTrafficRequest) SetDomainId(domainId string) {
124 r.DomainId = domainId
125 }
126
127 /* param domainName: 主域名,请使用describeDomains接口获取(Required) */
128 func (r *DescribeDomainQueryTrafficRequest) SetDomainName(domainName string) {
129 r.DomainName = domainName
130 }
131
132 /* param start: 时间段的起始时间, UTC时间格式,例如2017-11-10T23:00:00Z(Required) */
133 func (r *DescribeDomainQueryTrafficRequest) SetStart(start string) {
134 r.Start = start
135 }
136
137 /* param end: 时间段的终止时间, UTC时间格式,例如2017-11-10T23:00:00Z(Required) */
138 func (r *DescribeDomainQueryTrafficRequest) SetEnd(end string) {
139 r.End = end
140 }
141
142 // GetRegionId returns path parameter 'regionId' if exist,
143 // otherwise return empty string
144 func (r DescribeDomainQueryTrafficRequest) GetRegionId() string {
145 return r.RegionId
146 }
147
148 type DescribeDomainQueryTrafficResponse struct {
149 RequestID string `json:"requestId"`
150 Error core.ErrorResponse `json:"error"`
151 Result DescribeDomainQueryTrafficResult `json:"result"`
152 }
153
154 type DescribeDomainQueryTrafficResult struct {
155 Time []int64 `json:"time"`
156 Unit string `json:"unit"`
157 Traffic []float64 `json:"traffic"`
158 }
159