Class: DatadogAPIClient::V2::OrgGroupsAPI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of OrgGroupsAPI.



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

def api_client
  @api_client
end

Instance Method Details

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

Bulk update org group memberships.



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

def bulk_update_org_group_memberships(body, opts = {})
  data, _status_code, _headers = bulk_update_org_group_memberships_with_http_info(body, opts)
  data
end

#bulk_update_org_group_memberships_with_http_info(body, opts = {}) ⇒ Array<(OrgGroupMembershipListResponse, Integer, Hash)>

Bulk update org group memberships.

Move a batch of organizations from one org group to another. This is an atomic operation. Maximum 100 orgs per request.

Parameters:

Returns:



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

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrgGroupsAPI.bulk_update_org_group_memberships ...'
  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 OrgGroupsAPI.bulk_update_org_group_memberships"
  end
  # resource path
  local_var_path = '/api/v2/org_group_memberships/bulk'

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

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

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

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

Create an org group.



102
103
104
105
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 102

def create_org_group(body, opts = {})
  data, _status_code, _headers = create_org_group_with_http_info(body, opts)
  data
end

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

Create an org group policy.



175
176
177
178
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 175

def create_org_group_policy(body, opts = {})
  data, _status_code, _headers = create_org_group_policy_with_http_info(body, opts)
  data
end

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

Create an org group policy override.



248
249
250
251
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 248

def create_org_group_policy_override(body, opts = {})
  data, _status_code, _headers = create_org_group_policy_override_with_http_info(body, opts)
  data
end

#create_org_group_policy_override_with_http_info(body, opts = {}) ⇒ Array<(OrgGroupPolicyOverrideResponse, Integer, Hash)>

Create an org group policy override.

Create a new policy override for an organization within an org group.

Parameters:

Returns:



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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 260

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

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

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

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

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

#create_org_group_policy_with_http_info(body, opts = {}) ⇒ Array<(OrgGroupPolicyResponse, Integer, Hash)>

Create an org group policy.

Create a new policy for an organization group.

Parameters:

Returns:

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

    OrgGroupPolicyResponse data, response status code and response headers



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
236
237
238
239
240
241
242
243
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 187

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

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

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

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

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

#create_org_group_with_http_info(body, opts = {}) ⇒ Array<(OrgGroupResponse, Integer, Hash)>

Create an org group.

Create a new organization group.

Parameters:

Returns:

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

    OrgGroupResponse data, response status code and response headers



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
169
170
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 114

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

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

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

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

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

#delete_org_group(org_group_id, opts = {}) ⇒ Object

Delete an org group.



321
322
323
324
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 321

def delete_org_group(org_group_id, opts = {})
  delete_org_group_with_http_info(org_group_id, opts)
  nil
end

#delete_org_group_policy(org_group_policy_id, opts = {}) ⇒ Object

Delete an org group policy.



392
393
394
395
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 392

def delete_org_group_policy(org_group_policy_id, opts = {})
  delete_org_group_policy_with_http_info(org_group_policy_id, opts)
  nil
end

#delete_org_group_policy_override(org_group_policy_override_id, opts = {}) ⇒ Object

Delete an org group policy override.



463
464
465
466
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 463

def delete_org_group_policy_override(org_group_policy_override_id, opts = {})
  delete_org_group_policy_override_with_http_info(org_group_policy_override_id, opts)
  nil
end

#delete_org_group_policy_override_with_http_info(org_group_policy_override_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an org group policy override.

Delete an organization group policy override by its ID.

Parameters:

  • org_group_policy_override_id (UUID)

    The ID of the org group policy override.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
522
523
524
525
526
527
528
529
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 475

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

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

#delete_org_group_policy_with_http_info(org_group_policy_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an org group policy.

Delete an organization group policy by its ID.

Parameters:

  • org_group_policy_id (UUID)

    The ID of the org group policy.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 404

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

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

#delete_org_group_with_http_info(org_group_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an org group.

Delete an organization group by its ID.

Parameters:

  • org_group_id (UUID)

    The ID of the org group.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 333

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

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

#get_org_group(org_group_id, opts = {}) ⇒ Object

Get an org group.



534
535
536
537
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 534

def get_org_group(org_group_id, opts = {})
  data, _status_code, _headers = get_org_group_with_http_info(org_group_id, opts)
  data
