1 Star 1 Fork 0

tencentcloud/tencentcloud-sdk-ruby

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
client.rb 183.28 KB
一键复制 编辑 原始数据 按行查看 历史
tencentcloud 提交于 2024-09-25 04:39 . release 3.0.913
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787
# frozen_string_literal: true
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'json'
module TencentCloud
module Monitor
module V20180724
class Client < TencentCloud::Common::AbstractClient
def initialize(credential, region, profile = nil)
api_version = '2018-07-24'
api_endpoint = 'monitor.tencentcloudapi.com'
sdk_version = 'MONITOR_' + File.read(File.expand_path('../VERSION', __dir__)).strip
super(credential, region, api_version, api_endpoint, sdk_version, profile)
end
# 绑定 Grafana 可视化服务实例
# @param request: Request instance for BindPrometheusManagedGrafana.
# @type request: :class:`Tencentcloud::monitor::V20180724::BindPrometheusManagedGrafanaRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::BindPrometheusManagedGrafanaResponse`
def BindPrometheusManagedGrafana(request)
body = send_request('BindPrometheusManagedGrafana', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = BindPrometheusManagedGrafanaResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 将告警策略绑定到特定对象
# @param request: Request instance for BindingPolicyObject.
# @type request: :class:`Tencentcloud::monitor::V20180724::BindingPolicyObjectRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::BindingPolicyObjectResponse`
def BindingPolicyObject(request)
body = send_request('BindingPolicyObject', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = BindingPolicyObjectResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 策略绑定标签
# @param request: Request instance for BindingPolicyTag.
# @type request: :class:`Tencentcloud::monitor::V20180724::BindingPolicyTagRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::BindingPolicyTagResponse`
def BindingPolicyTag(request)
body = send_request('BindingPolicyTag', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = BindingPolicyTagResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 强制销毁 Grafana 实例
# @param request: Request instance for CleanGrafanaInstance.
# @type request: :class:`Tencentcloud::monitor::V20180724::CleanGrafanaInstanceRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CleanGrafanaInstanceResponse`
def CleanGrafanaInstance(request)
body = send_request('CleanGrafanaInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CleanGrafanaInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建通知模板
# @param request: Request instance for CreateAlarmNotice.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreateAlarmNoticeRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreateAlarmNoticeResponse`
def CreateAlarmNotice(request)
body = send_request('CreateAlarmNotice', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateAlarmNoticeResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建告警策略
# @param request: Request instance for CreateAlarmPolicy.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreateAlarmPolicyRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreateAlarmPolicyResponse`
def CreateAlarmPolicy(request)
body = send_request('CreateAlarmPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateAlarmPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建 Prometheus 告警规则。
# 请注意,**告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description**,,请参考 [Prometheus Rule更多配置请参考](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/)。
# @param request: Request instance for CreateAlertRule.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreateAlertRuleRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreateAlertRuleResponse`
def CreateAlertRule(request)
body = send_request('CreateAlertRule', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateAlertRuleResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建集成中心 exporter 集成,因集成较多,建议控制台创建集成。(前提:已授权创建托管 EKS 集群,验证方式:1. 控制台界面确认,未提示授权则表示已授权创建;2. 通过 DescribePrometheusInstanceInitStatus 接口查询集群状态,如果托管集群不存在,可通过 RunPrometheusInstance 接口创建)
# @param request: Request instance for CreateExporterIntegration.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreateExporterIntegrationRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreateExporterIntegrationResponse`
def CreateExporterIntegration(request)
body = send_request('CreateExporterIntegration', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateExporterIntegrationResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateGrafanaInstance)用于创建 Grafana 包年包月实例,默认基础版、到期自动续费、不可使用代金券。
# @param request: Request instance for CreateGrafanaInstance.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreateGrafanaInstanceRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreateGrafanaInstanceResponse`
def CreateGrafanaInstance(request)
body = send_request('CreateGrafanaInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateGrafanaInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建 Grafana 集成配置,其中 Prometheus 集成不通过该接口创建,可参考 BindPrometheusManagedGrafana 接口
# @param request: Request instance for CreateGrafanaIntegration.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreateGrafanaIntegrationRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreateGrafanaIntegrationResponse`
def CreateGrafanaIntegration(request)
body = send_request('CreateGrafanaIntegration', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateGrafanaIntegrationResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建 Grafana 告警通道
# @param request: Request instance for CreateGrafanaNotificationChannel.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreateGrafanaNotificationChannelRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreateGrafanaNotificationChannelResponse`
def CreateGrafanaNotificationChannel(request)
body = send_request('CreateGrafanaNotificationChannel', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateGrafanaNotificationChannelResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 增加策略组
# @param request: Request instance for CreatePolicyGroup.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreatePolicyGroupRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePolicyGroupResponse`
def CreatePolicyGroup(request)
body = send_request('CreatePolicyGroup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreatePolicyGroupResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建 Prometheus CVM Agent
# @param request: Request instance for CreatePrometheusAgent.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusAgentRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusAgentResponse`
def CreatePrometheusAgent(request)
body = send_request('CreatePrometheusAgent', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreatePrometheusAgentResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建Prometheus告警规则分组
# 告警分组中可包含多条告警规则,分组内告警消息通过告警分组的通知模板发送。
# 支持单个告警分组下分别创建启用/禁用的告警规则。
# @param request: Request instance for CreatePrometheusAlertGroup.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusAlertGroupRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusAlertGroupResponse`
def CreatePrometheusAlertGroup(request)
body = send_request('CreatePrometheusAlertGroup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreatePrometheusAlertGroupResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建 Prometheus 告警策略(将逐步废弃,建议使用 CreatePrometheusAlertGroup 创建告警策略)
# @param request: Request instance for CreatePrometheusAlertPolicy.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusAlertPolicyRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusAlertPolicyResponse`
def CreatePrometheusAlertPolicy(request)
body = send_request('CreatePrometheusAlertPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreatePrometheusAlertPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 与腾讯云可观测融合的2.0实例关联集群
# @param request: Request instance for CreatePrometheusClusterAgent.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusClusterAgentRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusClusterAgentResponse`
def CreatePrometheusClusterAgent(request)
body = send_request('CreatePrometheusClusterAgent', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreatePrometheusClusterAgentResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建prometheus配置
# @param request: Request instance for CreatePrometheusConfig.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusConfigRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusConfigResponse`
def CreatePrometheusConfig(request)
body = send_request('CreatePrometheusConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreatePrometheusConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建全局告警通知渠道。集群内创建的告警规则如果未配置告警通知渠道,默认走全局告警通知渠道(建议在控制台创建告警,集群内创建告警不易维护)
# @param request: Request instance for CreatePrometheusGlobalNotification.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusGlobalNotificationRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusGlobalNotificationResponse`
def CreatePrometheusGlobalNotification(request)
body = send_request('CreatePrometheusGlobalNotification', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreatePrometheusGlobalNotificationResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建按量 Prometheus 实例,根据用量收费实例
# @param request: Request instance for CreatePrometheusMultiTenantInstancePostPayMode.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusMultiTenantInstancePostPayModeRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusMultiTenantInstancePostPayModeResponse`
def CreatePrometheusMultiTenantInstancePostPayMode(request)
body = send_request('CreatePrometheusMultiTenantInstancePostPayMode', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreatePrometheusMultiTenantInstancePostPayModeResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 以Yaml的方式创建聚合规则
# @param request: Request instance for CreatePrometheusRecordRuleYaml.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusRecordRuleYamlRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusRecordRuleYamlResponse`
def CreatePrometheusRecordRuleYaml(request)
body = send_request('CreatePrometheusRecordRuleYaml', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreatePrometheusRecordRuleYamlResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建 Prometheus Agent 抓取任务
# @param request: Request instance for CreatePrometheusScrapeJob.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusScrapeJobRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusScrapeJobResponse`
def CreatePrometheusScrapeJob(request)
body = send_request('CreatePrometheusScrapeJob', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreatePrometheusScrapeJobResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建一个云原生Prometheus模板
# @param request: Request instance for CreatePrometheusTemp.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusTempRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusTempResponse`
def CreatePrometheusTemp(request)
body = send_request('CreatePrometheusTemp', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreatePrometheusTempResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建 Prometheus 的预聚合规则
# @param request: Request instance for CreateRecordingRule.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreateRecordingRuleRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreateRecordingRuleResponse`
def CreateRecordingRule(request)
body = send_request('CreateRecordingRule', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateRecordingRuleResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# Grafana实例授权其他腾讯云用户
# @param request: Request instance for CreateSSOAccount.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreateSSOAccountRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreateSSOAccountResponse`
def CreateSSOAccount(request)
body = send_request('CreateSSOAccount', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateSSOAccountResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 在腾讯云容器服务下创建 Prometheus 服务发现。
# <p>注意:前提条件,已经通过 Prometheus 控制台集成了对应的腾讯云容器服务,具体请参考
# <a href="https://cloud.tencent.com/document/product/248/48859" target="_blank">Agent 安装</a>。</p>
# @param request: Request instance for CreateServiceDiscovery.
# @type request: :class:`Tencentcloud::monitor::V20180724::CreateServiceDiscoveryRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::CreateServiceDiscoveryResponse`
def CreateServiceDiscovery(request)
body = send_request('CreateServiceDiscovery', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateServiceDiscoveryResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除告警通知模板
# @param request: Request instance for DeleteAlarmNotices.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeleteAlarmNoticesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeleteAlarmNoticesResponse`
def DeleteAlarmNotices(request)
body = send_request('DeleteAlarmNotices', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteAlarmNoticesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除告警策略
# @param request: Request instance for DeleteAlarmPolicy.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeleteAlarmPolicyRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeleteAlarmPolicyResponse`
def DeleteAlarmPolicy(request)
body = send_request('DeleteAlarmPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteAlarmPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 批量删除 Prometheus 报警规则
# @param request: Request instance for DeleteAlertRules.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeleteAlertRulesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeleteAlertRulesResponse`
def DeleteAlertRules(request)
body = send_request('DeleteAlertRules', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteAlertRulesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除集成中心 exporter 集成
# @param request: Request instance for DeleteExporterIntegration.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeleteExporterIntegrationRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeleteExporterIntegrationResponse`
def DeleteExporterIntegration(request)
body = send_request('DeleteExporterIntegration', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteExporterIntegrationResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DeleteGrafanaInstance)用于 Grafana 包年包月实例的退费,调用后实例处于停服状态,不可使用,7天后自动销毁。
# @param request: Request instance for DeleteGrafanaInstance.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeleteGrafanaInstanceRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeleteGrafanaInstanceResponse`
def DeleteGrafanaInstance(request)
body = send_request('DeleteGrafanaInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteGrafanaInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除 Grafana 集成配置
# @param request: Request instance for DeleteGrafanaIntegration.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeleteGrafanaIntegrationRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeleteGrafanaIntegrationResponse`
def DeleteGrafanaIntegration(request)
body = send_request('DeleteGrafanaIntegration', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteGrafanaIntegrationResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除 Grafana 告警通道
# @param request: Request instance for DeleteGrafanaNotificationChannel.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeleteGrafanaNotificationChannelRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeleteGrafanaNotificationChannelResponse`
def DeleteGrafanaNotificationChannel(request)
body = send_request('DeleteGrafanaNotificationChannel', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteGrafanaNotificationChannelResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除告警策略组
# @param request: Request instance for DeletePolicyGroup.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeletePolicyGroupRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeletePolicyGroupResponse`
def DeletePolicyGroup(request)
body = send_request('DeletePolicyGroup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeletePolicyGroupResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除Prometheus告警规则分组
# @param request: Request instance for DeletePrometheusAlertGroups.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusAlertGroupsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusAlertGroupsResponse`
def DeletePrometheusAlertGroups(request)
body = send_request('DeletePrometheusAlertGroups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeletePrometheusAlertGroupsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除2.0实例告警策略
# @param request: Request instance for DeletePrometheusAlertPolicy.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusAlertPolicyRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusAlertPolicyResponse`
def DeletePrometheusAlertPolicy(request)
body = send_request('DeletePrometheusAlertPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeletePrometheusAlertPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 解除TMP实例的集群关联
# @param request: Request instance for DeletePrometheusClusterAgent.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusClusterAgentRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusClusterAgentResponse`
def DeletePrometheusClusterAgent(request)
body = send_request('DeletePrometheusClusterAgent', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeletePrometheusClusterAgentResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除Prometheus配置,如果目标不存在,将返回成功
# @param request: Request instance for DeletePrometheusConfig.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusConfigRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusConfigResponse`
def DeletePrometheusConfig(request)
body = send_request('DeletePrometheusConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeletePrometheusConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除聚合实例
# @param request: Request instance for DeletePrometheusRecordRuleYaml.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusRecordRuleYamlRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusRecordRuleYamlResponse`
def DeletePrometheusRecordRuleYaml(request)
body = send_request('DeletePrometheusRecordRuleYaml', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeletePrometheusRecordRuleYamlResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除 Prometheus Agent 抓取任务
# @param request: Request instance for DeletePrometheusScrapeJobs.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusScrapeJobsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusScrapeJobsResponse`
def DeletePrometheusScrapeJobs(request)
body = send_request('DeletePrometheusScrapeJobs', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeletePrometheusScrapeJobsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除一个云原生Prometheus配置模板
# @param request: Request instance for DeletePrometheusTemp.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusTempRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusTempResponse`
def DeletePrometheusTemp(request)
body = send_request('DeletePrometheusTemp', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeletePrometheusTempResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 解除模板同步,这将会删除目标中该模板所生产的配置,针对V2版本实例
# @param request: Request instance for DeletePrometheusTempSync.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusTempSyncRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusTempSyncResponse`
def DeletePrometheusTempSync(request)
body = send_request('DeletePrometheusTempSync', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeletePrometheusTempSyncResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 批量删除 Prometheus 预聚合规则
# @param request: Request instance for DeleteRecordingRules.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeleteRecordingRulesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeleteRecordingRulesResponse`
def DeleteRecordingRules(request)
body = send_request('DeleteRecordingRules', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteRecordingRulesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# Grafana可视化服务 删除授权用户
# @param request: Request instance for DeleteSSOAccount.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeleteSSOAccountRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeleteSSOAccountResponse`
def DeleteSSOAccount(request)
body = send_request('DeleteSSOAccount', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteSSOAccountResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除在腾讯云容器服务下创建的 Prometheus 服务发现。
# <p>注意:前提条件,已经通过 Prometheus 控制台集成了对应的腾讯云容器服务,具体请参考
# <a href="https://cloud.tencent.com/document/product/248/48859" target="_blank">Agent 安装</a>。</p>
# @param request: Request instance for DeleteServiceDiscovery.
# @type request: :class:`Tencentcloud::monitor::V20180724::DeleteServiceDiscoveryRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DeleteServiceDiscoveryResponse`
def DeleteServiceDiscovery(request)
body = send_request('DeleteServiceDiscovery', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteServiceDiscoveryResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取平台事件列表
# @param request: Request instance for DescribeAccidentEventList.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeAccidentEventListRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeAccidentEventListResponse`
def DescribeAccidentEventList(request)
body = send_request('DescribeAccidentEventList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAccidentEventListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询告警事件列表
# @param request: Request instance for DescribeAlarmEvents.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmEventsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmEventsResponse`
def DescribeAlarmEvents(request)
body = send_request('DescribeAlarmEvents', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAlarmEventsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询告警历史
# 请注意,**如果使用子用户进行告警历史的查询,只能查询到被授权项目下的告警历史**,或不区分项目的产品的告警历史。如何对子账户授予项目的权限,请参考 [访问管理-项目与标签](https://cloud.tencent.com/document/product/598/32738)。
# @param request: Request instance for DescribeAlarmHistories.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmHistoriesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmHistoriesResponse`
def DescribeAlarmHistories(request)
body = send_request('DescribeAlarmHistories', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAlarmHistoriesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询告警指标列表
# @param request: Request instance for DescribeAlarmMetrics.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmMetricsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmMetricsResponse`
def DescribeAlarmMetrics(request)
body = send_request('DescribeAlarmMetrics', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAlarmMetricsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询单个通知模板的详情
# @param request: Request instance for DescribeAlarmNotice.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmNoticeRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmNoticeResponse`
def DescribeAlarmNotice(request)
body = send_request('DescribeAlarmNotice', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAlarmNoticeResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取告警通知模板所有回调URL
# @param request: Request instance for DescribeAlarmNoticeCallbacks.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmNoticeCallbacksRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmNoticeCallbacksResponse`
def DescribeAlarmNoticeCallbacks(request)
body = send_request('DescribeAlarmNoticeCallbacks', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAlarmNoticeCallbacksResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询通知模板列表
# @param request: Request instance for DescribeAlarmNotices.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmNoticesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmNoticesResponse`
def DescribeAlarmNotices(request)
body = send_request('DescribeAlarmNotices', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAlarmNoticesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询告警策略列表
# @param request: Request instance for DescribeAlarmPolicies.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmPoliciesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmPoliciesResponse`
def DescribeAlarmPolicies(request)
body = send_request('DescribeAlarmPolicies', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAlarmPoliciesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取单个告警策略详情
# @param request: Request instance for DescribeAlarmPolicy.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmPolicyRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmPolicyResponse`
def DescribeAlarmPolicy(request)
body = send_request('DescribeAlarmPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAlarmPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取告警短信配额
# @param request: Request instance for DescribeAlarmSmsQuota.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmSmsQuotaRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeAlarmSmsQuotaResponse`
def DescribeAlarmSmsQuota(request)
body = send_request('DescribeAlarmSmsQuota', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAlarmSmsQuotaResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# Prometheus 报警规则查询接口
# @param request: Request instance for DescribeAlertRules.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeAlertRulesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeAlertRulesResponse`
def DescribeAlertRules(request)
body = send_request('DescribeAlertRules', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAlertRulesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询所有名字空间
# @param request: Request instance for DescribeAllNamespaces.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeAllNamespacesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeAllNamespacesResponse`
def DescribeAllNamespaces(request)
body = send_request('DescribeAllNamespaces', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAllNamespacesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取基础指标属性
# @param request: Request instance for DescribeBaseMetrics.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeBaseMetricsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeBaseMetricsResponse`
def DescribeBaseMetrics(request)
body = send_request('DescribeBaseMetrics', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBaseMetricsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取基础告警列表
# @param request: Request instance for DescribeBasicAlarmList.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeBasicAlarmListRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeBasicAlarmListResponse`
def DescribeBasicAlarmList(request)
body = send_request('DescribeBasicAlarmList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBasicAlarmListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取已绑定对象列表
# @param request: Request instance for DescribeBindingPolicyObjectList.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeBindingPolicyObjectListRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeBindingPolicyObjectListResponse`
def DescribeBindingPolicyObjectList(request)
body = send_request('DescribeBindingPolicyObjectList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBindingPolicyObjectListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取prom实例中集群详细的关联状态
# @param request: Request instance for DescribeClusterAgentCreatingProgress.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeClusterAgentCreatingProgressRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeClusterAgentCreatingProgressResponse`
def DescribeClusterAgentCreatingProgress(request)
body = send_request('DescribeClusterAgentCreatingProgress', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeClusterAgentCreatingProgressResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取条件模板列表
# @param request: Request instance for DescribeConditionsTemplateList.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeConditionsTemplateListRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeConditionsTemplateListResponse`
def DescribeConditionsTemplateList(request)
body = send_request('DescribeConditionsTemplateList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeConditionsTemplateListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出 Grafana DNS 配置
# @param request: Request instance for DescribeDNSConfig.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeDNSConfigRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeDNSConfigResponse`
def DescribeDNSConfig(request)
body = send_request('DescribeDNSConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDNSConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询集成中心 exporter 集成列表
# @param request: Request instance for DescribeExporterIntegrations.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeExporterIntegrationsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeExporterIntegrationsResponse`
def DescribeExporterIntegrations(request)
body = send_request('DescribeExporterIntegrations', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeExporterIntegrationsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出 Grafana 所有告警通道
# @param request: Request instance for DescribeGrafanaChannels.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaChannelsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaChannelsResponse`
def DescribeGrafanaChannels(request)
body = send_request('DescribeGrafanaChannels', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeGrafanaChannelsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出 Grafana 的设置,即 grafana.ini 文件内容
# @param request: Request instance for DescribeGrafanaConfig.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaConfigRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaConfigResponse`
def DescribeGrafanaConfig(request)
body = send_request('DescribeGrafanaConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeGrafanaConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出 Grafana 环境变量
# @param request: Request instance for DescribeGrafanaEnvironments.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaEnvironmentsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaEnvironmentsResponse`
def DescribeGrafanaEnvironments(request)
body = send_request('DescribeGrafanaEnvironments', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeGrafanaEnvironmentsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出用户所有的 Grafana 服务
# @param request: Request instance for DescribeGrafanaInstances.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaInstancesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaInstancesResponse`
def DescribeGrafanaInstances(request)
body = send_request('DescribeGrafanaInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeGrafanaInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出 Grafana 已安装的集成
# @param request: Request instance for DescribeGrafanaIntegrations.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaIntegrationsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaIntegrationsResponse`
def DescribeGrafanaIntegrations(request)
body = send_request('DescribeGrafanaIntegrations', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeGrafanaIntegrationsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出 Grafana 告警通道
# @param request: Request instance for DescribeGrafanaNotificationChannels.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaNotificationChannelsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaNotificationChannelsResponse`
def DescribeGrafanaNotificationChannels(request)
body = send_request('DescribeGrafanaNotificationChannels', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeGrafanaNotificationChannelsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出 Grafana 白名单
# @param request: Request instance for DescribeGrafanaWhiteList.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaWhiteListRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeGrafanaWhiteListResponse`
def DescribeGrafanaWhiteList(request)
body = send_request('DescribeGrafanaWhiteList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeGrafanaWhiteListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出实例已安装的插件
# @param request: Request instance for DescribeInstalledPlugins.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeInstalledPluginsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeInstalledPluginsResponse`
def DescribeInstalledPlugins(request)
body = send_request('DescribeInstalledPlugins', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstalledPluginsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取资源消耗页概览
# @param request: Request instance for DescribeMonitorResourceInfo.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeMonitorResourceInfoRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeMonitorResourceInfoResponse`
def DescribeMonitorResourceInfo(request)
body = send_request('DescribeMonitorResourceInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeMonitorResourceInfoResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 腾讯云可观测平台支持多种类型的监控,此接口列出支持的所有类型
# @param request: Request instance for DescribeMonitorTypes.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeMonitorTypesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeMonitorTypesResponse`
def DescribeMonitorTypes(request)
body = send_request('DescribeMonitorTypes', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeMonitorTypesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询周期内电话流水总数
# @param request: Request instance for DescribePhoneAlarmFlowTotalCount.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePhoneAlarmFlowTotalCountRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePhoneAlarmFlowTotalCountResponse`
def DescribePhoneAlarmFlowTotalCount(request)
body = send_request('DescribePhoneAlarmFlowTotalCount', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePhoneAlarmFlowTotalCountResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出可安装的所有 Grafana 插件。
# @param request: Request instance for DescribePluginOverviews.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePluginOverviewsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePluginOverviewsResponse`
def DescribePluginOverviews(request)
body = send_request('DescribePluginOverviews', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePluginOverviewsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取基础告警策略条件
# @param request: Request instance for DescribePolicyConditionList.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePolicyConditionListRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePolicyConditionListResponse`
def DescribePolicyConditionList(request)
body = send_request('DescribePolicyConditionList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePolicyConditionListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取基础策略组详情
# @param request: Request instance for DescribePolicyGroupInfo.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePolicyGroupInfoRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePolicyGroupInfoResponse`
def DescribePolicyGroupInfo(request)
body = send_request('DescribePolicyGroupInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePolicyGroupInfoResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取基础策略告警组列表
# @param request: Request instance for DescribePolicyGroupList.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePolicyGroupListRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePolicyGroupListResponse`
def DescribePolicyGroupList(request)
body = send_request('DescribePolicyGroupList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePolicyGroupListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 分页获取产品事件的列表
# @param request: Request instance for DescribeProductEventList.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeProductEventListRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeProductEventListResponse`
def DescribeProductEventList(request)
body = send_request('DescribeProductEventList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeProductEventListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询腾讯云可观测平台云产品列表,支持云服务器CVM、云数据库、云消息队列、负载均衡、容器服务、专线等云产品。
# @param request: Request instance for DescribeProductList.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeProductListRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeProductListResponse`
def DescribeProductList(request)
body = send_request('DescribeProductList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeProductListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取关联目标集群的实例列表
# @param request: Request instance for DescribePrometheusAgentInstances.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusAgentInstancesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusAgentInstancesResponse`
def DescribePrometheusAgentInstances(request)
body = send_request('DescribePrometheusAgentInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusAgentInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出 Prometheus CVM Agent
# @param request: Request instance for DescribePrometheusAgents.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusAgentsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusAgentsResponse`
def DescribePrometheusAgents(request)
body = send_request('DescribePrometheusAgents', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusAgentsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询给定prometheus下的告警分组
# @param request: Request instance for DescribePrometheusAlertGroups.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusAlertGroupsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusAlertGroupsResponse`
def DescribePrometheusAlertGroups(request)
body = send_request('DescribePrometheusAlertGroups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusAlertGroupsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取2.0实例告警策略列表
# @param request: Request instance for DescribePrometheusAlertPolicy.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusAlertPolicyRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusAlertPolicyResponse`
def DescribePrometheusAlertPolicy(request)
body = send_request('DescribePrometheusAlertPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusAlertPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取TMP实例关联集群列表
# @param request: Request instance for DescribePrometheusClusterAgents.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusClusterAgentsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusClusterAgentsResponse`
def DescribePrometheusClusterAgents(request)
body = send_request('DescribePrometheusClusterAgents', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusClusterAgentsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 拉取Prometheus配置
# @param request: Request instance for DescribePrometheusConfig.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusConfigRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusConfigResponse`
def DescribePrometheusConfig(request)
body = send_request('DescribePrometheusConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获得实例级别抓取配置
# @param request: Request instance for DescribePrometheusGlobalConfig.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusGlobalConfigRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusGlobalConfigResponse`
def DescribePrometheusGlobalConfig(request)
body = send_request('DescribePrometheusGlobalConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusGlobalConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询全局告警通知渠道
# @param request: Request instance for DescribePrometheusGlobalNotification.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusGlobalNotificationRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusGlobalNotificationResponse`
def DescribePrometheusGlobalNotification(request)
body = send_request('DescribePrometheusGlobalNotification', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusGlobalNotificationResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取TMP实例详情
# @param request: Request instance for DescribePrometheusInstanceDetail.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusInstanceDetailRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusInstanceDetailResponse`
def DescribePrometheusInstanceDetail(request)
body = send_request('DescribePrometheusInstanceDetail', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusInstanceDetailResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取2.0实例初始化任务状态
# @param request: Request instance for DescribePrometheusInstanceInitStatus.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusInstanceInitStatusRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusInstanceInitStatusResponse`
def DescribePrometheusInstanceInitStatus(request)
body = send_request('DescribePrometheusInstanceInitStatus', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusInstanceInitStatusResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询Prometheus按量实例用量
# @param request: Request instance for DescribePrometheusInstanceUsage.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusInstanceUsageRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusInstanceUsageResponse`
def DescribePrometheusInstanceUsage(request)
body = send_request('DescribePrometheusInstanceUsage', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusInstanceUsageResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口 (DescribePrometheusInstances) 用于查询一个或多个实例的详细信息。
# <ul>
# <li>可以根据实例ID、实例名称或者实例状态等信息来查询实例的详细信息</li>
# <li>如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的实例。</li>
# </ul>
# @param request: Request instance for DescribePrometheusInstances.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusInstancesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusInstancesResponse`
def DescribePrometheusInstances(request)
body = send_request('DescribePrometheusInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取与 Prometheus 监控融合实例列表
# @param request: Request instance for DescribePrometheusInstancesOverview.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusInstancesOverviewRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusInstancesOverviewResponse`
def DescribePrometheusInstancesOverview(request)
body = send_request('DescribePrometheusInstancesOverview', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusInstancesOverviewResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取聚合规则列表,包含关联集群内crd资源创建的record rule
# @param request: Request instance for DescribePrometheusRecordRules.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusRecordRulesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusRecordRulesResponse`
def DescribePrometheusRecordRules(request)
body = send_request('DescribePrometheusRecordRules', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusRecordRulesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出 Prometheus 服务所有可用的地域
# @param request: Request instance for DescribePrometheusRegions.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusRegionsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusRegionsResponse`
def DescribePrometheusRegions(request)
body = send_request('DescribePrometheusRegions', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusRegionsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出 Prometheus 抓取任务
# @param request: Request instance for DescribePrometheusScrapeJobs.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusScrapeJobsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusScrapeJobsResponse`
def DescribePrometheusScrapeJobs(request)
body = send_request('DescribePrometheusScrapeJobs', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusScrapeJobsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取targets信息,在过滤条件中指定job名称时返回targets详情,否则仅返回数量
# @param request: Request instance for DescribePrometheusTargetsTMP.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusTargetsTMPRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusTargetsTMPResponse`
def DescribePrometheusTargetsTMP(request)
body = send_request('DescribePrometheusTargetsTMP', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusTargetsTMPResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 拉取模板列表,默认模板将总是在最前面
# @param request: Request instance for DescribePrometheusTemp.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusTempRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusTempResponse`
def DescribePrometheusTemp(request)
body = send_request('DescribePrometheusTemp', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusTempResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取模板关联实例信息,针对V2版本实例
# @param request: Request instance for DescribePrometheusTempSync.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusTempSyncRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusTempSyncResponse`
def DescribePrometheusTempSync(request)
body = send_request('DescribePrometheusTempSync', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusTempSyncResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出 Prometheus 服务可用区。
# @param request: Request instance for DescribePrometheusZones.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusZonesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusZonesResponse`
def DescribePrometheusZones(request)
body = send_request('DescribePrometheusZones', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribePrometheusZonesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 根据条件查询 Prometheus 预聚合规则
# @param request: Request instance for DescribeRecordingRules.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeRecordingRulesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeRecordingRulesResponse`
def DescribeRecordingRules(request)
body = send_request('DescribeRecordingRules', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeRecordingRulesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出当前grafana实例的所有授权账号
# @param request: Request instance for DescribeSSOAccount.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeSSOAccountRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeSSOAccountResponse`
def DescribeSSOAccount(request)
body = send_request('DescribeSSOAccount', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeSSOAccountResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 列出在腾讯云容器服务下创建的 Prometheus 服务发现。
# <p>注意:前提条件,已经通过 Prometheus 控制台集成了对应的腾讯云容器服务,具体请参考
# <a href="https://cloud.tencent.com/document/product/248/48859" target="_blank">Agent 安装</a>。</p>
# @param request: Request instance for DescribeServiceDiscovery.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeServiceDiscoveryRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeServiceDiscoveryResponse`
def DescribeServiceDiscovery(request)
body = send_request('DescribeServiceDiscovery', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeServiceDiscoveryResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 根据维度条件查询监控数据
# @param request: Request instance for DescribeStatisticData.
# @type request: :class:`Tencentcloud::monitor::V20180724::DescribeStatisticDataRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DescribeStatisticDataResponse`
def DescribeStatisticData(request)
body = send_request('DescribeStatisticData', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeStatisticDataResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 彻底删除 Prometheus 实例相关数据,给定的实例必须先被 Terminate(该接口是异步接口,实例是否释放需要通过 DescribePrometheusInstances 接口返回的状态来判断)。
# @param request: Request instance for DestroyPrometheusInstance.
# @type request: :class:`Tencentcloud::monitor::V20180724::DestroyPrometheusInstanceRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::DestroyPrometheusInstanceResponse`
def DestroyPrometheusInstance(request)
body = send_request('DestroyPrometheusInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DestroyPrometheusInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 设置 Grafana 公网访问
# @param request: Request instance for EnableGrafanaInternet.
# @type request: :class:`Tencentcloud::monitor::V20180724::EnableGrafanaInternetRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::EnableGrafanaInternetResponse`
def EnableGrafanaInternet(request)
body = send_request('EnableGrafanaInternet', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = EnableGrafanaInternetResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 设置 Grafana 单点登录,使用腾讯云账号
# @param request: Request instance for EnableGrafanaSSO.
# @type request: :class:`Tencentcloud::monitor::V20180724::EnableGrafanaSSORequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::EnableGrafanaSSOResponse`
def EnableGrafanaSSO(request)
body = send_request('EnableGrafanaSSO', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = EnableGrafanaSSOResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# SSO单点登录时,设置是否cam鉴权
# @param request: Request instance for EnableSSOCamCheck.
# @type request: :class:`Tencentcloud::monitor::V20180724::EnableSSOCamCheckRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::EnableSSOCamCheckResponse`
def EnableSSOCamCheck(request)
body = send_request('EnableSSOCamCheck', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = EnableSSOCamCheckResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取云产品的监控数据。此接口不适用于拉取容器服务监控数据,如需拉取容器服务监控数据,请使用[根据维度条件查询监控数据](https://cloud.tencent.com/document/product/248/51845)接口。
# 传入产品的命名空间、对象维度描述和监控指标即可获得相应的监控数据。
# 接口调用限制:单请求最多可支持批量拉取10个实例的监控数据,单请求的数据点数限制为1440个。
# 若您需要调用的指标、对象较多,可能存在因限频出现拉取失败的情况,建议尽量将请求按时间维度均摊。
# 参数SpecifyStatistics目前可支持返回三种统计方式(avg,max,min),分别为二进制1,2,4。
# 例子:3:avg+max,5:avg+min,6:max+min,7:avg+max+min
# 拉取数据的粒度和统计方式的对应关系尽量在接入平台进行配置,如果没有配置,因为更小粒度数据存储时间有限,拉取时间范围也是有限。
# >?
# >- 2022年9月1日起,腾讯云可观测平台开始对GetMonitorData接口计费。每个主账号每月可获得100万次免费请求额度,超过免费额度后如需继续调用接口需要开通 [API请求按量付费](https://buy.cloud.tencent.com/APIRequestBuy)。计费规则可查看[API计费文档](https://cloud.tencent.com/document/product/248/77914)。
# @param request: Request instance for GetMonitorData.
# @type request: :class:`Tencentcloud::monitor::V20180724::GetMonitorDataRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::GetMonitorDataResponse`
def GetMonitorData(request)
body = send_request('GetMonitorData', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = GetMonitorDataResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取 Prometheus Agent 管理相关的命令行
# @param request: Request instance for GetPrometheusAgentManagementCommand.
# @type request: :class:`Tencentcloud::monitor::V20180724::GetPrometheusAgentManagementCommandRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::GetPrometheusAgentManagementCommandResponse`
def GetPrometheusAgentManagementCommand(request)
body = send_request('GetPrometheusAgentManagementCommand', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = GetPrometheusAgentManagementCommandResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 安装 Grafana Plugin
# @param request: Request instance for InstallPlugins.
# @type request: :class:`Tencentcloud::monitor::V20180724::InstallPluginsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::InstallPluginsResponse`
def InstallPlugins(request)
body = send_request('InstallPlugins', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = InstallPluginsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 编辑告警通知模板
# @param request: Request instance for ModifyAlarmNotice.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmNoticeRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmNoticeResponse`
def ModifyAlarmNotice(request)
body = send_request('ModifyAlarmNotice', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyAlarmNoticeResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 修改告警策略触发条件
# @param request: Request instance for ModifyAlarmPolicyCondition.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmPolicyConditionRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmPolicyConditionResponse`
def ModifyAlarmPolicyCondition(request)
body = send_request('ModifyAlarmPolicyCondition', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyAlarmPolicyConditionResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 告警2.0编辑告警策略基本信息,包括策略名、备注
# @param request: Request instance for ModifyAlarmPolicyInfo.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmPolicyInfoRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmPolicyInfoResponse`
def ModifyAlarmPolicyInfo(request)
body = send_request('ModifyAlarmPolicyInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyAlarmPolicyInfoResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 修改告警策略绑定的告警通知模板
# @param request: Request instance for ModifyAlarmPolicyNotice.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmPolicyNoticeRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmPolicyNoticeResponse`
def ModifyAlarmPolicyNotice(request)
body = send_request('ModifyAlarmPolicyNotice', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyAlarmPolicyNoticeResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 启停告警策略
# @param request: Request instance for ModifyAlarmPolicyStatus.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmPolicyStatusRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmPolicyStatusResponse`
def ModifyAlarmPolicyStatus(request)
body = send_request('ModifyAlarmPolicyStatus', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyAlarmPolicyStatusResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 修改告警策略的触发任务,TriggerTasks字段放触发任务列表,TriggerTasks传空数组时,代表解绑该策略的所有触发任务。
# @param request: Request instance for ModifyAlarmPolicyTasks.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmPolicyTasksRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmPolicyTasksResponse`
def ModifyAlarmPolicyTasks(request)
body = send_request('ModifyAlarmPolicyTasks', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyAlarmPolicyTasksResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 修改告警接收人
# @param request: Request instance for ModifyAlarmReceivers.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmReceiversRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyAlarmReceiversResponse`
def ModifyAlarmReceivers(request)
body = send_request('ModifyAlarmReceivers', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyAlarmReceiversResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 修改 Grafana 实例属性
# @param request: Request instance for ModifyGrafanaInstance.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyGrafanaInstanceRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyGrafanaInstanceResponse`
def ModifyGrafanaInstance(request)
body = send_request('ModifyGrafanaInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyGrafanaInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新策略组
# @param request: Request instance for ModifyPolicyGroup.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyPolicyGroupRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyPolicyGroupResponse`
def ModifyPolicyGroup(request)
body = send_request('ModifyPolicyGroup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyPolicyGroupResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 修改被关联集群的external labels
# @param request: Request instance for ModifyPrometheusAgentExternalLabels.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusAgentExternalLabelsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusAgentExternalLabelsResponse`
def ModifyPrometheusAgentExternalLabels(request)
body = send_request('ModifyPrometheusAgentExternalLabels', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyPrometheusAgentExternalLabelsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 修改2.0实例告警策略
# @param request: Request instance for ModifyPrometheusAlertPolicy.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusAlertPolicyRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusAlertPolicyResponse`
def ModifyPrometheusAlertPolicy(request)
body = send_request('ModifyPrometheusAlertPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyPrometheusAlertPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 修改prometheus采集配置
# @param request: Request instance for ModifyPrometheusConfig.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusConfigRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusConfigResponse`
def ModifyPrometheusConfig(request)
body = send_request('ModifyPrometheusConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyPrometheusConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 修改全局告警通知渠道
# @param request: Request instance for ModifyPrometheusGlobalNotification.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusGlobalNotificationRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusGlobalNotificationResponse`
def ModifyPrometheusGlobalNotification(request)
body = send_request('ModifyPrometheusGlobalNotification', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyPrometheusGlobalNotificationResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 修改 Prometheus 实例相关属性
# @param request: Request instance for ModifyPrometheusInstanceAttributes.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusInstanceAttributesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusInstanceAttributesResponse`
def ModifyPrometheusInstanceAttributes(request)
body = send_request('ModifyPrometheusInstanceAttributes', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyPrometheusInstanceAttributesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 通过yaml的方式修改Prometheus聚合实例
# @param request: Request instance for ModifyPrometheusRecordRuleYaml.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusRecordRuleYamlRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusRecordRuleYamlResponse`
def ModifyPrometheusRecordRuleYaml(request)
body = send_request('ModifyPrometheusRecordRuleYaml', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyPrometheusRecordRuleYamlResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 修改模板内容
# @param request: Request instance for ModifyPrometheusTemp.
# @type request: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusTempRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ModifyPrometheusTempResponse`
def ModifyPrometheusTemp(request)
body = send_request('ModifyPrometheusTemp', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyPrometheusTempResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(ResumeGrafanaInstance)用于 Grafana 包年包月实例的停服续费,调用后按原版本续费一个月。仍在运行中的实例无法使用该接口进行续费。
# @param request: Request instance for ResumeGrafanaInstance.
# @type request: :class:`Tencentcloud::monitor::V20180724::ResumeGrafanaInstanceRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::ResumeGrafanaInstanceResponse`
def ResumeGrafanaInstance(request)
body = send_request('ResumeGrafanaInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ResumeGrafanaInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 初始化TMP实例,开启集成中心时调用
# @param request: Request instance for RunPrometheusInstance.
# @type request: :class:`Tencentcloud::monitor::V20180724::RunPrometheusInstanceRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::RunPrometheusInstanceResponse`
def RunPrometheusInstance(request)
body = send_request('RunPrometheusInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = RunPrometheusInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 设置一个策略为该告警策略类型、该项目的默认告警策略。
# 同一项目下相同的告警策略类型,就会被设置为非默认。
# @param request: Request instance for SetDefaultAlarmPolicy.
# @type request: :class:`Tencentcloud::monitor::V20180724::SetDefaultAlarmPolicyRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::SetDefaultAlarmPolicyResponse`
def SetDefaultAlarmPolicy(request)
body = send_request('SetDefaultAlarmPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = SetDefaultAlarmPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 同步模板到实例或者集群,针对V2版本实例
# @param request: Request instance for SyncPrometheusTemp.
# @type request: :class:`Tencentcloud::monitor::V20180724::SyncPrometheusTempRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::SyncPrometheusTempResponse`
def SyncPrometheusTemp(request)
body = send_request('SyncPrometheusTemp', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = SyncPrometheusTempResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 销毁按量 Prometheus 实例
# @param request: Request instance for TerminatePrometheusInstances.
# @type request: :class:`Tencentcloud::monitor::V20180724::TerminatePrometheusInstancesRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::TerminatePrometheusInstancesResponse`
def TerminatePrometheusInstances(request)
body = send_request('TerminatePrometheusInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = TerminatePrometheusInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除全部的关联对象
# @param request: Request instance for UnBindingAllPolicyObject.
# @type request: :class:`Tencentcloud::monitor::V20180724::UnBindingAllPolicyObjectRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UnBindingAllPolicyObjectResponse`
def UnBindingAllPolicyObject(request)
body = send_request('UnBindingAllPolicyObject', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UnBindingAllPolicyObjectResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除策略的关联对象
# @param request: Request instance for UnBindingPolicyObject.
# @type request: :class:`Tencentcloud::monitor::V20180724::UnBindingPolicyObjectRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UnBindingPolicyObjectResponse`
def UnBindingPolicyObject(request)
body = send_request('UnBindingPolicyObject', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UnBindingPolicyObjectResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 解除实例绑定的 Grafana 可视化实例
# @param request: Request instance for UnbindPrometheusManagedGrafana.
# @type request: :class:`Tencentcloud::monitor::V20180724::UnbindPrometheusManagedGrafanaRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UnbindPrometheusManagedGrafanaResponse`
def UnbindPrometheusManagedGrafana(request)
body = send_request('UnbindPrometheusManagedGrafana', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UnbindPrometheusManagedGrafanaResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除 Grafana Dashboard
# @param request: Request instance for UninstallGrafanaDashboard.
# @type request: :class:`Tencentcloud::monitor::V20180724::UninstallGrafanaDashboardRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UninstallGrafanaDashboardResponse`
def UninstallGrafanaDashboard(request)
body = send_request('UninstallGrafanaDashboard', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UninstallGrafanaDashboardResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除已安装的插件
# @param request: Request instance for UninstallGrafanaPlugins.
# @type request: :class:`Tencentcloud::monitor::V20180724::UninstallGrafanaPluginsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UninstallGrafanaPluginsResponse`
def UninstallGrafanaPlugins(request)
body = send_request('UninstallGrafanaPlugins', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UninstallGrafanaPluginsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新 Prometheus 的告警规则。
# 请注意,**告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description**,,请参考 [Prometheus Rule更多配置请参考](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/)。
# @param request: Request instance for UpdateAlertRule.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdateAlertRuleRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdateAlertRuleResponse`
def UpdateAlertRule(request)
body = send_request('UpdateAlertRule', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateAlertRuleResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新 Prometheus 报警策略状态
# @param request: Request instance for UpdateAlertRuleState.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdateAlertRuleStateRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdateAlertRuleStateResponse`
def UpdateAlertRuleState(request)
body = send_request('UpdateAlertRuleState', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateAlertRuleStateResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新 Grafana 的 DNS 配置
# @param request: Request instance for UpdateDNSConfig.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdateDNSConfigRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdateDNSConfigResponse`
def UpdateDNSConfig(request)
body = send_request('UpdateDNSConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateDNSConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新 exporter 集成配置
# @param request: Request instance for UpdateExporterIntegration.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdateExporterIntegrationRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdateExporterIntegrationResponse`
def UpdateExporterIntegration(request)
body = send_request('UpdateExporterIntegration', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateExporterIntegrationResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新 Grafana 配置
# @param request: Request instance for UpdateGrafanaConfig.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdateGrafanaConfigRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdateGrafanaConfigResponse`
def UpdateGrafanaConfig(request)
body = send_request('UpdateGrafanaConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateGrafanaConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新 Grafana 环境变量
# @param request: Request instance for UpdateGrafanaEnvironments.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdateGrafanaEnvironmentsRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdateGrafanaEnvironmentsResponse`
def UpdateGrafanaEnvironments(request)
body = send_request('UpdateGrafanaEnvironments', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateGrafanaEnvironmentsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新 Grafana 集成配置
# @param request: Request instance for UpdateGrafanaIntegration.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdateGrafanaIntegrationRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdateGrafanaIntegrationResponse`
def UpdateGrafanaIntegration(request)
body = send_request('UpdateGrafanaIntegration', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateGrafanaIntegrationResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新 Grafana 告警通道
# @param request: Request instance for UpdateGrafanaNotificationChannel.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdateGrafanaNotificationChannelRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdateGrafanaNotificationChannelResponse`
def UpdateGrafanaNotificationChannel(request)
body = send_request('UpdateGrafanaNotificationChannel', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateGrafanaNotificationChannelResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新 Grafana 白名单
# @param request: Request instance for UpdateGrafanaWhiteList.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdateGrafanaWhiteListRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdateGrafanaWhiteListResponse`
def UpdateGrafanaWhiteList(request)
body = send_request('UpdateGrafanaWhiteList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateGrafanaWhiteListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新 Prometheus CVM Agent 状态
# @param request: Request instance for UpdatePrometheusAgentStatus.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdatePrometheusAgentStatusRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdatePrometheusAgentStatusResponse`
def UpdatePrometheusAgentStatus(request)
body = send_request('UpdatePrometheusAgentStatus', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdatePrometheusAgentStatusResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新Prometheus告警规则分组
# @param request: Request instance for UpdatePrometheusAlertGroup.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdatePrometheusAlertGroupRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdatePrometheusAlertGroupResponse`
def UpdatePrometheusAlertGroup(request)
body = send_request('UpdatePrometheusAlertGroup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdatePrometheusAlertGroupResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 批量更新告警分组状态,将分组中全部告警规则更新为目标状态
# @param request: Request instance for UpdatePrometheusAlertGroupState.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdatePrometheusAlertGroupStateRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdatePrometheusAlertGroupStateResponse`
def UpdatePrometheusAlertGroupState(request)
body = send_request('UpdatePrometheusAlertGroupState', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdatePrometheusAlertGroupStateResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新 Prometheus Agent 抓取任务
# @param request: Request instance for UpdatePrometheusScrapeJob.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdatePrometheusScrapeJobRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdatePrometheusScrapeJobResponse`
def UpdatePrometheusScrapeJob(request)
body = send_request('UpdatePrometheusScrapeJob', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdatePrometheusScrapeJobResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新 Prometheus 的预聚合规则
# @param request: Request instance for UpdateRecordingRule.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdateRecordingRuleRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdateRecordingRuleResponse`
def UpdateRecordingRule(request)
body = send_request('UpdateRecordingRule', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateRecordingRuleResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新已授权账号的备注、权限信息,会直接覆盖原有的信息,不传则不会更新。
# @param request: Request instance for UpdateSSOAccount.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdateSSOAccountRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdateSSOAccountResponse`
def UpdateSSOAccount(request)
body = send_request('UpdateSSOAccount', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateSSOAccountResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 在腾讯云容器服务下更新 Prometheus 服务发现。
# <p>注意:前提条件,已经通过 Prometheus 控制台集成了对应的腾讯云容器服务,具体请参考
# <a href="https://cloud.tencent.com/document/product/248/48859" target="_blank">Agent 安装</a>。</p>
# @param request: Request instance for UpdateServiceDiscovery.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpdateServiceDiscoveryRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpdateServiceDiscoveryResponse`
def UpdateServiceDiscovery(request)
body = send_request('UpdateServiceDiscovery', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateServiceDiscoveryResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 升级 Grafana Dashboard
# @param request: Request instance for UpgradeGrafanaDashboard.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpgradeGrafanaDashboardRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpgradeGrafanaDashboardResponse`
def UpgradeGrafanaDashboard(request)
body = send_request('UpgradeGrafanaDashboard', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpgradeGrafanaDashboardResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 升级 Grafana 实例
# @param request: Request instance for UpgradeGrafanaInstance.
# @type request: :class:`Tencentcloud::monitor::V20180724::UpgradeGrafanaInstanceRequest`
# @rtype: :class:`Tencentcloud::monitor::V20180724::UpgradeGrafanaInstanceResponse`
def UpgradeGrafanaInstance(request)
body = send_request('UpgradeGrafanaInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpgradeGrafanaInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
end
end
end
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tencentcloud/tencentcloud-sdk-ruby.git
git@gitee.com:tencentcloud/tencentcloud-sdk-ruby.git
tencentcloud
tencentcloud-sdk-ruby
tencentcloud-sdk-ruby
master

搜索帮助