Class: InfluxDB2::API::OrganizationsApi

Inherits:
Object
  • Object
show all
Defined in:
apis/lib/influxdb2/apis/generated/api/organizations_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ OrganizationsApi

Returns a new instance of OrganizationsApi.



18
19
20
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 18

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



16
17
18
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#delete_orgs_id(org_id, opts = {}) ⇒ nil

Delete an organization

Parameters:

  • org_id (String)

    The ID of the organization to delete.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

  • (nil)


26
27
28
29
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 26

def delete_orgs_id(org_id, opts = {})
  delete_orgs_id_with_http_info(org_id, opts)
  nil
end

#delete_orgs_id_members_id(user_id, org_id, opts = {}) ⇒ nil

Remove a member from an organization

Parameters:

  • user_id (String)

    The ID of the member to remove.

  • org_id (String)

    The organization ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

  • (nil)


85
86
87
88
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 85

def delete_orgs_id_members_id(user_id, org_id, opts = {})
  delete_orgs_id_members_id_with_http_info(user_id, org_id, opts)
  nil
end

#delete_orgs_id_members_id_with_http_info(user_id, org_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove a member from an organization

Parameters:

  • user_id (String)

    The ID of the member to remove.

  • org_id (String)

    The organization ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    nil, response status code and response headers



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 96

