Class: DatadogAPIClient::V2::ActionsDatastoresAPI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of ActionsDatastoresAPI.



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

def api_client
  @api_client
end

Instance Method Details

#bulk_delete_datastore_items(datastore_id, body, opts = {}) ⇒ Object

Bulk delete datastore items.



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

def bulk_delete_datastore_items(datastore_id, body, opts = {})
  data, _status_code, _headers = bulk_delete_datastore_items_with_http_info(datastore_id, body, opts)
  data
end

#bulk_delete_datastore_items_with_http_info(datastore_id, body, opts = {}) ⇒ Array<(DeleteAppsDatastoreItemResponseArray, Integer, Hash)>

Bulk delete datastore items.

Deletes multiple items from a datastore by their keys in a single operation.

Parameters:

Returns:



42
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
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 42

def bulk_delete_datastore_items_with_http_info(datastore_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionsDatastoresAPI.bulk_delete_datastore_items ...'
  end
  # verify the required parameter 'datastore_id' is set
  if @api_client.config.client_side_validation && datastore_id.nil?
    fail ArgumentError, "Missing the required parameter 'datastore_id' when calling ActionsDatastoresAPI.bulk_delete_datastore_items"
  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 ActionsDatastoresAPI.bulk_delete_datastore_items"
  end
  # resource path
  local_var_path = '/api/v2/actions-datastores/{datastore_id}/items/bulk'.sub('{datastore_id}', CGI.escape(datastore_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] || 'DeleteAppsDatastoreItemResponseArray'

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

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

#bulk_write_datastore_items(datastore_id, body, opts = {}) ⇒ Object

Bulk write datastore items.



101
102
103
104
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 101

def bulk_write_datastore_items(datastore_id, body, opts = {})
  data, _status_code, _headers = bulk_write_datastore_items_with_http_info(datastore_id, body, opts)
  data
end

#bulk_write_datastore_items_with_http_info(datastore_id, body, opts = {}) ⇒ Array<(PutAppsDatastoreItemResponseArray, Integer, Hash)>

Bulk write datastore items.

Creates or replaces multiple items in a datastore by their keys in a single operation.

Parameters:

  • datastore_id (String)

    The unique identifier of the datastore to retrieve.

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

    the optional parameters

Returns:



114
115
116
117
118
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
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 114

def bulk_write_datastore_items_with_http_info(datastore_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionsDatastoresAPI.bulk_write_datastore_items ...'
  end
  # verify the required parameter 'datastore_id' is set
  if @api_client.config.client_side_validation && datastore_id.nil?
    fail ArgumentError, "Missing the required parameter 'datastore_id' when calling ActionsDatastoresAPI.bulk_write_datastore_items"
  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 ActionsDatastoresAPI.bulk_write_datastore_items"
  end
  # resource path
  local_var_path = '/api/v2/actions-datastores/{datastore_id}/items/bulk'.sub('{datastore_id}', CGI.escape(datastore_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] || 'PutAppsDatastoreItemResponseArray'

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

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

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

Create datastore.



173
174
175
176
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 173

def create_datastore(body, opts = {})
  data, _status_code, _headers = create_datastore_with_http_info(body, opts)
  data
end

#create_datastore_with_http_info(body, opts = {}) ⇒ Array<(CreateAppsDatastoreResponse, Integer, Hash)>

Create datastore.

Creates a new datastore.

Parameters:

Returns:

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

    CreateAppsDatastoreResponse data, response status code and response headers



185
186
187
188
189
190
191
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
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 185

def create_datastore_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionsDatastoresAPI.create_datastore ...'
  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 ActionsDatastoresAPI.create_datastore"
  end
  # resource path
  local_var_path = '/api/v2/actions-datastores'

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

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

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

#delete_datastore(datastore_id, opts = {}) ⇒ Object

Delete datastore.



240
241
242
243
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 240

def delete_datastore(datastore_id, opts = {})
  delete_datastore_with_http_info(datastore_id, opts)
  nil
end

#delete_datastore_item(datastore_id, body, opts = {}) ⇒ Object

Delete datastore item.



305
306
307
308
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 305

def delete_datastore_item(datastore_id, body, opts = {})
  data, _status_code, _headers = delete_datastore_item_with_http_info(datastore_id, body, opts)
  data
end

#delete_datastore_item_with_http_info(datastore_id, body, opts = {}) ⇒ Array<(DeleteAppsDatastoreItemResponse, Integer, Hash)>

Delete datastore item.

Deletes an item from a datastore by its key.

Parameters:

  • datastore_id (String)

    The unique identifier of the datastore to retrieve.

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

    the optional parameters

Returns:



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
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 318

def delete_datastore_item_with_http_info(datastore_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionsDatastoresAPI.delete_datastore_item ...'
  end
  # verify the required parameter 'datastore_id' is set
  if @api_client.config.client_side_validation && datastore_id.nil?
    fail ArgumentError, "Missing the required parameter 'datastore_id' when calling ActionsDatastoresAPI.delete_datastore_item"
  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 ActionsDatastoresAPI.delete_datastore_item"
  end
  # resource path
  local_var_path = '/api/v2/actions-datastores/{datastore_id}/items'.sub('{datastore_id}', CGI.escape(datastore_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] || 'DeleteAppsDatastoreItemResponse'

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

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

#delete_datastore_with_http_info(datastore_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete datastore.

Deletes a datastore by its unique identifier.

Parameters:

  • datastore_id (String)

    The unique identifier of the datastore to retrieve.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



252
253
254
255
256
257
258
259
260
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
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 252

def delete_datastore_with_http_info(datastore_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionsDatastoresAPI.delete_datastore ...'
  end
  # verify the required parameter 'datastore_id' is set
  if @api_client.config.client_side_validation && datastore_id.nil?
    fail ArgumentError, "Missing the required parameter 'datastore_id' when calling ActionsDatastoresAPI.delete_datastore"
  end
  # resource path
  local_var_path = '/api/v2/actions-datastores/{datastore_id}'.sub('{datastore_id}', CGI.escape(datastore_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_datastore,
    :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: ActionsDatastoresAPI#delete_datastore\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_datastore(datastore_id, opts = {}) ⇒ Object

Get datastore.



377
378
379
380
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 377

def get_datastore(datastore_id, opts = {})
  data, _status_code, _headers = get_datastore_with_http_info(datastore_id, opts)
  data
end

#get_datastore_with_http_info(datastore_id, opts = {}) ⇒ Array<(Datastore, Integer, Hash)>

Get datastore.

Retrieves a specific datastore by its ID.

Parameters:

  • datastore_id (String)

    The unique identifier of the datastore to retrieve.

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

    the optional parameters

Returns:

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

    Datastore data, response status code and response headers



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
429
430
431
432
433
434
435
436
437
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 389

def get_datastore_with_http_info(datastore_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionsDatastoresAPI.get_datastore ...'
  end
  # verify the required parameter 'datastore_id' is set
  if @api_client.config.client_side_validation && datastore_id.nil?
    fail ArgumentError, "Missing the required parameter 'datastore_id' when calling ActionsDatastoresAPI.get_datastore"
  end
  # resource path
  local_var_path = '/api/v2/actions-datastores/{datastore_id}'.sub('{datastore_id}', CGI.escape(datastore_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] || 'Datastore'

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

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

#list_datastore_items(datastore_id, opts = {}) ⇒ Object

List datastore items.



442
443
444
445
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 442

def list_datastore_items(datastore_id, opts = {})
  data, _status_code, _headers = list_datastore_items_with_http_info(datastore_id, opts)
  data
end

#list_datastore_items_with_http_info(datastore_id, opts = {}) ⇒ Array<(ItemApiPayloadArray, Integer, Hash)>

List datastore items.

Lists items from a datastore. You can filter the results by specifying either an item key or a filter query parameter, but not both at the same time. Supports server-side pagination for large datasets.

Parameters:

  • datastore_id (String)

    The unique identifier of the datastore to retrieve.

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Optional query filter to search items using the logs search syntax.

  • :item_key (String)

    Optional primary key value to retrieve a specific item. Cannot be used together with the filter parameter.

  • :page_limit (Integer)

    Optional field to limit the number of items to return per page for pagination. Up to 100 items can be returned per page.

  • :page_offset (Integer)

    Optional field to offset the number of items to skip from the beginning of the result set for pagination.

  • :sort (String)

    Optional field to sort results by. Prefix with '-' for descending order (e.g., '-created_at').

Returns:

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

    ItemApiPayloadArray data, response status code and response headers



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
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 459

def list_datastore_items_with_http_info(datastore_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionsDatastoresAPI.list_datastore_items ...'
  end
  # verify the required parameter 'datastore_id' is set
  if @api_client.config.client_side_validation && datastore_id.nil?
    fail ArgumentError, "Missing the required parameter 'datastore_id' when calling ActionsDatastoresAPI.list_datastore_items"
  end
  if @api_client.config.client_side_validation && !opts[:'item_key'].nil? && opts[:'item_key'].to_s.length > 256
    fail ArgumentError, 'invalid value for "opts[:"item_key"]" when calling ActionsDatastoresAPI.list_datastore_items, the character length must be smaller than or equal to 256.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_limit"]" when calling ActionsDatastoresAPI.list_datastore_items, must be smaller than or equal to 100.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_limit"]" when calling ActionsDatastoresAPI.list_datastore_items, must be greater than or equal to 1.'
  end
  # resource path
  local_var_path = '/api/v2/actions-datastores/{datastore_id}/items'.sub('{datastore_id}', CGI.escape(datastore_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'item_key'] = opts[:'item_key'] if !opts[:'item_key'].nil?
  query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil?
  query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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] || 'ItemApiPayloadArray'

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

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

#list_datastores(opts = {}) ⇒ Object

List datastores.



526
527
528
529
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 526

def list_datastores(opts = {})
  data, _status_code, _headers = list_datastores_with_http_info(opts)
  data
end

#list_datastores_with_http_info(opts = {}) ⇒ Array<(DatastoreArray, Integer, Hash)>

List datastores.

Lists all datastores for the organization.

Parameters:

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

    the optional parameters

Returns:

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

    DatastoreArray data, response status code and response headers



537
538
539
540
541
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
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 537

def list_datastores_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionsDatastoresAPI.list_datastores ...'
  end
  # resource path
  local_var_path = '/api/v2/actions-datastores'

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

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

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

#update_datastore(datastore_id, body, opts = {}) ⇒ Object

Update datastore.



586
587
588
589
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 586

def update_datastore(datastore_id, body, opts = {})
  data, _status_code, _headers = update_datastore_with_http_info(datastore_id, body, opts)
  data
end

#update_datastore_item(datastore_id, body, opts = {}) ⇒ Object

Update datastore item.



658
659
660
661
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 658

def update_datastore_item(datastore_id, body, opts = {})
  data, _status_code, _headers = update_datastore_item_with_http_info(datastore_id, body, opts)
  data
end

#update_datastore_item_with_http_info(datastore_id, body, opts = {}) ⇒ Array<(ItemApiPayload, Integer, Hash)>

Update datastore item.

Partially updates an item in a datastore by its key.

Parameters:

  • datastore_id (String)

    The unique identifier of the datastore to retrieve.

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

    the optional parameters

Returns:

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

    ItemApiPayload data, response status code and response headers



671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 671

def update_datastore_item_with_http_info(datastore_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionsDatastoresAPI.update_datastore_item ...'
  end
  # verify the required parameter 'datastore_id' is set
  if @api_client.config.client_side_validation && datastore_id.nil?
    fail ArgumentError, "Missing the required parameter 'datastore_id' when calling ActionsDatastoresAPI.update_datastore_item"
  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 ActionsDatastoresAPI.update_datastore_item"
  end
  # resource path
  local_var_path = '/api/v2/actions-datastores/{datastore_id}/items'.sub('{datastore_id}', CGI.escape(datastore_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] || 'ItemApiPayload'

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

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

#update_datastore_with_http_info(datastore_id, body, opts = {}) ⇒ Array<(Datastore, Integer, Hash)>

Update datastore.

Updates an existing datastore's attributes.

Parameters:

  • datastore_id (String)

    The unique identifier of the datastore to retrieve.

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

    the optional parameters

Returns:

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

    Datastore data, response status code and response headers



599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
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
# File 'lib/datadog_api_client/v2/api/actions_datastores_api.rb', line 599

def update_datastore_with_http_info(datastore_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionsDatastoresAPI.update_datastore ...'
  end
  # verify the required parameter 'datastore_id' is set
  if @api_client.config.client_side_validation && datastore_id.nil?
    fail ArgumentError, "Missing the required parameter 'datastore_id' when calling ActionsDatastoresAPI.update_datastore"
  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 ActionsDatastoresAPI.update_datastore"
  end
  # resource path
  local_var_path = '/api/v2/actions-datastores/{datastore_id}'.sub('{datastore_id}', CGI.escape(datastore_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] || 'Datastore'

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

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