end

#get_org_group_membership(org_group_membership_id, opts = {}) ⇒ Object

Get an org group membership.



605
606
607
608
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 605

def get_org_group_membership(org_group_membership_id, opts = {})
  data, _status_code, _headers = get_org_group_membership_with_http_info(org_group_membership_id, opts)
  data
end

#get_org_group_membership_with_http_info(org_group_membership_id, opts = {}) ⇒ Array<(OrgGroupMembershipResponse, Integer, Hash)>

Get an org group membership.

Get a specific organization group membership by its ID.

Parameters:

  • org_group_membership_id (UUID)

    The ID of the org group membership.

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

    the optional parameters

Returns:

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

    OrgGroupMembershipResponse data, response status code and response headers



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
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 617

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

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

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

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

#get_org_group_with_http_info(org_group_id, opts = {}) ⇒ Array<(OrgGroupResponse, Integer, Hash)>

Get an org group.

Get a specific organization group by its ID.

Parameters:

  • org_group_id (UUID)

    The ID of the org group.

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

    the optional parameters

Returns:

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

    OrgGroupResponse data, response status code and response headers



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

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

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

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

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

#list_org_group_memberships(opts = {}) ⇒ Object

List org group memberships.



676
677
678
679
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 676

def list_org_group_memberships(opts = {})
  data, _status_code, _headers = list_org_group_memberships_with_http_info(opts)
  data
end

#list_org_group_memberships_with_http_info(opts = {}) ⇒ Array<(OrgGroupMembershipListResponse, Integer, Hash)>

List org group memberships.

List organization group memberships. Filter by org group ID or org UUID. At least one of filter[org_group_id] or filter[org_uuid] must be provided. When filtering by org UUID, returns a single-item list with the membership for that org.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter_org_group_id (UUID)

    Filter memberships by org group ID. Required when filter[org_uuid] is not provided.

  • :filter_org_uuid (UUID)

    Filter memberships by org UUID. Returns a single-item list.

  • :page_number (Integer)

    The page number to return.

  • :page_size (Integer)

    The number of items per page. Maximum is 1000.

  • :sort (OrgGroupMembershipSortOption)

    Field to sort memberships by. Supported values: name, uuid, -name, -uuid. Defaults to uuid.

Returns:



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

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrgGroupsAPI.list_org_group_memberships ...'
  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 OrgGroupsAPI.list_org_group_memberships, must be greater than or equal to 0.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OrgGroupsAPI.list_org_group_memberships, must be smaller than or equal to 1000.'
  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 OrgGroupsAPI.list_org_group_memberships, must be greater than or equal to 1.'
  end
  allowable_values = ['name', '-name', 'uuid', '-uuid']
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v2/org_group_memberships'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter[org_group_id]'] = opts[:'filter_org_group_id'] if !opts[:'filter_org_group_id'].nil?
  query_params[:'filter[org_uuid]'] = opts[:'filter_org_uuid'] if !opts[:'filter_org_uuid'].nil?
  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'] = 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] || 'OrgGroupMembershipListResponse'

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

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

#list_org_group_policies(filter_org_group_id, opts = {}) ⇒ Object

List org group policies.



765
766
767
768
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 765

def list_org_group_policies(filter_org_group_id, opts = {})
  data, _status_code, _headers = list_org_group_policies_with_http_info(filter_org_group_id, opts)
  data
end

#list_org_group_policies_with_http_info(filter_org_group_id, opts = {}) ⇒ Array<(OrgGroupPolicyListResponse, Integer, Hash)>

List org group policies.

List policies for an organization group. Requires a filter on org group ID.

Parameters:

  • filter_org_group_id (UUID)

    Filter policies by org group ID.

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

    the optional parameters

Options Hash (opts):

  • :filter_policy_name (String)

    Filter policies by policy name.

  • :page_number (Integer)

    The page number to return.

  • :page_size (Integer)

    The number of items per page. Maximum is 1000.

  • :sort (OrgGroupPolicySortOption)

    Field to sort policies by. Supported values: id, name, -id, -name. Defaults to id.

Returns:

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

    OrgGroupPolicyListResponse data, response status code and response headers