def delete_orgs_id_members_id_with_http_info(user_id, org_id, opts = {})
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling OrganizationsApi.delete_orgs_id_members_id"
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.delete_orgs_id_members_id"
  end
  # resource path
  local_var_path = '/orgs/{orgID}/members/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

  # 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] || ['header']

  new_options = opts.merge(
    :operation => :"OrganizationsApi.delete_orgs_id_members_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  return data, status_code, headers
end

#delete_orgs_id_owners_id(user_id, org_id, opts = {}) ⇒ nil

Remove an owner from an organization

Parameters:

  • user_id (String)

    The ID of the owner to remove.

  • org_id (String)

    The organization ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

  • (nil)


149
150
151
152
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 149

def delete_orgs_id_owners_id(user_id, org_id, opts = {})
  delete_orgs_id_owners_id_with_http_info(user_id, org_id, opts)
  nil
end

#delete_orgs_id_owners_id_with_http_info(user_id, org_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove an owner from an organization

Parameters:

  • user_id (String)

    The ID of the owner to remove.

  • org_id (String)

    The organization ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    nil, response status code and response headers



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 160

def delete_orgs_id_owners_id_with_http_info(user_id, org_id, opts = {})
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling OrganizationsApi.delete_orgs_id_owners_id"
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.delete_orgs_id_owners_id"
  end
  # resource path
  local_var_path = '/orgs/{orgID}/owners/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

  # 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] || ['header']

  new_options = opts.merge(
    :operation => :"OrganizationsApi.delete_orgs_id_owners_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  return data, status_code, headers
end

#delete_orgs_id_with_http_info(org_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an organization

Parameters:

  • org_id (String)

    The ID of the organization to delete.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    nil, response status code and response headers



36
37
38
39
40
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
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 36

def delete_orgs_id_with_http_info(org_id, opts = {})
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.delete_orgs_id"
  end
  # resource path
  local_var_path = '/orgs/{orgID}'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

  # 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] || ['header']

  new_options = opts.merge(
    :operation => :"OrganizationsApi.delete_orgs_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  return data, status_code, headers
end

#get_orgs(opts = {}) ⇒ Organizations

List all organizations

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

  • :offset (Integer)
  • :limit (Integer) — default: default to 20
  • :descending (Boolean) — default: default to false
  • :org (String)

    Filter organizations to a specific organization name.

  • :org_id (String)

    Filter organizations to a specific organization ID.

  • :user_id (String)

    Filter organizations to a specific user ID.

Returns:



217
218
219
220
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 217

def get_orgs(opts = {})
  data, _status_code, _headers = get_orgs_with_http_info(opts)
  data
end

#get_orgs_id(org_id, opts = {}) ⇒ Organization

Retrieve an organization

Parameters:

  • org_id (String)

    The ID of the organization to get.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



294
295
296
297
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 294

def get_orgs_id(org_id, opts = {})
  data, _status_code, _headers = get_orgs_id_with_http_info(org_id, opts)
  data
end

#get_orgs_id_members(org_id, opts = {}) ⇒ ResourceMembers

List all members of an organization

Parameters:

  • org_id (String)

    The organization ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



352
353
354
355
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 352

def get_orgs_id_members(org_id, opts = {})
  data, _status_code, _headers = get_orgs_id_members_with_http_info(org_id, opts)
  data
end

#get_orgs_id_members_with_http_info(org_id, opts = {}) ⇒ Array<(ResourceMembers, Integer, Hash)>

List all members of an organization

Parameters:

  • org_id (String)

    The organization ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    ResourceMembers data, response status code and response headers



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 362

def get_orgs_id_members_with_http_info(org_id, opts = {})
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.get_orgs_id_members"
  end
  # resource path
  local_var_path = '/orgs/{orgID}/members'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['header']

  new_options = opts.merge(
    :operation => :"OrganizationsApi.get_orgs_id_members",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  return data, status_code, headers
end

#get_orgs_id_owners(org_id, opts = {}) ⇒ ResourceOwners

List all owners of an organization

Parameters:

  • org_id (String)

    The organization ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



410
411
412
413
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 410

def get_orgs_id_owners(org_id, opts = {})
  data, _status_code, _headers = get_orgs_id_owners_with_http_info(org_id, opts)
  data
end

#get_orgs_id_owners_with_http_info(org_id, opts = {}) ⇒ Array<(ResourceOwners, Integer, Hash)>

List all owners of an organization

Parameters:

  • org_id (String)

    The organization ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    ResourceOwners data, response status code and response headers



420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 420

def get_orgs_id_owners_with_http_info(org_id, opts = {})
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.get_orgs_id_owners"
  end
  # resource path
  local_var_path = '/orgs/{orgID}/owners'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['header']

  new_options = opts.merge(
    :operation => :"OrganizationsApi.get_orgs_id_owners",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  return data, status_code, headers
end

#get_orgs_id_with_http_info(org_id, opts = {}) ⇒ Array<(Organization, Integer, Hash)>

Retrieve an organization

Parameters:

  • org_id (String)

    The ID of the organization to get.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    Organization data, response status code and response headers



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 304

def get_orgs_id_with_http_info(org_id, opts = {})
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.get_orgs_id"
  end
  # resource path
  local_var_path = '/orgs/{orgID}'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['header']

  new_options = opts.merge(
    :operation => :"OrganizationsApi.get_orgs_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  return data, status_code, headers
end

#get_orgs_with_http_info(opts = {}) ⇒ Array<(Organizations, Integer, Hash)>

List all organizations

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

  • :offset (Integer)
  • :limit (Integer)
  • :descending (Boolean)
  • :org (String)

    Filter organizations to a specific organization name.

  • :org_id (String)

    Filter organizations to a specific organization ID.

  • :user_id (String)

    Filter organizations to a specific user ID.

Returns:

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

    Organizations data, response status code and response headers



232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 232

def get_orgs_with_http_info(opts = {})
  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling OrganizationsApi.get_orgs, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OrganizationsApi.get_orgs, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OrganizationsApi.get_orgs, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/orgs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'descending'] = opts[:'descending'] if !opts[:'descending'].nil?
  query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil?
  query_params[:'orgID'] = opts[:'org_id'] if !opts[:'org_id'].nil?
  query_params[:'userID'] = opts[:'user_id'] if !opts[:'user_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['header']

  new_options = opts.merge(
    :operation => :"OrganizationsApi.get_orgs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  return data, status_code, headers
end

#patch_orgs_id(org_id, patch_organization_request, opts = {}) ⇒ Organization

Update an organization

Parameters:

  • org_id (String)

    The ID of the organization to get.

  • patch_organization_request (PatchOrganizationRequest)

    Organization update to apply

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



469
470
471
472
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 469

def patch_orgs_id(org_id, patch_organization_request, opts = {})
  data, _status_code, _headers = patch_orgs_id_with_http_info(org_id, patch_organization_request, opts)
  data
end

#patch_orgs_id_with_http_info(org_id, patch_organization_request, opts = {}) ⇒ Array<(Organization, Integer, Hash)>

Update an organization

Parameters:

  • org_id (String)

    The ID of the organization to get.

  • patch_organization_request (PatchOrganizationRequest)

    Organization update to apply

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    Organization data, response status code and response headers



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
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 480

def patch_orgs_id_with_http_info(org_id, patch_organization_request, opts = {})
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.patch_orgs_id"
  end
  # verify the required parameter 'patch_organization_request' is set
  if @api_client.config.client_side_validation && patch_organization_request.nil?
    fail ArgumentError, "Missing the required parameter 'patch_organization_request' when calling OrganizationsApi.patch_orgs_id"
  end
  # resource path
  local_var_path = '/orgs/{orgID}'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['header']

  new_options = opts.merge(
    :operation => :"OrganizationsApi.patch_orgs_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  return data, status_code, headers
end

#post_orgs(post_organization_request, opts = {}) ⇒ Organization

Create an organization

Parameters:

  • post_organization_request (PostOrganizationRequest)

    Organization to create

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



534
535
536
537
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 534

def post_orgs(post_organization_request, opts = {})
  data, _status_code, _headers = post_orgs_with_http_info(post_organization_request, opts)
  data
end

#post_orgs_id_members(org_id, add_resource_member_request_body, opts = {}) ⇒ ResourceMember

Add a member to an organization

Parameters:

  • org_id (String)

    The organization ID.

  • add_resource_member_request_body (AddResourceMemberRequestBody)

    User to add as member

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



595
596
597
598
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 595

def post_orgs_id_members(org_id, add_resource_member_request_body, opts = {})
  data, _status_code, _headers = post_orgs_id_members_with_http_info(org_id, add_resource_member_request_body, opts)
  data
end

#post_orgs_id_members_with_http_info(org_id, add_resource_member_request_body, opts = {}) ⇒ Array<(ResourceMember, Integer, Hash)>

Add a member to an organization

Parameters:

  • org_id (String)

    The organization ID.

  • add_resource_member_request_body (AddResourceMemberRequestBody)

    User to add as member

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    ResourceMember data, response status code and response headers



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 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 606

def post_orgs_id_members_with_http_info(org_id, add_resource_member_request_body, opts = {})
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.post_orgs_id_members"
  end
  # verify the required parameter 'add_resource_member_request_body' is set
  if @api_client.config.client_side_validation && add_resource_member_request_body.nil?
    fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling OrganizationsApi.post_orgs_id_members"
  end
  # resource path
  local_var_path = '/orgs/{orgID}/members'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['header']

  new_options = opts.merge(
    :operation => :"OrganizationsApi.post_orgs_id_members",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  return data, status_code, headers
end

#post_orgs_id_owners(org_id, add_resource_member_request_body, opts = {}) ⇒ ResourceOwner

Add an owner to an organization

Parameters:

  • org_id (String)

    The organization ID.

  • add_resource_member_request_body (AddResourceMemberRequestBody)

    User to add as owner

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



661
662
663
664
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 661

def post_orgs_id_owners(org_id, add_resource_member_request_body, opts = {})
  data, _status_code, _headers = post_orgs_id_owners_with_http_info(org_id, add_resource_member_request_body, opts)
  data
end

#post_orgs_id_owners_with_http_info(org_id, add_resource_member_request_body, opts = {}) ⇒ Array<(ResourceOwner, Integer, Hash)>

Add an owner to an organization

Parameters:

  • org_id (String)

    The organization ID.

  • add_resource_member_request_body (AddResourceMemberRequestBody)

    User to add as owner

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    ResourceOwner data, response status code and response headers



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
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 672

def post_orgs_id_owners_with_http_info(org_id, add_resource_member_request_body, opts = {})
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.post_orgs_id_owners"
  end
  # verify the required parameter 'add_resource_member_request_body' is set
  if @api_client.config.client_side_validation && add_resource_member_request_body.nil?
    fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling OrganizationsApi.post_orgs_id_owners"
  end
  # resource path
  local_var_path = '/orgs/{orgID}/owners'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['header']

  new_options = opts.merge(
    :operation => :"OrganizationsApi.post_orgs_id_owners",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  return data, status_code, headers
end

#post_orgs_with_http_info(post_organization_request, opts = {}) ⇒ Array<(Organization, Integer, Hash)>

Create an organization

Parameters:

  • post_organization_request (PostOrganizationRequest)

    Organization to create

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    Organization data, response status code and response headers



544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 544

def post_orgs_with_http_info(post_organization_request, opts = {})
  # verify the required parameter 'post_organization_request' is set
  if @api_client.config.client_side_validation && post_organization_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_organization_request' when calling OrganizationsApi.post_orgs"
  end
  # resource path
  local_var_path = '/orgs'

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['header']

  new_options = opts.merge(
    :operation => :"OrganizationsApi.post_orgs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  return data, status_code, headers
end