Class: DatadogAPIClient::V2::FleetAutomationAPI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of FleetAutomationAPI.



22
23
24
# File 'lib/datadog_api_client/v2/api/fleet_automation_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/fleet_automation_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

#cancel_fleet_deployment(deployment_id, opts = {}) ⇒ Object

Cancel a deployment.



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

def cancel_fleet_deployment(deployment_id, opts = {})
  cancel_fleet_deployment_with_http_info(deployment_id, opts)
  nil
end

#cancel_fleet_deployment_with_http_info(deployment_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Cancel a deployment.

Cancel an active deployment and stop all pending operations. When you cancel a deployment:

  • All pending operations on hosts that haven’t started yet are stopped

  • Operations currently in progress on hosts may complete or be interrupted, depending on their current state

  • Configuration changes or package upgrades already applied to hosts are not rolled back

After cancellation, you can view the final state of the deployment using the GET endpoint to see which hosts were successfully updated before the cancellation.

Parameters:

  • deployment_id (String)

    The unique identifier of the deployment to cancel.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
101
102
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 48

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.cancel_fleet_deployment ...'
  end
  # verify the required parameter 'deployment_id' is set
  if @api_client.config.client_side_validation && deployment_id.nil?
    fail ArgumentError, "Missing the required parameter 'deployment_id' when calling FleetAutomationAPI.cancel_fleet_deployment"
  end
  # resource path
  local_var_path = '/api/unstable/fleet/deployments/{deployment_id}/cancel'.sub('{deployment_id}', CGI.escape(deployment_id.to_s).gsub('%2F', '/'))

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :cancel_fleet_deployment,
    :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::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FleetAutomationAPI#cancel_fleet_deployment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_fleet_deployment_configure(body, opts = {}) ⇒ Object

Create a configuration deployment.



107
108
109
110
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 107

def create_fleet_deployment_configure(body, opts = {})
  data, _status_code, _headers = create_fleet_deployment_configure_with_http_info(body, opts)
  data
end

#create_fleet_deployment_configure_with_http_info(body, opts = {}) ⇒ Array<(FleetDeploymentResponse, Integer, Hash)>

Create a configuration deployment.

Create a new deployment to apply configuration changes to a fleet of hosts matching the specified filter query.

This endpoint supports two types of configuration operations:

  • ‘merge-patch`: Merges the provided patch data with the existing configuration file, creating the file if it doesn’t exist

  • ‘delete`: Removes the specified configuration file from the target hosts

The deployment is created and started automatically. You can specify multiple configuration operations that will be executed in order on each target host. Use the filter query to target specific hosts using the Datadog query syntax.

Parameters:

Returns:

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

    FleetDeploymentResponse data, response status code and response headers



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
177
178
179
180
181
182
183
184
185
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 129

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.create_fleet_deployment_configure ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling FleetAutomationAPI.create_fleet_deployment_configure"
  end
  # resource path
  local_var_path = '/api/unstable/fleet/deployments/configure'

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :create_fleet_deployment_configure,
    :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::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FleetAutomationAPI#create_fleet_deployment_configure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_fleet_deployment_upgrade(body, opts = {}) ⇒ Object

Upgrade hosts.



190
191
192
193
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 190

def create_fleet_deployment_upgrade(body, opts = {})
  data, _status_code, _headers = create_fleet_deployment_upgrade_with_http_info(body, opts)
  data
end

#create_fleet_deployment_upgrade_with_http_info(body, opts = {}) ⇒ Array<(FleetDeploymentResponse, Integer, Hash)>

Upgrade hosts.

Create and immediately start a new package upgrade on hosts matching the specified filter query.

This endpoint allows you to upgrade the Datadog Agent to a specific version on hosts matching the specified filter query.

The deployment is created and started automatically. The system will:

  1. Identify all hosts matching the filter query

  2. Validate that the specified version is available

  3. Begin rolling out the package upgrade to the target hosts

Parameters:

