tencentcloud-sdk-advisor 1.0.200

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6df9627ffeccc1d61d41c12cbe9b2b1f2f576132
4
+ data.tar.gz: d66187131b6490dabe61880a2f86df960ab9ec76
5
+ SHA512:
6
+ metadata.gz: 5ed52d5aedd57b06a1275ce70c1e45b7738a86f5a746aeb57d3ebd829e148739541a413f4dbe1fa235adf743bf94b8a09dd04e53fb4e0f21f3f8549b79f3c72a
7
+ data.tar.gz: bb1e87beda9364784bb5d39481a972bb60d0907601adbae45455402bab6405b515a387d179184d3e5e0f61e9c56a54b06be9d2ba3b097cf364bae6edcdc5f11b
data/lib/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.200
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tencentcloud-sdk-common'
4
+
5
+ require_relative 'v20200721/client'
6
+ require_relative 'v20200721/models'
7
+
8
+ module TencentCloud
9
+ module Advisor
10
+ end
11
+ end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require 'json'
18
+
19
+ module TencentCloud
20
+ module Advisor
21
+ module V20200721
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2020-07-21'
26
+ api_endpoint = 'advisor.tencentcloudapi.com'
27
+ sdk_version = 'ADVISOR_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 用于查询评估项的信息
33
+
34
+ # @param request: Request instance for DescribeStrategies.
35
+ # @type request: :class:`Tencentcloud::advisor::V20200721::DescribeStrategiesRequest`
36
+ # @rtype: :class:`Tencentcloud::advisor::V20200721::DescribeStrategiesResponse`
37
+ def DescribeStrategies(request)
38
+ body = send_request('DescribeStrategies', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = DescribeStrategiesResponse.new
42
+ model.deserialize(response['Response'])
43
+ model
44
+ else
45
+ code = response['Response']['Error']['Code']
46
+ message = response['Response']['Error']['Message']
47
+ reqid = response['Response']['RequestId']
48
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
49
+ end
50
+ rescue TencentCloud::Common::TencentCloudSDKException => e
51
+ raise e
52
+ rescue StandardError => e
53
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
54
+ end
55
+
56
+ # 查询评估项风险实例列表
57
+
58
+ # @param request: Request instance for DescribeTaskStrategyRisks.
59
+ # @type request: :class:`Tencentcloud::advisor::V20200721::DescribeTaskStrategyRisksRequest`
60
+ # @rtype: :class:`Tencentcloud::advisor::V20200721::DescribeTaskStrategyRisksResponse`
61
+ def DescribeTaskStrategyRisks(request)
62
+ body = send_request('DescribeTaskStrategyRisks', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = DescribeTaskStrategyRisksResponse.new
66
+ model.deserialize(response['Response'])
67
+ model
68
+ else
69
+ code = response['Response']['Error']['Code']
70
+ message = response['Response']['Error']['Message']
71
+ reqid = response['Response']['RequestId']
72
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
73
+ end
74
+ rescue TencentCloud::Common::TencentCloudSDKException => e
75
+ raise e
76
+ rescue StandardError => e
77
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
78
+ end
79
+
80
+
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,285 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ module TencentCloud
18
+ module Advisor
19
+ module V20200721
20
+ # 评估项信息
21
+ class DescribeStrategie < TencentCloud::Common::AbstractModel
22
+ # @param StrategyId: 评估项ID
23
+ # 注意:此字段可能返回 null,表示取不到有效值。
24
+ # @type StrategyId: Integer
25
+ # @param Name: 评估项名称
26
+ # 注意:此字段可能返回 null,表示取不到有效值。
27
+ # @type Name: String
28
+ # @param Desc: 评估项描述
29
+ # 注意:此字段可能返回 null,表示取不到有效值。
30
+ # @type Desc: String
31
+ # @param Product: 评估项对应产品ID
32
+ # 注意:此字段可能返回 null,表示取不到有效值。
33
+ # @type Product: String
34
+ # @param ProductDesc: 评估项对应产品名称
35
+ # 注意:此字段可能返回 null,表示取不到有效值。
36
+ # @type ProductDesc: String
37
+ # @param Repair: 评估项优化建议
38
+ # 注意:此字段可能返回 null,表示取不到有效值。
39
+ # @type Repair: String
40
+ # @param GroupId: 评估项类别ID
41
+ # 注意:此字段可能返回 null,表示取不到有效值。
42
+ # @type GroupId: Integer
43
+ # @param GroupName: 评估项类别名称
44
+ # 注意:此字段可能返回 null,表示取不到有效值。
45
+ # @type GroupName: String
46
+ # @param Conditions: 评估项风险列表
47
+ # 注意:此字段可能返回 null,表示取不到有效值。
48
+ # @type Conditions: Array
49
+
50
+ attr_accessor :StrategyId, :Name, :Desc, :Product, :ProductDesc, :Repair, :GroupId, :GroupName, :Conditions
51
+
52
+ def initialize(strategyid=nil, name=nil, desc=nil, product=nil, productdesc=nil, repair=nil, groupid=nil, groupname=nil, conditions=nil)
53
+ @StrategyId = strategyid
54
+ @Name = name
55
+ @Desc = desc
56
+ @Product = product
57
+ @ProductDesc = productdesc
58
+ @Repair = repair
59
+ @GroupId = groupid
60
+ @GroupName = groupname
61
+ @Conditions = conditions
62
+ end
63
+
64
+ def deserialize(params)
65
+ @StrategyId = params['StrategyId']
66
+ @Name = params['Name']
67
+ @Desc = params['Desc']
68
+ @Product = params['Product']
69
+ @ProductDesc = params['ProductDesc']
70
+ @Repair = params['Repair']
71
+ @GroupId = params['GroupId']
72
+ @GroupName = params['GroupName']
73
+ unless params['Conditions'].nil?
74
+ @Conditions = []
75
+ params['Conditions'].each do |i|
76
+ describestrategiescondition_tmp = DescribeStrategiesCondition.new
77
+ describestrategiescondition_tmp.deserialize(i)
78
+ @Conditions << describestrategiescondition_tmp
79
+ end
80
+ end
81
+ end
82
+ end
83
+
84
+ # 评估项警告条件
85
+ class DescribeStrategiesCondition < TencentCloud::Common::AbstractModel
86
+ # @param ConditionId: 警告条件ID
87
+ # 注意:此字段可能返回 null,表示取不到有效值。
88
+ # @type ConditionId: Integer
89
+ # @param Level: 警告级别,2:中风险,3:高风险
90
+ # 注意:此字段可能返回 null,表示取不到有效值。
91
+ # @type Level: Integer
92
+ # @param LevelDesc: 警告级别描述
93
+ # 注意:此字段可能返回 null,表示取不到有效值。
94
+ # @type LevelDesc: String
95
+ # @param Desc: 警告条件描述
96
+ # @type Desc: String
97
+
98
+ attr_accessor :ConditionId, :Level, :LevelDesc, :Desc
99
+
100
+ def initialize(conditionid=nil, level=nil, leveldesc=nil, desc=nil)
101
+ @ConditionId = conditionid
102
+ @Level = level
103
+ @LevelDesc = leveldesc
104
+ @Desc = desc
105
+ end
106
+
107
+ def deserialize(params)
108
+ @ConditionId = params['ConditionId']
109
+ @Level = params['Level']
110
+ @LevelDesc = params['LevelDesc']
111
+ @Desc = params['Desc']
112
+ end
113
+ end
114
+
115
+ # DescribeStrategies请求参数结构体
116
+ class DescribeStrategiesRequest < TencentCloud::Common::AbstractModel
117
+
118
+
119
+ def initialize()
120
+ end
121
+
122
+ def deserialize(params)
123
+ end
124
+ end
125
+
126
+ # DescribeStrategies返回参数结构体
127
+ class DescribeStrategiesResponse < TencentCloud::Common::AbstractModel
128
+ # @param Strategies: 评估项列表
129
+ # 注意:此字段可能返回 null,表示取不到有效值。
130
+ # @type Strategies: Array
131
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
132
+ # @type RequestId: String
133
+
134
+ attr_accessor :Strategies, :RequestId
135
+
136
+ def initialize(strategies=nil, requestid=nil)
137
+ @Strategies = strategies
138
+ @RequestId = requestid
139
+ end
140
+
141
+ def deserialize(params)
142
+ unless params['Strategies'].nil?
143
+ @Strategies = []
144
+ params['Strategies'].each do |i|
145
+ describestrategie_tmp = DescribeStrategie.new
146
+ describestrategie_tmp.deserialize(i)
147
+ @Strategies << describestrategie_tmp
148
+ end
149
+ end
150
+ @RequestId = params['RequestId']
151
+ end
152
+ end
153
+
154
+ # DescribeTaskStrategyRisks请求参数结构体
155
+ class DescribeTaskStrategyRisksRequest < TencentCloud::Common::AbstractModel
156
+ # @param StrategyId: 评估项ID
157
+ # @type StrategyId: Integer
158
+ # @param Limit: 限制数量,默认100
159
+ # @type Limit: Integer
160
+ # @param Offset: 偏移量,默认0
161
+ # @type Offset: Integer
162
+
163
+ attr_accessor :StrategyId, :Limit, :Offset
164
+
165
+ def initialize(strategyid=nil, limit=nil, offset=nil)
166
+ @StrategyId = strategyid
167
+ @Limit = limit
168
+ @Offset = offset
169
+ end
170
+
171
+ def deserialize(params)
172
+ @StrategyId = params['StrategyId']
173
+ @Limit = params['Limit']
174
+ @Offset = params['Offset']
175
+ end
176
+ end
177
+
178
+ # DescribeTaskStrategyRisks返回参数结构体
179
+ class DescribeTaskStrategyRisksResponse < TencentCloud::Common::AbstractModel
180
+ # @param RiskFieldsDesc: 根据此配置,匹配风险实例列表(Risks)对应字段,例如:
181
+ # {"Response":{"RequestId":"111","RiskFieldsDesc":[{"Field":"InstanceId","FieldName":"ID","FieldType":"string","FieldDict":{}},{"Field":"InstanceName","FieldName":"名称","FieldType":"string","FieldDict":{}},{"Field":"InstanceState","FieldName":"状态","FieldType":"string","FieldDict":{"LAUNCH_FAILED":"创建失败","PENDING":"创建中","REBOOTING":"重启中","RUNNING":"运行中","SHUTDOWN":"停止待销毁","STARTING":"开机中","STOPPED":"关机","STOPPING":"关机中","TERMINATING":"销毁中"}},{"Field":"Zone","FieldName":"可用区","FieldType":"string","FieldDict":{}},{"Field":"PrivateIPAddresses","FieldName":"IP地址(内)","FieldType":"stringSlice","FieldDict":{}},{"Field":"PublicIPAddresses","FieldName":"IP地址(公)","FieldType":"stringSlice","FieldDict":{}},{"Field":"Region","FieldName":"地域","FieldType":"string","FieldDict":{}},{"Field":"Tags","FieldName":"标签","FieldType":"tags","FieldDict":{}}],"RiskTotalCount":3,"Risks":"[{\"InstanceId\":\"ins-xxx1\",\"InstanceName\":\"xxx1\",\"InstanceState\":\"RUNNING\",\"PrivateIPAddresses\":[\"1.17.64.2\"],\"PublicIPAddresses\":null,\"Region\":\"ap-shanghai\",\"Tags\":null,\"Zone\":\"ap-shanghai-2\"},{\"InstanceId\":\"ins-xxx2\",\"InstanceName\":\"xxx2\",\"InstanceState\":\"RUNNING\",\"PrivateIPAddresses\":[\"1.17.64.11\"],\"PublicIPAddresses\":null,\"Region\":\"ap-shanghai\",\"Tags\":null,\"Zone\":\"ap-shanghai-2\"}]","StrategyId":9}}
182
+ # 注意:此字段可能返回 null,表示取不到有效值。
183
+ # @type RiskFieldsDesc: Array
184
+ # @param StrategyId: 评估项ID
185
+ # 注意:此字段可能返回 null,表示取不到有效值。
186
+ # @type StrategyId: Integer
187
+ # @param RiskTotalCount: 风险实例个数
188
+ # 注意:此字段可能返回 null,表示取不到有效值。
189
+ # @type RiskTotalCount: Integer
190
+ # @param Risks: 风险实例详情列表,需要json decode
191
+ # 注意:此字段可能返回 null,表示取不到有效值。
192
+ # @type Risks: String
193
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
194
+ # @type RequestId: String
195
+
196
+ attr_accessor :RiskFieldsDesc, :StrategyId, :RiskTotalCount, :Risks, :RequestId
197
+
198
+ def initialize(riskfieldsdesc=nil, strategyid=nil, risktotalcount=nil, risks=nil, requestid=nil)
199
+ @RiskFieldsDesc = riskfieldsdesc
200
+ @StrategyId = strategyid
201
+ @RiskTotalCount = risktotalcount
202
+ @Risks = risks
203
+ @RequestId = requestid
204
+ end
205
+
206
+ def deserialize(params)
207
+ unless params['RiskFieldsDesc'].nil?
208
+ @RiskFieldsDesc = []
209
+ params['RiskFieldsDesc'].each do |i|
210
+ riskfieldsdesc_tmp = RiskFieldsDesc.new
211
+ riskfieldsdesc_tmp.deserialize(i)
212
+ @RiskFieldsDesc << riskfieldsdesc_tmp
213
+ end
214
+ end
215
+ @StrategyId = params['StrategyId']
216
+ @RiskTotalCount = params['RiskTotalCount']
217
+ @Risks = params['Risks']
218
+ @RequestId = params['RequestId']
219
+ end
220
+ end
221
+
222
+ # 键值对
223
+ class KeyValue < TencentCloud::Common::AbstractModel
224
+ # @param Key: 键名
225
+ # @type Key: String
226
+ # @param Value: 键名对应值
227
+ # @type Value: String
228
+
229
+ attr_accessor :Key, :Value
230
+
231
+ def initialize(key=nil, value=nil)
232
+ @Key = key
233
+ @Value = value
234
+ end
235
+
236
+ def deserialize(params)
237
+ @Key = params['Key']
238
+ @Value = params['Value']
239
+ end
240
+ end
241
+
242
+ # 风险实例字段描述
243
+ class RiskFieldsDesc < TencentCloud::Common::AbstractModel
244
+ # @param Field: 字段ID
245
+ # @type Field: String
246
+ # @param FieldName: 字段名称
247
+ # @type FieldName: String
248
+ # @param FieldType: 字段类型,
249
+ # string: 字符串类型,例如"aa"
250
+ # int: 整形,例如 111
251
+ # stringSlice : 字符串数组类型,例如["a", "b"]
252
+ # tags: 标签类型, 例如: [{"Key":"kkk","Value":"vvv"},{"Key":"kkk2","Value":"vvv2"}]
253
+ # @type FieldType: String
254
+ # @param FieldDict: 字段值对应字典
255
+ # 注意:此字段可能返回 null,表示取不到有效值。
256
+ # @type FieldDict: Array
257
+
258
+ attr_accessor :Field, :FieldName, :FieldType, :FieldDict
259
+
260
+ def initialize(field=nil, fieldname=nil, fieldtype=nil, fielddict=nil)
261
+ @Field = field
262
+ @FieldName = fieldname
263
+ @FieldType = fieldtype
264
+ @FieldDict = fielddict
265
+ end
266
+
267
+ def deserialize(params)
268
+ @Field = params['Field']
269
+ @FieldName = params['FieldName']
270
+ @FieldType = params['FieldType']
271
+ unless params['FieldDict'].nil?
272
+ @FieldDict = []
273
+ params['FieldDict'].each do |i|
274
+ keyvalue_tmp = KeyValue.new
275
+ keyvalue_tmp.deserialize(i)
276
+ @FieldDict << keyvalue_tmp
277
+ end
278
+ end
279
+ end
280
+ end
281
+
282
+ end
283
+ end
284
+ end
285
+
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tencentcloud-sdk-advisor
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.200
5
+ platform: ruby
6
+ authors:
7
+ - Tencent Cloud
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-11-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: tencentcloud-sdk-common
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ description: Tencent Cloud Ruby SDK is the official software development kit, which
28
+ allows Ruby developers to write software that makes use of Tencent Cloud service
29
+ ADVISOR.
30
+ email:
31
+ - tencentcloudapi@tencent.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - lib/VERSION
37
+ - lib/tencentcloud-sdk-advisor.rb
38
+ - lib/v20200721/client.rb
39
+ - lib/v20200721/models.rb
40
+ homepage: https://github.com/TencentCloud/tencentcloud-sdk-ruby
41
+ licenses:
42
+ - Apache-2.0
43
+ metadata:
44
+ source_code_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/tencentcloud-sdk-advisor
45
+ changelog_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/blob/master/CHANGELOG.md
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubyforge_project:
62
+ rubygems_version: 2.6.14
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Tencent Cloud SDK for Ruby - ADVISOR
66
+ test_files: []