tencentcloud-sdk-monitor 3.0.1000 → 3.0.1001

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5687862c350b14750bcfcac43fa1f9d64807d85
4
- data.tar.gz: dd2ffc838cddbcf5f3886a497eb207bee979ed37
3
+ metadata.gz: 5e891590d7605a8cc446728adcf3acfc0ba76a64
4
+ data.tar.gz: ba5c805f1a36eec0e2f9d5cca2cc4294616aa4ec
5
5
  SHA512:
6
- metadata.gz: 72293ebd072dd0bad5d78de8f2eebc0f2e048e29a872c431022961c6b895fc216c8900a95cc8cfbf3403bdc44de111b2075c13bc87fb9fe02e0d3ab27e0b1a89
7
- data.tar.gz: fbf053ffc599fd54002762828c8ada53a8b770cd2896968b2dd63108708374a3f83c2383d5104da9b799a54a719e3af668b9309eb78ffa4baefaa8c07819bdac
6
+ metadata.gz: 473343e9001e25d5500c2f029f49b33e00835eaa955b91789b6da44cedba2783298ad26b8876d94768e61b6bc9cf7e16ee420acb501838950d1a8577ee8cb4c0
7
+ data.tar.gz: 779a959401de4bd884b3ebf4585bcd7d457baa2415237737190782dd50a342f46b032d4fdd14dde108acc6165962945525573ddba3907413913b2b9cb6a32c3d
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.1000
1
+ 3.0.1001
@@ -2,6 +2,9 @@
2
2
 
3
3
  require 'tencentcloud-sdk-common'
4
4
 
5
+ require_relative 'v20230616/client'
6
+ require_relative 'v20230616/models'
7
+
5
8
  require_relative 'v20180724/client'
6
9
  require_relative 'v20180724/models'
7
10
 