Returns:

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

    FleetDeploymentResponse data, response status code and response headers



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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 211

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.create_fleet_deployment_upgrade ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling FleetAutomationAPI.create_fleet_deployment_upgrade"
  end
  # resource path
  local_var_path = '/api/unstable/fleet/deployments/upgrade'

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :create_fleet_deployment_upgrade,
    :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::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FleetAutomationAPI#create_fleet_deployment_upgrade\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_fleet_schedule(body, opts = {}) ⇒ Object

Create a schedule.



272
273
274
275
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 272

def create_fleet_schedule(body, opts = {})
  data, _status_code, _headers = create_fleet_schedule_with_http_info(body, opts)
  data
end

#create_fleet_schedule_with_http_info(body, opts = {}) ⇒ Array<(FleetScheduleResponse, Integer, Hash)>

Create a schedule.

Create a new schedule for automated package upgrades.

Schedules define when and how often to automatically deploy package upgrades to a fleet of hosts. Each schedule includes:

  • A filter query to select target hosts

  • A recurrence rule defining maintenance windows

  • A version strategy (e.g., always latest, or N versions behind latest)

When the schedule triggers during a maintenance window, it automatically creates a deployment that upgrades the Datadog Agent to the specified version on all matching hosts.

Parameters:

  • body (FleetScheduleCreateRequest)

    Request payload containing the schedule details.

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

    the optional parameters

Returns:

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

    FleetScheduleResponse data, response status code and response headers



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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 293

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.create_fleet_schedule ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling FleetAutomationAPI.create_fleet_schedule"
  end
  # resource path
  local_var_path = '/api/unstable/fleet/schedules'

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :create_fleet_schedule,
    :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::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FleetAutomationAPI#create_fleet_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_fleet_schedule(id, opts = {}) ⇒ Object

Delete a schedule.



354
355
356
357
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 354

def delete_fleet_schedule(id, opts = {})
  delete_fleet_schedule_with_http_info(id, opts)
  nil
end

#delete_fleet_schedule_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a schedule.

Delete a schedule permanently.

When you delete a schedule:

  • The schedule is permanently removed and will no longer create deployments

  • Any deployments already created by this schedule are not affected

  • This action cannot be undone

If you want to temporarily stop a schedule from creating deployments, consider updating its status to “inactive” instead of deleting it.

Parameters:

  • id (String)

    The unique identifier of the schedule to delete.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 374

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.delete_fleet_schedule ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FleetAutomationAPI.delete_fleet_schedule"
  end
  # resource path
  local_var_path = '/api/unstable/fleet/schedules/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :delete_fleet_schedule,
    :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::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FleetAutomationAPI#delete_fleet_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_fleet_agent_info(agent_key, opts = {}) ⇒ Object

Get detailed information about an agent.



433
434
435
436
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 433

def get_fleet_agent_info(agent_key, opts = {})
  data, _status_code, _headers = get_fleet_agent_info_with_http_info(agent_key, opts)
  data
end

#get_fleet_agent_info_with_http_info(agent_key, opts = {}) ⇒ Array<(FleetAgentInfoResponse, Integer, Hash)>

Get detailed information about an agent.

Retrieve detailed information about a specific Datadog Agent. This endpoint returns comprehensive information about an agent including:

  • Agent details and metadata

  • Configured integrations organized by status (working, warning, error, missing)

  • Detected integrations

  • Configuration files and layers

Parameters:

  • agent_key (String)

    The unique identifier (agent key) for the Datadog Agent.

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

    the optional parameters

