Class: TencentCloud::Bsca::V20210811::Client

Inherits:
Common::AbstractClient
  • Object
show all
Defined in:
lib/v20210811/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(credential, region, profile = nil) ⇒ Client

Returns a new instance of Client.



24
25
26
27
28
29
# File 'lib/v20210811/client.rb', line 24

def initialize(credential, region, profile = nil)
    api_version = '2021-08-11'
    api_endpoint = 'bsca.tencentcloudapi.com'
    sdk_version = 'BSCA_' + File.read(File.expand_path('../VERSION', __dir__)).strip
    super(credential, region, api_version, api_endpoint, sdk_version, profile)
end

Instance Method Details

#DescribeKBComponent(request) ⇒ Object

@rtype: :class:‘Tencentcloud::bsca::V20210811::DescribeKBComponentResponse`

Parameters:

  • request:

    Request instance for DescribeKBComponent.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/v20210811/client.rb', line 37

def DescribeKBComponent(request)
  body = send_request('DescribeKBComponent', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = DescribeKBComponentResponse.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

#DescribeKBComponentVersionList(request) ⇒ Object

@rtype: :class:‘Tencentcloud::bsca::V20210811::DescribeKBComponentVersionListResponse`

Parameters:

  • request:

    Request instance for DescribeKBComponentVersionList.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/v20210811/client.rb', line 61

def DescribeKBComponentVersionList(request)
  body = send_request('DescribeKBComponentVersionList', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = DescribeKBComponentVersionListResponse.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

#DescribeKBComponentVulnerability(request) ⇒ Object

@rtype: :class:‘Tencentcloud::bsca::V20210811::DescribeKBComponentVulnerabilityResponse`

Parameters:

  • request:

    Request instance for DescribeKBComponentVulnerability.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/v20210811/client.rb', line 85

def DescribeKBComponentVulnerability(request)
  body = send_request('DescribeKBComponentVulnerability', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = DescribeKBComponentVulnerabilityResponse.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

#DescribeKBLicense(request) ⇒ Object

@rtype: :class:‘Tencentcloud::bsca::V20210811::DescribeKBLicenseResponse`

Parameters:

  • request:

    Request instance for DescribeKBLicense.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/v20210811/client.rb', line 109

def DescribeKBLicense(request)
  body = send_request('DescribeKBLicense', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = DescribeKBLicenseResponse.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

#DescribeKBVulnerability(request) ⇒ Object

@rtype: :class:‘Tencentcloud::bsca::V20210811::DescribeKBVulnerabilityResponse`

Parameters:

  • request:

    Request instance for DescribeKBVulnerability.



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/v20210811/client.rb', line 133

def DescribeKBVulnerability(request)
  body = send_request('DescribeKBVulnerability', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = DescribeKBVulnerabilityResponse.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

#MatchKBPURLList(request) ⇒ Object

@rtype: :class:‘Tencentcloud::bsca::V20210811::MatchKBPURLListResponse`

Parameters:

  • request:

    Request instance for MatchKBPURLList.



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/v20210811/client.rb', line 157

def MatchKBPURLList(request)
  body = send_request('MatchKBPURLList', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = MatchKBPURLListResponse.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

#SearchKBComponent(request) ⇒ Object

@rtype: :class:‘Tencentcloud::bsca::V20210811::SearchKBComponentResponse`

Parameters:

  • request:

    Request instance for SearchKBComponent.



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/v20210811/client.rb', line 181

def SearchKBComponent(request)
  body = send_request('SearchKBComponent', request.serialize)
  response = JSON.parse(body)
  if response['Response'].key?('Error') == false
    model = SearchKBComponentResponse.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