Class: DatadogAPIClient::V2::CSMSettingsAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v2/api/csm_settings_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ CSMSettingsAPI

Returns a new instance of CSMSettingsAPI.



22
23
24
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 22

def initialize(api_client = DatadogAPIClient::APIClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



20
21
22
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

#get_csm_agentless_host_facet_info(facet, opts = {}) ⇒ Object

Get agentless host facet info.



29
30
31
32
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 29

def get_csm_agentless_host_facet_info(facet, opts = {})
  data, _status_code, _headers = get_csm_agentless_host_facet_info_with_http_info(facet, opts)
  data
end

#get_csm_agentless_host_facet_info_with_http_info(facet, opts = {}) ⇒ Array<(CsmHostFacetInfoResponse, Integer, Hash)>

Get agentless host facet info.

Get the value distribution for a specific agentless host facet, with optional search and filtering.

Parameters:

  • facet (String)

    The facet identifier to retrieve value distribution for. Valid values are resource_name, account_id, resource_type, cloud_provider, has_vulnerability_scanning, and has_posture_management.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :search (String)

    A search string to filter the facet values.

  • :query (String)

    A filter query to scope the facet value counts.

Returns:

  • (Array<(CsmHostFacetInfoResponse, Integer, Hash)>)

    CsmHostFacetInfoResponse data, response status code and response headers



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 43

def get_csm_agentless_host_facet_info_with_http_info(facet, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_csm_agentless_host_facet_info".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_csm_agentless_host_facet_info")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_csm_agentless_host_facet_info"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CSMSettingsAPI.get_csm_agentless_host_facet_info ...'
  end
  # verify the required parameter 'facet' is set
  if @api_client.config.client_side_validation && facet.nil?
    fail ArgumentError, "Missing the required parameter 'facet' when calling CSMSettingsAPI.get_csm_agentless_host_facet_info"
  end
  # resource path
  local_var_path = '/api/v2/csm/settings/agentless_hosts/facet_info'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'facet'] = facet
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CsmHostFacetInfoResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_csm_agentless_host_facet_info,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CSMSettingsAPI#get_csm_agentless_host_facet_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_csm_unified_host_facet_info(facet, opts = {}) ⇒ Object

Get unified host facet info.



105
106
107
108
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 105

def get_csm_unified_host_facet_info(facet, opts = {})
  data, _status_code, _headers = get_csm_unified_host_facet_info_with_http_info(facet, opts)
  data
end

#get_csm_unified_host_facet_info_with_http_info(facet, opts = {}) ⇒ Array<(CsmHostFacetInfoResponse, Integer, Hash)>

Get unified host facet info.

Get the value distribution for a specific unified host facet, with optional search and filtering.

Parameters:

  • facet (String)

    The facet identifier to retrieve value distribution for. Valid values include resource_name, account_id, resource_type, cloud_provider, agentless_vulnerability_scanning, agentless_posture_management, hostname, agent_version, os, cluster_name, agent_posture_management, agent_cws_enabled, agent_csm_vm_hosts_enabled, and agent_csm_vm_containers_enabled.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :search (String)

    A search string to filter the facet values.

  • :query (String)

    A filter query to scope the facet value counts.

Returns:

  • (Array<(CsmHostFacetInfoResponse, Integer, Hash)>)

    CsmHostFacetInfoResponse data, response status code and response headers



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 119

def get_csm_unified_host_facet_info_with_http_info(facet, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_csm_unified_host_facet_info".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_csm_unified_host_facet_info")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_csm_unified_host_facet_info"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CSMSettingsAPI.get_csm_unified_host_facet_info ...'
  end
  # verify the required parameter 'facet' is set
  if @api_client.config.client_side_validation && facet.nil?
    fail ArgumentError, "Missing the required parameter 'facet' when calling CSMSettingsAPI.get_csm_unified_host_facet_info"
  end
  # resource path
  local_var_path = '/api/v2/csm/settings/hosts/facet_info'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'facet'] = facet
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CsmHostFacetInfoResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_csm_unified_host_facet_info,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CSMSettingsAPI#get_csm_unified_host_facet_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_csm_agentless_host_facets(opts = {}) ⇒ Object

List agentless host facets.



181
182
183
184
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 181

def list_csm_agentless_host_facets(opts = {})
  data, _status_code, _headers = list_csm_agentless_host_facets_with_http_info(opts)
  data
end

#list_csm_agentless_host_facets_with_http_info(opts = {}) ⇒ Array<(CsmAgentlessHostFacetsResponse, Integer, Hash)>

List agentless host facets.

Get the list of available facets for filtering agentless hosts.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 192