781
782
783
784
785
786
787
788
789
790
791
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
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 781

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrgGroupsAPI.list_org_group_policies ...'
  end
  # verify the required parameter 'filter_org_group_id' is set
  if @api_client.config.client_side_validation && filter_org_group_id.nil?
    fail ArgumentError, "Missing the required parameter 'filter_org_group_id' when calling OrgGroupsAPI.list_org_group_policies"
  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 OrgGroupsAPI.list_org_group_policies, must be greater than or equal to 0.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OrgGroupsAPI.list_org_group_policies, must be smaller than or equal to 1000.'
  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 OrgGroupsAPI.list_org_group_policies, must be greater than or equal to 1.'
  end
  allowable_values = ['id', '-id', 'name', '-name']
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v2/org_group_policies'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter[org_group_id]'] = filter_org_group_id
  query_params[:'filter[policy_name]'] = opts[:'filter_policy_name'] if !opts[:'filter_policy_name'].nil?
  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'] = 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] || 'OrgGroupPolicyListResponse'

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

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

#list_org_group_policy_configs(opts = {}) ⇒ Object

List org group policy configs.



858
859
860
861
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 858

def list_org_group_policy_configs(opts = {})
  data, _status_code, _headers = list_org_group_policy_configs_with_http_info(opts)
  data
end

#list_org_group_policy_configs_with_http_info(opts = {}) ⇒ Array<(OrgGroupPolicyConfigListResponse, Integer, Hash)>

List org group policy configs.

List all org configs that are eligible to be used as organization group policies.

Parameters:

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

    the optional parameters

Returns:



869
870
871
872
873
874
875
876
877
878
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
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 869

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrgGroupsAPI.list_org_group_policy_configs ...'
  end
  # resource path
  local_var_path = '/api/v2/org_group_policy_configs'

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

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

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

#list_org_group_policy_overrides(filter_org_group_id, opts = {}) ⇒ Object

List org group policy overrides.



924
925
926
927
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 924

def list_org_group_policy_overrides(filter_org_group_id, opts = {})
  data, _status_code, _headers = list_org_group_policy_overrides_with_http_info(filter_org_group_id, opts)
  data
end

#list_org_group_policy_overrides_with_http_info(filter_org_group_id, opts = {}) ⇒ Array<(OrgGroupPolicyOverrideListResponse, Integer, Hash)>

List org group policy overrides.

List policy overrides for an organization group. Requires a filter on org group ID. Optionally filter by policy ID.

Parameters:

  • filter_org_group_id (UUID)

    Filter policy overrides by org group ID.

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

    the optional parameters

Options Hash (opts):

  • :filter_policy_id (UUID)

    Filter policy overrides by policy ID.

  • :page_number (Integer)

    The page number to return.

  • :page_size (Integer)

    The number of items per page. Maximum is 1000.

  • :sort (OrgGroupPolicyOverrideSortOption)

    Field to sort overrides by. Supported values: id, org_uuid, -id, -org_uuid. Defaults to id.

Returns:



940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
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
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 940

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrgGroupsAPI.list_org_group_policy_overrides ...'
  end
  # verify the required parameter 'filter_org_group_id' is set
  if @api_client.config.client_side_validation && filter_org_group_id.nil?
    fail ArgumentError, "Missing the required parameter 'filter_org_group_id' when calling OrgGroupsAPI.list_org_group_policy_overrides"
  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 OrgGroupsAPI.list_org_group_policy_overrides, must be greater than or equal to 0.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OrgGroupsAPI.list_org_group_policy_overrides, must be smaller than or equal to 1000.'
  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 OrgGroupsAPI.list_org_group_policy_overrides, must be greater than or equal to 1.'
  end
  allowable_values = ['id', '-id', 'org_uuid', '-org_uuid']
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v2/org_group_policy_overrides'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter[org_group_id]'] = filter_org_group_id
  query_params[:'filter[policy_id]'] = opts[:'filter_policy_id'] if !opts[:'filter_policy_id'].nil?
  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'] = 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] || 'OrgGroupPolicyOverrideListResponse'

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

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

#list_org_groups(opts = {}) ⇒ Object

List org groups.



1017
1018
1019
1020
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 1017

def list_org_groups(opts = {})
  data, _status_code, _headers = list_org_groups_with_http_info(opts)
  data
end

#list_org_groups_with_http_info(opts = {}) ⇒ Array<(OrgGroupListResponse, Integer, Hash)>

