ModifyMonitorStatus.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 ModifyMonitorStatusRequest struct {
24 core.JDCloudRequest
25
26 /* 实例所属的地域ID */
27 RegionId string `json:"regionId"`
28
29 /* 域名ID,请使用describeDomains接口获取。 */
30 DomainId string `json:"domainId"`
31
32 /* 监控项ID,请使用describeMonitor接口获取。 */
33 MonitorId string `json:"monitorId"`
34
35 /* 暂停stop, 开启start, 手动恢复recover,手动切换switch,手动恢复和手动切换时候不支持批量操作 */
36 Action string `json:"action"`
37
38 /* 监控项的主机值, 手动切换时必填 (Optional) */
39 SwitchTarget *string `json:"switchTarget"`
40 }
41
42 /*
43 * param regionId: 实例所属的地域ID (Required)
44 * param domainId: 域名ID,请使用describeDomains接口获取。 (Required)
45 * param monitorId: 监控项ID,请使用describeMonitor接口获取。 (Required)
46 * param action: 暂停stop, 开启start, 手动恢复recover,手动切换switch,手动恢复和手动切换时候不支持批量操作 (Required)
47 *
48 * @Deprecated, not compatible when mandatory parameters changed
49 */
50 func NewModifyMonitorStatusRequest(
51 regionId string,
52 domainId string,
53 monitorId string,
54 action string,
55 ) *ModifyMonitorStatusRequest {
56
57 return &ModifyMonitorStatusRequest{
58 JDCloudRequest: core.JDCloudRequest{
59 URL: "/regions/{regionId}/domain/{domainId}/monitor/{monitorId}/status",
60 Method: "PUT",
61 Header: nil,
62 Version: "v2",
63 },
64 RegionId: regionId,
65 DomainId: domainId,
66 MonitorId: monitorId,
67 Action: action,
68 }
69 }
70
71 /*
72 * param regionId: 实例所属的地域ID (Required)
73 * param domainId: 域名ID,请使用describeDomains接口获取。 (Required)
74 * param monitorId: 监控项ID,请使用describeMonitor接口获取。 (Required)
75 * param action: 暂停stop, 开启start, 手动恢复recover,手动切换switch,手动恢复和手动切换时候不支持批量操作 (Required)
76 * param switchTarget: 监控项的主机值, 手动切换时必填 (Optional)
77 */
78 func NewModifyMonitorStatusRequestWithAllParams(
79 regionId string,
80 domainId string,
81 monitorId string,
82 action string,
83 switchTarget *string,
84 ) *ModifyMonitorStatusRequest {
85
86 return &ModifyMonitorStatusRequest{
87 JDCloudRequest: core.JDCloudRequest{
88 URL: "/regions/{regionId}/domain/{domainId}/monitor/{monitorId}/status",
89 Method: "PUT",
90 Header: nil,
91 Version: "v2",
92 },
93 RegionId: regionId,
94 DomainId: domainId,
95 MonitorId: monitorId,
96 Action: action,
97 SwitchTarget: switchTarget,
98 }
99 }
100
101 /* This constructor has better compatible ability when API parameters changed */
102 func NewModifyMonitorStatusRequestWithoutParam() *ModifyMonitorStatusRequest {
103
104 return &ModifyMonitorStatusRequest{
105 JDCloudRequest: core.JDCloudRequest{
106 URL: "/regions/{regionId}/domain/{domainId}/monitor/{monitorId}/status",
107 Method: "PUT",
108 Header: nil,
109 Version: "v2",
110 },
111 }
112 }
113
114 /* param regionId: 实例所属的地域ID(Required) */
115 func (r *ModifyMonitorStatusRequest) SetRegionId(regionId string) {
116 r.RegionId = regionId
117 }
118
119 /* param domainId: 域名ID,请使用describeDomains接口获取。(Required) */
120 func (r *ModifyMonitorStatusRequest) SetDomainId(domainId string) {
121 r.DomainId = domainId
122 }
123
124 /* param monitorId: 监控项ID,请使用describeMonitor接口获取。(Required) */
125 func (r *ModifyMonitorStatusRequest) SetMonitorId(monitorId string) {
126 r.MonitorId = monitorId
127 }
128
129 /* param action: 暂停stop, 开启start, 手动恢复recover,手动切换switch,手动恢复和手动切换时候不支持批量操作(Required) */
130 func (r *ModifyMonitorStatusRequest) SetAction(action string) {
131 r.Action = action
132 }
133
134 /* param switchTarget: 监控项的主机值, 手动切换时必填(Optional) */
135 func (r *ModifyMonitorStatusRequest) SetSwitchTarget(switchTarget string) {
136 r.SwitchTarget = &switchTarget
137 }
138
139 // GetRegionId returns path parameter 'regionId' if exist,
140 // otherwise return empty string
141 func (r ModifyMonitorStatusRequest) GetRegionId() string {
142 return r.RegionId
143 }
144
145 type ModifyMonitorStatusResponse struct {
146 RequestID string `json:"requestId"`
147 Error core.ErrorResponse `json:"error"`
148 Result ModifyMonitorStatusResult `json:"result"`
149 }
150
151 type ModifyMonitorStatusResult struct {
152 }
153