def list_csm_agentless_host_facets_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_csm_agentless_host_facets".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_csm_agentless_host_facets")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_csm_agentless_host_facets"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CSMSettingsAPI.list_csm_agentless_host_facets ...'
  end
  # resource path
  local_var_path = '/api/v2/csm/settings/agentless_hosts/facets'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CsmAgentlessHostFacetsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :list_csm_agentless_host_facets,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CSMSettingsAPI#list_csm_agentless_host_facets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_csm_agentless_hosts(opts = {}) ⇒ Object

List agentless hosts.



247
248
249
250
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 247

def list_csm_agentless_hosts(opts = {})
  data, _status_code, _headers = list_csm_agentless_hosts_with_http_info(opts)
  data
end

#list_csm_agentless_hosts_with_http_info(opts = {}) ⇒ Array<(CsmAgentlessHostsResponse, Integer, Hash)>

List agentless hosts.

Get the list of agentless hosts for CSM, with optional pagination and filtering.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page index for pagination (zero-based).

  • :size (Integer)

    The number of agentless hosts to return per page.

  • :query (String)

    A search query string to filter agentless hosts.

Returns:

  • (Array<(CsmAgentlessHostsResponse, Integer, Hash)>)

    CsmAgentlessHostsResponse data, response status code and response headers



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 261

def list_csm_agentless_hosts_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_csm_agentless_hosts".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_csm_agentless_hosts")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_csm_agentless_hosts"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CSMSettingsAPI.list_csm_agentless_hosts ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 1000000
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CSMSettingsAPI.list_csm_agentless_hosts, must be smaller than or equal to 1000000.'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CSMSettingsAPI.list_csm_agentless_hosts, must be greater than or equal to 0.'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling CSMSettingsAPI.list_csm_agentless_hosts, must be smaller than or equal to 100.'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling CSMSettingsAPI.list_csm_agentless_hosts, must be greater than or equal to 1.'
  end
  # resource path
  local_var_path = '/api/v2/csm/settings/agentless_hosts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CsmAgentlessHostsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :list_csm_agentless_hosts,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CSMSettingsAPI#list_csm_agentless_hosts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_csm_unified_host_facets(opts = {}) ⇒ Object

List unified host facets.



331
332
333
334
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 331

def list_csm_unified_host_facets(opts = {})
  data, _status_code, _headers = list_csm_unified_host_facets_with_http_info(opts)
  data
end

#list_csm_unified_host_facets_with_http_info(opts = {}) ⇒ Array<(CsmUnifiedHostFacetsResponse, Integer, Hash)>

List unified host facets.

Get the list of available facets for filtering unified hosts.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 342

def list_csm_unified_host_facets_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_csm_unified_host_facets".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_csm_unified_host_facets")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_csm_unified_host_facets"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CSMSettingsAPI.list_csm_unified_host_facets ...'
  end
  # resource path
  local_var_path = '/api/v2/csm/settings/hosts/facets'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CsmUnifiedHostFacetsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :list_csm_unified_host_facets,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CSMSettingsAPI#list_csm_unified_host_facets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_csm_unified_hosts(opts = {}) ⇒ Object

List unified hosts.



397
398
399
400
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 397

def list_csm_unified_hosts(opts = {})
  data, _status_code, _headers = list_csm_unified_hosts_with_http_info(opts)
  data
end

#list_csm_unified_hosts_with_http_info(opts = {}) ⇒ Array<(CsmUnifiedHostsResponse, Integer, Hash)>

List unified hosts.

Get the list of unified hosts for CSM, combining agent and agentless host data, with optional pagination and filtering.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page index for pagination (zero-based).

  • :size (Integer)

    The number of hosts to return per page.

  • :query (String)

    A search query string to filter unified hosts.

Returns:

  • (Array<(CsmUnifiedHostsResponse, Integer, Hash)>)

    CsmUnifiedHostsResponse data, response status code and response headers



411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'lib/datadog_api_client/v2/api/csm_settings_api.rb', line 411

def list_csm_unified_hosts_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_csm_unified_hosts".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_csm_unified_hosts")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_csm_unified_hosts"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CSMSettingsAPI.list_csm_unified_hosts ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 1000000
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CSMSettingsAPI.list_csm_unified_hosts, must be smaller than or equal to 1000000.'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CSMSettingsAPI.list_csm_unified_hosts, must be greater than or equal to 0.'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling CSMSettingsAPI.list_csm_unified_hosts, must be smaller than or equal to 100.'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling CSMSettingsAPI.list_csm_unified_hosts, must be greater than or equal to 1.'
  end
  # resource path
  local_var_path = '/api/v2/csm/settings/hosts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CsmUnifiedHostsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :list_csm_unified_hosts,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CSMSettingsAPI#list_csm_unified_hosts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end