Returns:

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

    FleetAgentInfoResponse data, response status code and response headers



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
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 450

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.get_fleet_agent_info ...'
  end
  # verify the required parameter 'agent_key' is set
  if @api_client.config.client_side_validation && agent_key.nil?
    fail ArgumentError, "Missing the required parameter 'agent_key' when calling FleetAutomationAPI.get_fleet_agent_info"
  end
  # resource path
  local_var_path = '/api/unstable/fleet/agents/{agent_key}'.sub('{agent_key}', CGI.escape(agent_key.to_s).gsub('%2F', '/'))

  # 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] || 'FleetAgentInfoResponse'

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

  new_options = opts.merge(
    :operation => :get_fleet_agent_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: FleetAutomationAPI#get_fleet_agent_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_fleet_deployment(deployment_id, opts = {}) ⇒ Object

Get a configuration deployment by ID.



509
510
511
512
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 509

def get_fleet_deployment(deployment_id, opts = {})
  data, _status_code, _headers = get_fleet_deployment_with_http_info(deployment_id, opts)
  data
end

#get_fleet_deployment_with_http_info(deployment_id, opts = {}) ⇒ Array<(FleetDeploymentResponse, Integer, Hash)>

Get a configuration deployment by ID.

Retrieve detailed information about a specific deployment using its unique identifier. This endpoint returns comprehensive information about a deployment, including:

  • Deployment metadata (ID, type, filter query)

  • Total number of target hosts

  • Current high-level status (pending, running, succeeded, failed)

  • Estimated completion time

  • Configuration operations that were or are being applied

  • Detailed host list: A paginated array of hosts included in this deployment with individual host status, current package versions, and any errors

The host list provides visibility into the per-host execution status, allowing you to:

  • Monitor which hosts have completed successfully

  • Identify hosts that are still in progress

  • Investigate failures on specific hosts

  • View current package versions installed on each host (including initial, target, and current versions for each package)

Pagination: Use the ‘limit` and `page` query parameters to paginate through hosts. The response includes pagination metadata in the `meta.hosts` field with information about the current page, total pages, and total host count. The default page size is 50 hosts, with a maximum of 100.

Parameters:

  • deployment_id (String)

    The unique identifier of the deployment to retrieve.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Maximum number of hosts to return per page. Default is 50, maximum is 100.

  • :page (Integer)

    Page index for pagination (zero-based). Use this to retrieve subsequent pages of hosts.

Returns:

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

    FleetDeploymentResponse data, response status code and response headers



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 542

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.get_fleet_deployment ...'
  end
  # verify the required parameter 'deployment_id' is set
  if @api_client.config.client_side_validation && deployment_id.nil?
    fail ArgumentError, "Missing the required parameter 'deployment_id' when calling FleetAutomationAPI.get_fleet_deployment"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FleetAutomationAPI.get_fleet_deployment, must be smaller than or equal to 100.'
  end
  # resource path
  local_var_path = '/api/unstable/fleet/deployments/{deployment_id}'.sub('{deployment_id}', CGI.escape(deployment_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].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] || 'FleetDeploymentResponse'

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

  new_options = opts.merge(
    :operation => :get_fleet_deployment,
    :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: FleetAutomationAPI#get_fleet_deployment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_fleet_schedule(id, opts = {}) ⇒ Object

Get a schedule by ID.



606
607
608
609
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 606

def get_fleet_schedule(id, opts = {})
  data, _status_code, _headers = get_fleet_schedule_with_http_info(id, opts)
  data
end

#get_fleet_schedule_with_http_info(id, opts = {}) ⇒ Array<(FleetScheduleResponse, Integer, Hash)>

Get a schedule by ID.

Retrieve detailed information about a specific schedule using its unique identifier.

This endpoint returns comprehensive information about a schedule, including:

  • Schedule metadata (ID, name, creation/update timestamps)

  • Filter query for selecting target hosts

  • Recurrence rule defining when deployments are triggered

  • Version strategy for package upgrades

  • Current status (active or inactive)

Parameters:

  • id (String)

    The unique identifier of the schedule to retrieve.

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

    the optional parameters

Returns:

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

    FleetScheduleResponse data, response status code and response headers



625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 625

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.get_fleet_schedule ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FleetAutomationAPI.get_fleet_schedule"
  end
  # resource path
  local_var_path = '/api/unstable/fleet/schedules/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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] || 'FleetScheduleResponse'

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

  new_options = opts.merge(
    :operation => :get_fleet_schedule,
    :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: FleetAutomationAPI#get_fleet_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fleet_agent_tracers(agent_key, opts = {}) ⇒ Object

List tracers for a specific agent.



773
774
775
776
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 773

def list_fleet_agent_tracers(agent_key, opts = {})
  data, _status_code, _headers = list_fleet_agent_tracers_with_http_info(agent_key, opts)
  data
end

#list_fleet_agent_tracers_with_http_info(agent_key, opts = {}) ⇒ Array<(FleetTracersResponse, Integer, Hash)>

List tracers for a specific agent.

Retrieve a paginated list of tracers for a specific agent.

This endpoint returns tracers associated with a given agent key, identified by the agent’s hostname. Use this to discover telemetry-derived service names for a particular host.

Parameters:

  • agent_key (String)

    The unique identifier (agent key) for the Datadog Agent.

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

    the optional parameters

Options Hash (opts):

  • :page_number (Integer)

    Page number for pagination (starts at 0).

  • :page_size (Integer)

    Number of results per page (must be greater than 0 and less than or equal to 100).

  • :sort_attribute (String)

    Attribute to sort by.

  • :sort_descending (Boolean)

    Sort order (true for descending, false for ascending).

Returns:

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

    FleetTracersResponse data, response status code and response headers



792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 792

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_agent_tracers ...'
  end
  # verify the required parameter 'agent_key' is set
  if @api_client.config.client_side_validation && agent_key.nil?
    fail ArgumentError, "Missing the required parameter 'agent_key' when calling FleetAutomationAPI.list_fleet_agent_tracers"
  end
  if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling FleetAutomationAPI.list_fleet_agent_tracers, must be greater than or equal to 0.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_agent_tracers, must be smaller than or equal to 100.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_agent_tracers, must be greater than or equal to 1.'
  end
  # resource path
  local_var_path = '/api/unstable/fleet/agents/{agent_key}/tracers'.sub('{agent_key}', CGI.escape(agent_key.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'sort_attribute'] = opts[:'sort_attribute'] if !opts[:'sort_attribute'].nil?
  query_params[:'sort_descending'] = opts[:'sort_descending'] if !opts[:'sort_descending'].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] || 'FleetTracersResponse'

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

  new_options = opts.merge(
    :operation => :list_fleet_agent_tracers,
    :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: FleetAutomationAPI#list_fleet_agent_tracers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fleet_agent_versions(opts = {}) ⇒ Object

List all available Agent versions.



864
865
866
867
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 864

def list_fleet_agent_versions(opts = {})
  data, _status_code, _headers = list_fleet_agent_versions_with_http_info(opts)
  data
end

#list_fleet_agent_versions_with_http_info(opts = {}) ⇒ Array<(FleetAgentVersionsResponse, Integer, Hash)>

List all available Agent versions.

Retrieve a list of all available Datadog Agent versions.

This endpoint returns the available Agent versions that can be deployed to your fleet. These versions are used when creating deployments or configuring schedules for automated Agent upgrades.

Parameters:

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

    the optional parameters

Returns:

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

    FleetAgentVersionsResponse data, response status code and response headers



879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 879

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_agent_versions ...'
  end
  # resource path
  local_var_path = '/api/unstable/fleet/agent_versions'

  # 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] || 'FleetAgentVersionsResponse'

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

  new_options = opts.merge(
    :operation => :list_fleet_agent_versions,
    :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: FleetAutomationAPI#list_fleet_agent_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fleet_agents(opts = {}) ⇒ Object

List all Datadog Agents.



684
685
686
687
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 684

def list_fleet_agents(opts = {})
  data, _status_code, _headers = list_fleet_agents_with_http_info(opts)
  data
end

#list_fleet_agents_with_http_info(opts = {}) ⇒ Array<(FleetAgentsResponse, Integer, Hash)>

List all Datadog Agents.

Retrieve a paginated list of all Datadog Agents. This endpoint returns a paginated list of all Datadog Agents with support for pagination, sorting, and filtering. Use the ‘page_number` and `page_size` query parameters to paginate through results.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_number (Integer)

    Page number for pagination (starts at 0).

  • :page_size (Integer)

    Number of results per page (must be greater than 0 and less than or equal to 100).

  • :sort_attribute (String)

    Attribute to sort by.

  • :sort_descending (Boolean)

    Sort order (true for descending, false for ascending).

  • :tags (String)

    Comma-separated list of tags to filter agents.

  • :filter (String)

    Filter string for narrowing down agent results.

Returns:

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

    FleetAgentsResponse data, response status code and response headers



703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 703

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_agents ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling FleetAutomationAPI.list_fleet_agents, must be greater than or equal to 0.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_agents, must be smaller than or equal to 100.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_agents, must be greater than or equal to 1.'
  end
  # resource path
  local_var_path = '/api/unstable/fleet/agents'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'sort_attribute'] = opts[:'sort_attribute'] if !opts[:'sort_attribute'].nil?
  query_params[:'sort_descending'] = opts[:'sort_descending'] if !opts[:'sort_descending'].nil?
  query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].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] || 'FleetAgentsResponse'

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

  new_options = opts.merge(
    :operation => :list_fleet_agents,
    :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: FleetAutomationAPI#list_fleet_agents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fleet_clusters(opts = {}) ⇒ Object

List all fleet clusters.



934
935
936
937
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 934

def list_fleet_clusters(opts = {})
  data, _status_code, _headers = list_fleet_clusters_with_http_info(opts)
  data
end

#list_fleet_clusters_with_http_info(opts = {}) ⇒ Array<(FleetClustersResponse, Integer, Hash)>

List all fleet clusters.

Retrieve a paginated list of Kubernetes clusters in the fleet.

This endpoint returns clusters with metadata including node counts, agent versions, enabled products, and associated services. Use the ‘page_number` and `page_size` query parameters to paginate through results.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_number (Integer)

    Page number for pagination (starts at 0).

  • :page_size (Integer)

    Number of results per page (must be greater than 0 and less than or equal to 100).

  • :sort_attribute (String)

    Attribute to sort by.

  • :sort_descending (Boolean)

    Sort order (true for descending, false for ascending).

  • :filter (String)

    Filter string for narrowing down cluster results.

  • :tags (String)

    Comma-separated list of tags to filter clusters.

Returns:

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

    FleetClustersResponse data, response status code and response headers



955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 955

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_clusters ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling FleetAutomationAPI.list_fleet_clusters, must be greater than or equal to 0.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_clusters, must be smaller than or equal to 100.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_clusters, must be greater than or equal to 1.'
  end
  # resource path
  local_var_path = '/api/unstable/fleet/clusters'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'sort_attribute'] = opts[:'sort_attribute'] if !opts[:'sort_attribute'].nil?
  query_params[:'sort_descending'] = opts[:'sort_descending'] if !opts[:'sort_descending'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].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] || 'FleetClustersResponse'

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

  new_options = opts.merge(
    :operation => :list_fleet_clusters,
    :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: FleetAutomationAPI#list_fleet_clusters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fleet_deployments(opts = {}) ⇒ Object

List all deployments.



1025
1026
1027
1028
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 1025

def list_fleet_deployments(opts = {})
  data, _status_code, _headers = list_fleet_deployments_with_http_info(opts)
  data
end

#list_fleet_deployments_with_http_info(opts = {}) ⇒ Array<(FleetDeploymentsResponse, Integer, Hash)>

List all deployments.

Retrieve a list of all deployments for fleet automation. Use the ‘page_size` and `page_offset` parameters to paginate results.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Number of deployments to return per page. Maximum value is 100.

  • :page_offset (Integer)

    Index of the first deployment to return. Use this with ‘page_size` to paginate through results.

Returns:

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

    FleetDeploymentsResponse data, response status code and response headers



1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 1039

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_deployments ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_deployments, must be smaller than or equal to 100.'
  end
  # resource path
  local_var_path = '/api/unstable/fleet/deployments'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page_offset'] = opts[:'page_offset'] if !opts[:'page_offset'].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] || 'FleetDeploymentsResponse'

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

  new_options = opts.merge(
    :operation => :list_fleet_deployments,
    :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: FleetAutomationAPI#list_fleet_deployments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fleet_instrumented_pods(cluster_name, opts = {}) ⇒ Object

List instrumented pods for a cluster.



1099
1100
1101
1102
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 1099

def list_fleet_instrumented_pods(cluster_name, opts = {})
  data, _status_code, _headers = list_fleet_instrumented_pods_with_http_info(cluster_name, opts)
  data
end

#list_fleet_instrumented_pods_with_http_info(cluster_name, opts = {}) ⇒ Array<(FleetInstrumentedPodsResponse, Integer, Hash)>

List instrumented pods for a cluster.

Retrieve the list of pods targeted for Single Step Instrumentation (SSI) injection in a specific Kubernetes cluster.

This endpoint returns pod groups organized by owner reference (deployment, statefulset, etc.) with their injection annotations and applied targets. Use the clusters list endpoint to discover available cluster names.

Parameters:

  • cluster_name (String)

    The name of the Kubernetes cluster.

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

    the optional parameters

Returns:



1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 1116

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_instrumented_pods ...'
  end
  # verify the required parameter 'cluster_name' is set
  if @api_client.config.client_side_validation && cluster_name.nil?
    fail ArgumentError, "Missing the required parameter 'cluster_name' when calling FleetAutomationAPI.list_fleet_instrumented_pods"
  end
  # resource path
  local_var_path = '/api/unstable/fleet/clusters/{cluster_name}/instrumented_pods'.sub('{cluster_name}', CGI.escape(cluster_name.to_s).gsub('%2F', '/'))

  # 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] || 'FleetInstrumentedPodsResponse'

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

  new_options = opts.merge(
    :operation => :list_fleet_instrumented_pods,
    :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: FleetAutomationAPI#list_fleet_instrumented_pods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fleet_schedules(opts = {}) ⇒ Object

List all schedules.



1175
1176
1177
1178
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 1175

def list_fleet_schedules(opts = {})
  data, _status_code, _headers = list_fleet_schedules_with_http_info(opts)
  data
end

#list_fleet_schedules_with_http_info(opts = {}) ⇒ Array<(FleetSchedulesResponse, Integer, Hash)>

List all schedules.

Retrieve a list of all schedules for automated fleet deployments.

Schedules allow you to automate package upgrades by defining maintenance windows and recurrence rules. Each schedule automatically creates deployments based on its configuration.

Parameters:

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

    the optional parameters

Returns:

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

    FleetSchedulesResponse data, response status code and response headers



1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 1190

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_schedules ...'
  end
  # resource path
  local_var_path = '/api/unstable/fleet/schedules'

  # 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] || 'FleetSchedulesResponse'

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

  new_options = opts.merge(
    :operation => :list_fleet_schedules,
    :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: FleetAutomationAPI#list_fleet_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fleet_tracers(opts = {}) ⇒ Object

List all fleet tracers.



1245
1246
1247
1248
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 1245

def list_fleet_tracers(opts = {})
  data, _status_code, _headers = list_fleet_tracers_with_http_info(opts)
  data
end

#list_fleet_tracers_with_http_info(opts = {}) ⇒ Array<(FleetTracersResponse, Integer, Hash)>

List all fleet tracers.

Retrieve a paginated list of all fleet tracers.

This endpoint returns telemetry-derived service names from the SDK telemetry pipeline. These names may differ from span-derived names in APM and are useful for querying service library configurations. Use the ‘page_number` and `page_size` query parameters to paginate through results.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_number (Integer)

    Page number for pagination (starts at 0).

  • :page_size (Integer)

    Number of results per page (must be greater than 0 and less than or equal to 100).

  • :sort_attribute (String)

    Attribute to sort by.

  • :sort_descending (Boolean)

    Sort order (true for descending, false for ascending).

  • :filter (String)

    Filter string for narrowing down tracer results.

Returns:

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

    FleetTracersResponse data, response status code and response headers



1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 1266

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_tracers ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling FleetAutomationAPI.list_fleet_tracers, must be greater than or equal to 0.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_tracers, must be smaller than or equal to 100.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_tracers, must be greater than or equal to 1.'
  end
  # resource path
  local_var_path = '/api/unstable/fleet/tracers'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'sort_attribute'] = opts[:'sort_attribute'] if !opts[:'sort_attribute'].nil?
  query_params[:'sort_descending'] = opts[:'sort_descending'] if !opts[:'sort_descending'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].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] || 'FleetTracersResponse'

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

  new_options = opts.merge(
    :operation => :list_fleet_tracers,
    :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: FleetAutomationAPI#list_fleet_tracers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#trigger_fleet_schedule(id, opts = {}) ⇒ Object

Trigger a schedule deployment.



1335
1336
1337
1338
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 1335

def trigger_fleet_schedule(id, opts = {})
  data, _status_code, _headers = trigger_fleet_schedule_with_http_info(id, opts)
  data
end

#trigger_fleet_schedule_with_http_info(id, opts = {}) ⇒ Array<(FleetDeploymentResponse, Integer, Hash)>

Trigger a schedule deployment.

Manually trigger a schedule to immediately create and start a deployment.

This endpoint allows you to manually initiate a deployment using the schedule’s configuration, without waiting for the next scheduled maintenance window. This is useful for:

  • Testing a schedule before it runs automatically

  • Performing an emergency update outside the regular maintenance window

  • Creating an ad-hoc deployment with the same settings as a schedule

The deployment is created immediately with:

  • The same filter query as the schedule

  • The package version determined by the schedule’s version strategy

  • All matching hosts as targets

The manually triggered deployment is independent of the schedule and does not affect the schedule’s normal recurrence pattern.

Parameters:

  • id (String)

    The unique identifier of the schedule to trigger.

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

    the optional parameters

Returns:

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

    FleetDeploymentResponse data, response status code and response headers



1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 1362

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.trigger_fleet_schedule ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FleetAutomationAPI.trigger_fleet_schedule"
  end
  # resource path
  local_var_path = '/api/unstable/fleet/schedules/{id}/trigger'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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] || 'FleetDeploymentResponse'

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

  new_options = opts.merge(
    :operation => :trigger_fleet_schedule,
    :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::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FleetAutomationAPI#trigger_fleet_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_fleet_schedule(id, body, opts = {}) ⇒ Object

Update a schedule.



1421
1422
1423
1424
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 1421

def update_fleet_schedule(id, body, opts = {})
  data, _status_code, _headers = update_fleet_schedule_with_http_info(id, body, opts)
  data
end

#update_fleet_schedule_with_http_info(id, body, opts = {}) ⇒ Array<(FleetScheduleResponse, Integer, Hash)>

Update a schedule.

Partially update a schedule by providing only the fields you want to change.

This endpoint allows you to modify specific attributes of a schedule without affecting other fields. Common use cases include:

  • Changing the schedule status between active and inactive

  • Updating the maintenance window times

  • Modifying the filter query to target different hosts

  • Adjusting the version strategy

Only include the fields you want to update in the request body. All fields are optional in a PATCH request.

Parameters:

  • id (String)

    The unique identifier of the schedule to update.

  • body (FleetSchedulePatchRequest)

    Request payload containing the fields to update.

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

    the optional parameters

Returns:

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

    FleetScheduleResponse data, response status code and response headers



1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
# File 'lib/datadog_api_client/v2/api/fleet_automation_api.rb', line 1444

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.update_fleet_schedule ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FleetAutomationAPI.update_fleet_schedule"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling FleetAutomationAPI.update_fleet_schedule"
  end
  # resource path
  local_var_path = '/api/unstable/fleet/schedules/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :update_fleet_schedule,
    :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::Patch, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FleetAutomationAPI#update_fleet_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end