List org groups.

List all organization groups that the requesting organization has access to.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_number (Integer)

    The page number to return.

  • :page_size (Integer)

    The number of items per page. Maximum is 1000.

  • :sort (OrgGroupSortOption)

    Field to sort org groups by. Supported values: name, uuid, -name, -uuid. Defaults to uuid.

  • :include (Array<OrgGroupIncludeOption>)

    List of related resources to include.

Returns:

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

    OrgGroupListResponse data, response status code and response headers



1032
1033
1034
1035
1036
1037
1038
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
1095
1096
1097
1098
1099
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 1032

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrgGroupsAPI.list_org_groups ...'
  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 OrgGroupsAPI.list_org_groups, must be greater than or equal to 0.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OrgGroupsAPI.list_org_groups, must be smaller than or equal to 1000.'
  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 OrgGroupsAPI.list_org_groups, must be greater than or equal to 1.'
  end
  allowable_values = ['name', '-name', 'uuid', '-uuid']
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v2/org_groups'

  # 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'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].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] || 'OrgGroupListResponse'

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

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

#update_org_group(org_group_id, body, opts = {}) ⇒ Object

Update an org group.



1104
1105
1106
1107
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 1104

def update_org_group(org_group_id, body, opts = {})
  data, _status_code, _headers = update_org_group_with_http_info(org_group_id, body, opts)
  data
end

#update_org_group_membership(org_group_membership_id, body, opts = {}) ⇒ Object

Update an org group membership.



1182
1183
1184
1185
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 1182

def update_org_group_membership(org_group_membership_id, body, opts = {})
  data, _status_code, _headers = update_org_group_membership_with_http_info(org_group_membership_id, body, opts)
  data
end

#update_org_group_membership_with_http_info(org_group_membership_id, body, opts = {}) ⇒ Array<(OrgGroupMembershipResponse, Integer, Hash)>

Update an org group membership.

Move an organization to a different org group by updating its membership.

Parameters:

  • org_group_membership_id (UUID)

    The ID of the org group membership.

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

    the optional parameters

Returns:

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

    OrgGroupMembershipResponse data, response status code and response headers



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
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 1195

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

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

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

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

#update_org_group_policy(org_group_policy_id, body, opts = {}) ⇒ Object

Update an org group policy.



1260
1261
1262
1263
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 1260

def update_org_group_policy(org_group_policy_id, body, opts = {})
  data, _status_code, _headers = update_org_group_policy_with_http_info(org_group_policy_id, body, opts)
  data
end

#update_org_group_policy_override(org_group_policy_override_id, body, opts = {}) ⇒ Object

Update an org group policy override.



1338
1339
1340
1341
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 1338

def update_org_group_policy_override(org_group_policy_override_id, body, opts = {})
  data, _status_code, _headers = update_org_group_policy_override_with_http_info(org_group_policy_override_id, body, opts)
  data
end

#update_org_group_policy_override_with_http_info(org_group_policy_override_id, body, opts = {}) ⇒ Array<(OrgGroupPolicyOverrideResponse, Integer, Hash)>

Update an org group policy override.

Update an existing organization group policy override.

Parameters:

  • org_group_policy_override_id (UUID)

    The ID of the org group policy override.

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

    the optional parameters

Returns:



1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
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
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 1351

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

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

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

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

#update_org_group_policy_with_http_info(org_group_policy_id, body, opts = {}) ⇒ Array<(OrgGroupPolicyResponse, Integer, Hash)>

Update an org group policy.

Update the content of an existing organization group policy.

Parameters:

  • org_group_policy_id (UUID)

    The ID of the org group policy.

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

    the optional parameters

Returns:

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

    OrgGroupPolicyResponse data, response status code and response headers



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
1331
1332
1333
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 1273

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

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

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

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

#update_org_group_with_http_info(org_group_id, body, opts = {}) ⇒ Array<(OrgGroupResponse, Integer, Hash)>

Update an org group.

Update the name of an existing organization group.

Parameters:

  • org_group_id (UUID)

    The ID of the org group.

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

    the optional parameters

Returns:

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

    OrgGroupResponse data, response status code and response headers



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
1171
1172
1173
1174
1175
1176
1177
# File 'lib/datadog_api_client/v2/api/org_groups_api.rb', line 1117

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

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

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

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