@@ -0,0 +1,66 @@
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 Monitor
21
+ module V20230616
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2023-06-16'
26
+ api_endpoint = 'monitor.tencentcloudapi.com'
27
+ sdk_version = 'MONITOR_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 获取云产品的监控数据。此接口不适用于拉取容器服务监控数据,如需拉取容器服务监控数据,请使用[根据维度条件查询监控数据](https://cloud.tencent.com/document/product/248/51845)接口。
33
+ # 传入产品的命名空间、对象维度描述和监控指标即可获得相应的监控数据。
34
+ # 接口调用限制:单请求最多可支持批量拉取10个实例的监控数据,单请求的数据点数限制为1440个。
35
+ # 若您需要调用的指标、对象较多,可能存在因限频出现拉取失败的情况,建议尽量将请求按时间维度均摊。
36
+
37
+ # >?
38
+ # >- 2022年9月1日起,云监控开始对GetMonitorData接口计费。每个主账号每月可获得100万次免费请求额度,超过免费额度后如需继续调用接口需要开通 [API请求按量付费](https://buy.cloud.tencent.com/APIRequestBuy)。计费规则可查看[API计费文档](https://cloud.tencent.com/document/product/248/77914)。
39
+
40
+ # @param request: Request instance for GetMonitorData.
41
+ # @type request: :class:`Tencentcloud::monitor::V20230616::GetMonitorDataRequest`
42
+ # @rtype: :class:`Tencentcloud::monitor::V20230616::GetMonitorDataResponse`
43
+ def GetMonitorData(request)
44
+ body = send_request('GetMonitorData', request.serialize)
45
+ response = JSON.parse(body)
46
+ if response['Response'].key?('Error') == false
47
+ model = GetMonitorDataResponse.new
48
+ model.deserialize(response['Response'])
49
+ model
50
+ else
51
+ code = response['Response']['Error']['Code']
52
+ message = response['Response']['Error']['Message']
53
+ reqid = response['Response']['RequestId']
54
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
55
+ end
56
+ rescue TencentCloud::Common::TencentCloudSDKException => e
57
+ raise e
58
+ rescue StandardError => e
59
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
60
+ end
61
+
62
+
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,217 @@
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 Monitor
19
+ module V20230616
20
+ # 监控数据点
21
+ class DataPoint < TencentCloud::Common::AbstractModel
22
+ # @param Dimensions: 实例对象维度组合
23
+ # @type Dimensions: Array
24
+ # @param Timestamps: 时间戳数组,表示那些时间点有数据,缺失的时间戳,没有数据点,可以理解为掉点了
25
+ # @type Timestamps: Array
26
+ # @param Values: 监控值数组,该数组和Timestamps一一对应
27
+ # @type Values: Array
28
+
29
+ attr_accessor :Dimensions, :Timestamps, :Values
30
+
31
+ def initialize(dimensions=nil, timestamps=nil, values=nil)
32
+ @Dimensions = dimensions
33
+ @Timestamps = timestamps
34
+ @Values = values
35
+ end
36
+
37
+ def deserialize(params)
38
+ unless params['Dimensions'].nil?
39
+ @Dimensions = []
40
+ params['Dimensions'].each do |i|
41
+ dimension_tmp = Dimension.new
42
+ dimension_tmp.deserialize(i)
43
+ @Dimensions << dimension_tmp
44
+ end
45
+ end
46
+ @Timestamps = params['Timestamps']
47
+ @Values = params['Values']
48
+ end
49
+ end
50
+
51
+ # 实例对象的维度组合
52
+ class Dimension < TencentCloud::Common::AbstractModel
53
+ # @param Name: 实例维度名称
54
+ # 注意:此字段可能返回 null,表示取不到有效值。
55
+ # @type Name: String
56
+ # @param Value: 实例维度值
57
+ # 注意:此字段可能返回 null,表示取不到有效值。
58
+ # @type Value: String
59
+
60
+ attr_accessor :Name, :Value
61
+
62
+ def initialize(name=nil, value=nil)
63
+ @Name = name
64
+ @Value = value
65
+ end
66
+
67
+ def deserialize(params)
68
+ @Name = params['Name']
69
+ @Value = params['Value']
70
+ end
71
+ end
72
+
73
+ # 计算算子
74
+ class Expr < TencentCloud::Common::AbstractModel
75
+ # @param Function: 算子名称
76
+ # @type Function: String
77
+ # @param N: 算子入参值
78
+ # @type N: Float
79
+
80
+ attr_accessor :Function, :N
81
+
82
+ def initialize(function=nil, n=nil)
83
+ @Function = function
84
+ @N = n
85
+ end
86
+
87
+ def deserialize(params)
88
+ @Function = params['Function']
89
+ @N = params['N']
90
+ end
91
+ end
92
+
93
+ # GetMonitorData请求参数结构体
94
+ class GetMonitorDataRequest < TencentCloud::Common::AbstractModel
95
+ # @param Namespace: 命名空间,如QCE/CVM。各个云产品的详细命名空间说明请参阅各个产品[监控指标](https://cloud.tencent.com/document/product/248/6140)文档
96
+ # @type Namespace: String
97
+ # @param MetricName: 指标名称,如CPUUsage,仅支持单指标拉取。各个云产品的详细指标说明请参阅各个产品[监控指标](https://cloud.tencent.com/document/product/248/6140)文档,对应的指标英文名即为MetricName
98
+ # @type MetricName: String
99
+ # @param Instances: 实例对象的维度组合,格式为key-value键值对形式的集合。不同类型的实例字段完全不同,如CVM为[{"Name":"InstanceId","Value":"ins-j0hk02zo"}],Ckafka为[{"Name":"instanceId","Value":"ckafka-l49k54dd"}],COS为[{"Name":"appid","Value":"1258344699"},{"Name":"bucket","Value":"rig-1258344699"}]。各个云产品的维度请参阅各个产品[监控指标](https://cloud.tencent.com/document/product/248/6140)文档,对应的维度列即为维度组合的key,value为key对应的值。单请求最多支持批量拉取10个实例的监控数据。
100
+ # @type Instances: Array
101
+ # @param Period: 监控统计周期,如60。默认为取值为300,单位为s。每个指标支持的统计周期不一定相同,各个云产品支持的统计周期请参阅各个产品[监控指标](https://cloud.tencent.com/document/product/248/6140)文档,对应的统计周期列即为支持的统计周期。单请求的数据点数限制为1440个。
102
+ # @type Period: Integer
103
+ # @param StartTime: 起始时间,如2018-09-22T19:51:23+08:00
104
+ # @type StartTime: String
105
+ # @param EndTime: 结束时间,如2018-09-22T20:51:23+08:00,默认为当前时间。 EndTime不能小于StartTime
106
+ # @type EndTime: String
107
+ # @param Expr: 计算算子
108
+ # @type Expr: :class:`Tencentcloud::Monitor.v20230616.models.Expr`
109
+
110
+ attr_accessor :Namespace, :MetricName, :Instances, :Period, :StartTime, :EndTime, :Expr
111
+
112
+ def initialize(namespace=nil, metricname=nil, instances=nil, period=nil, starttime=nil, endtime=nil, expr=nil)
113
+ @Namespace = namespace
114
+ @MetricName = metricname
115
+ @Instances = instances
116
+ @Period = period
117
+ @StartTime = starttime
118
+ @EndTime = endtime
119
+ @Expr = expr
120
+ end
121
+
122
+ def deserialize(params)
123
+ @Namespace = params['Namespace']
124
+ @MetricName = params['MetricName']
125
+ unless params['Instances'].nil?
126
+ @Instances = []
127
+ params['Instances'].each do |i|
128
+ instance_tmp = Instance.new
129
+ instance_tmp.deserialize(i)
130
+ @Instances << instance_tmp
131
+ end
132
+ end
133
+ @Period = params['Period']
134
+ @StartTime = params['StartTime']
135
+ @EndTime = params['EndTime']
136
+ unless params['Expr'].nil?
137
+ @Expr = Expr.new
138
+ @Expr.deserialize(params['Expr'])
139
+ end
140
+ end
141
+ end
142
+
143
+ # GetMonitorData返回参数结构体
144
+ class GetMonitorDataResponse < TencentCloud::Common::AbstractModel
145
+ # @param Period: 统计周期
146
+ # @type Period: Integer
147
+ # @param MetricName: 指标名
148
+ # @type MetricName: String
149
+ # @param DataPoints: 数据点数组
150
+ # @type DataPoints: Array
151
+ # @param StartTime: 开始时间
152
+ # @type StartTime: String
153
+ # @param EndTime: 结束时间
154
+ # @type EndTime: String
155
+ # @param Msg: 返回信息
156
+ # @type Msg: String
157
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
158
+ # @type RequestId: String
159
+
160
+ attr_accessor :Period, :MetricName, :DataPoints, :StartTime, :EndTime, :Msg, :RequestId
161
+
162
+ def initialize(period=nil, metricname=nil, datapoints=nil, starttime=nil, endtime=nil, msg=nil, requestid=nil)
163
+ @Period = period
164
+ @MetricName = metricname
165
+ @DataPoints = datapoints
166
+ @StartTime = starttime
167
+ @EndTime = endtime
168
+ @Msg = msg
169
+ @RequestId = requestid
170
+ end
171
+
172
+ def deserialize(params)
173
+ @Period = params['Period']
174
+ @MetricName = params['MetricName']
175
+ unless params['DataPoints'].nil?
176
+ @DataPoints = []
177
+ params['DataPoints'].each do |i|
178
+ datapoint_tmp = DataPoint.new
179
+ datapoint_tmp.deserialize(i)
180
+ @DataPoints << datapoint_tmp
181
+ end
182
+ end
183
+ @StartTime = params['StartTime']
184
+ @EndTime = params['EndTime']
185
+ @Msg = params['Msg']
186
+ @RequestId = params['RequestId']
187
+ end
188
+ end
189
+
190
+ # 实例维度组合数组
191
+ class Instance < TencentCloud::Common::AbstractModel
192
+ # @param Dimensions: 实例的维度组合
193
+ # 注意:此字段可能返回 null,表示取不到有效值。
194
+ # @type Dimensions: Array
195
+
196
+ attr_accessor :Dimensions
197
+
198
+ def initialize(dimensions=nil)
199
+ @Dimensions = dimensions
200
+ end
201
+
202
+ def deserialize(params)
203
+ unless params['Dimensions'].nil?
204
+ @Dimensions = []
205
+ params['Dimensions'].each do |i|
206
+ dimension_tmp = Dimension.new
207
+ dimension_tmp.deserialize(i)
208
+ @Dimensions << dimension_tmp
209
+ end
210
+ end
211
+ end
212
+ end
213
+
214
+ end
215
+ end
216
+ end
217
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tencentcloud-sdk-monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1000
4
+ version: 3.0.1001
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tencent Cloud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-18 00:00:00.000000000 Z
11
+ date: 2025-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tencentcloud-sdk-common
@@ -35,6 +35,8 @@ extra_rdoc_files: []
35
35
  files:
36
36
  - lib/v20180724/models.rb
37
37
  - lib/v20180724/client.rb
38
+ - lib/v20230616/models.rb
39
+ - lib/v20230616/client.rb
38
40
  - lib/tencentcloud-sdk-monitor.rb
39
41
  - lib/VERSION
40
42
  homepage: https://github.com/TencentCloud/tencentcloud-sdk-ruby