Class: InfluxDB2::API::BucketsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BucketsApi

Returns a new instance of BucketsApi.



18
19
20
# File 'apis/lib/influxdb2/apis/generated/api/buckets_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/buckets_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#delete_buckets_id(bucket_id, opts = {}) ⇒ nil

Delete a bucket

Parameters:

  • bucket_id (String)

    The ID of the bucket 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/buckets_api.rb', line 26

def delete_buckets_id(bucket_id, opts = {})
  delete_buckets_id_with_http_info(bucket_id, opts)
  nil
end

#delete_buckets_id_labels_id(bucket_id, label_id, opts = {}) ⇒ nil

Delete a label from a bucket

Parameters:

  • bucket_id (String)

    The bucket ID.

  • label_id (String)

    The ID of the label to delete.

  • 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/buckets_api.rb', line 85

def delete_buckets_id_labels_id(bucket_id, label_id, opts = {})
  delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, opts)
  nil
end

#delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a label from a bucket

Parameters:

  • bucket_id (String)

    The bucket ID.

  • label_id (String)

    The ID of the label 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



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/buckets_api.rb', line 96

def delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, opts = {})
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.delete_buckets_id_labels_id"
  end
  # verify the required parameter 'label_id' is set
  if @api_client.config.client_side_validation && label_id.nil?
    fail ArgumentError, "Missing the required parameter 'label_id' when calling BucketsApi.delete_buckets_id_labels_id"
  end
  # resource path
  local_var_path = '/buckets/{bucketID}/labels/{labelID}'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)).sub('{' + 'labelID' + '}', CGI.escape(label_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 => :"BucketsApi.delete_buckets_id_labels_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_buckets_id_members_id(user_id, bucket_id, opts = {}) ⇒ nil

Remove a member from a bucket

Parameters:

  • user_id (String)

    The ID of the member to remove.

  • bucket_id (String)

    The bucket 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/buckets_api.rb', line 149

def delete_buckets_id_members_id(user_id, bucket_id, opts = {})
  delete_buckets_id_members_id_with_http_info(user_id, bucket_id, opts)
  nil
end

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

Remove a member from a bucket

Parameters:

  • user_id (String)

    The ID of the member to remove.

  • bucket_id (String)

    The bucket 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/buckets_api.rb', line 160

def delete_buckets_id_members_id_with_http_info(user_id, bucket_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 BucketsApi.delete_buckets_id_members_id"
  end
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.delete_buckets_id_members_id"
  end
  # resource path
  local_var_path = '/buckets/{bucketID}/members/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'bucketID' + '}', CGI.escape(bucket_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 => :"BucketsApi.delete_buckets_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_buckets_id_owners_id(user_id, bucket_id, opts = {}) ⇒ nil

Remove an owner from a bucket

Parameters:

  • user_id (String)

    The ID of the owner to remove.

  • bucket_id (String)

    The bucket ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

  • (nil)


213
214
215
216
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 213

def delete_buckets_id_owners_id(user_id, bucket_id, opts = {})
  delete_buckets_id_owners_id_with_http_info(user_id, bucket_id, opts)
  nil
end

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

Remove an owner from a bucket

Parameters:

  • user_id (String)

    The ID of the owner to remove.

  • bucket_id (String)

    The bucket 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



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 224

def delete_buckets_id_owners_id_with_http_info(user_id, bucket_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 BucketsApi.delete_buckets_id_owners_id"
  end
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.delete_buckets_id_owners_id"
  end
  # resource path
  local_var_path = '/buckets/{bucketID}/owners/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'bucketID' + '}', CGI.escape(bucket_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 => :"BucketsApi.delete_buckets_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_buckets_id_with_http_info(bucket_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a bucket

Parameters:

  • bucket_id (String)

    The ID of the bucket 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/buckets_api.rb', line 36

def delete_buckets_id_with_http_info(bucket_id, opts = {})
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.delete_buckets_id"
  end
  # resource path
  local_var_path = '/buckets/{bucketID}'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_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 => :"BucketsApi.delete_buckets_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_buckets(opts = {}) ⇒ Buckets

List all buckets

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
  • :after (String)

    Resource ID to seek from. Results are not inclusive of this ID. Use &#x60;after&#x60; instead of &#x60;offset&#x60;.

  • :org (String)

    The name of the organization.

  • :org_id (String)

    The organization ID.

  • :name (String)

    Only returns buckets with a specific name.

  • :id (String)

    Only returns buckets with a specific ID.

Returns:



282
283
284
285
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 282

def get_buckets(opts = {})
  data, _status_code, _headers = get_buckets_with_http_info(opts)
  data
end

#get_buckets_id(bucket_id, opts = {}) ⇒ Bucket

Retrieve a bucket

Parameters:

  • bucket_id (String)

    The bucket ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



361
362
363
364
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 361

def get_buckets_id(bucket_id, opts = {})
  data, _status_code, _headers = get_buckets_id_with_http_info(bucket_id, opts)
  data
end

#get_buckets_id_labels(bucket_id, opts = {}) ⇒ LabelsResponse

List all labels for a bucket

Parameters:

  • bucket_id (String)

    The bucket ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



419
420
421
422
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 419

def get_buckets_id_labels(bucket_id, opts = {})
  data, _status_code, _headers = get_buckets_id_labels_with_http_info(bucket_id, opts)
  data
end

#get_buckets_id_labels_with_http_info(bucket_id, opts = {}) ⇒ Array<(LabelsResponse, Integer, Hash)>

List all labels for a bucket

Parameters:

  • bucket_id (String)

    The bucket ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    LabelsResponse data, response status code and response headers



429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 429

def get_buckets_id_labels_with_http_info(bucket_id, opts = {})
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.get_buckets_id_labels"
  end
  # resource path
  local_var_path = '/buckets/{bucketID}/labels'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_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] || 'LabelsResponse'

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

  new_options = opts.merge(
    :operation => :"BucketsApi.get_buckets_id_labels",
    :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_buckets_id_members(bucket_id, opts = {}) ⇒ ResourceMembers

List all users with member privileges for a bucket

Parameters:

  • bucket_id (String)

    The bucket ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



477
478
479
480
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 477

def get_buckets_id_members(bucket_id, opts = {})
  data, _status_code, _headers = get_buckets_id_members_with_http_info(bucket_id, opts)
  data
end

#get_buckets_id_members_with_http_info(bucket_id, opts = {}) ⇒ Array<(ResourceMembers, Integer, Hash)>

List all users with member privileges for a bucket

Parameters:

  • bucket_id (String)

    The bucket 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



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

def get_buckets_id_members_with_http_info(bucket_id, opts = {})
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.get_buckets_id_members"
  end
  # resource path
  local_var_path = '/buckets/{bucketID}/members'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_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 => :"BucketsApi.get_buckets_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_buckets_id_owners(bucket_id, opts = {}) ⇒ ResourceOwners

List all owners of a bucket

Parameters:

  • bucket_id (String)

    The bucket ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



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

def get_buckets_id_owners(bucket_id, opts = {})
  data, _status_code, _headers = get_buckets_id_owners_with_http_info(bucket_id, opts)
  data
end

#get_buckets_id_owners_with_http_info(bucket_id, opts = {}) ⇒ Array<(ResourceOwners, Integer, Hash)>

List all owners of a bucket

Parameters:

  • bucket_id (String)

    The bucket 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



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

def get_buckets_id_owners_with_http_info(bucket_id, opts = {})
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.get_buckets_id_owners"
  end
  # resource path
  local_var_path = '/buckets/{bucketID}/owners'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_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 => :"BucketsApi.get_buckets_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_buckets_id_with_http_info(bucket_id, opts = {}) ⇒ Array<(Bucket, Integer, Hash)>

Retrieve a bucket

Parameters:

  • bucket_id (String)

    The bucket ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    Bucket data, response status code and response headers



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
404
405
406
407
408
409
410
411
412
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 371

def get_buckets_id_with_http_info(bucket_id, opts = {})
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.get_buckets_id"
  end
  # resource path
  local_var_path = '/buckets/{bucketID}'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_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] || 'Bucket'

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

  new_options = opts.merge(
    :operation => :"BucketsApi.get_buckets_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_buckets_with_http_info(opts = {}) ⇒ Array<(Buckets, Integer, Hash)>

List all buckets

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

  • :offset (Integer)
  • :limit (Integer)
  • :after (String)

    Resource ID to seek from. Results are not inclusive of this ID. Use &#x60;after&#x60; instead of &#x60;offset&#x60;.

  • :org (String)

    The name of the organization.

  • :org_id (String)

    The organization ID.

  • :name (String)

    Only returns buckets with a specific name.

  • :id (String)

    Only returns buckets with a specific ID.

Returns:

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

    Buckets data, response status code and response headers



298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 298

def get_buckets_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 BucketsApi.get_buckets, 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 BucketsApi.get_buckets, 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 BucketsApi.get_buckets, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/buckets'

  # 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[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil?
  query_params[:'orgID'] = opts[:'org_id'] if !opts[:'org_id'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'id'] = opts[:'id'] if !opts[:'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] || 'Buckets'

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

  new_options = opts.merge(
    :operation => :"BucketsApi.get_buckets",
    :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_sources_id_buckets(source_id, opts = {}) ⇒ Buckets

Get buckets in a source

Parameters:

  • source_id (String)

    The source ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

  • :org (String)

    The name of the organization.

Returns:



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

def get_sources_id_buckets(source_id, opts = {})
  data, _status_code, _headers = get_sources_id_buckets_with_http_info(source_id, opts)
  data
end

#get_sources_id_buckets_with_http_info(source_id, opts = {}) ⇒ Array<(Buckets, Integer, Hash)>

Get buckets in a source

Parameters:

  • source_id (String)

    The source ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

  • :org (String)

    The name of the organization.

Returns:

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

    Buckets data, response status code and response headers



605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 605

def get_sources_id_buckets_with_http_info(source_id, opts = {})
  # verify the required parameter 'source_id' is set
  if @api_client.config.client_side_validation && source_id.nil?
    fail ArgumentError, "Missing the required parameter 'source_id' when calling BucketsApi.get_sources_id_buckets"
  end
  # resource path
  local_var_path = '/sources/{sourceID}/buckets'.sub('{' + 'sourceID' + '}', CGI.escape(source_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'org'] = opts[:'org'] if !opts[:'org'].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] || 'Buckets'

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

  new_options = opts.merge(
    :operation => :"BucketsApi.get_sources_id_buckets",
    :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_buckets_id(bucket_id, patch_bucket_request, opts = {}) ⇒ Bucket

Update a bucket

Parameters:

  • bucket_id (String)

    The bucket ID.

  • patch_bucket_request (PatchBucketRequest)

    Bucket update to apply

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



655
656
657
658
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 655

def patch_buckets_id(bucket_id, patch_bucket_request, opts = {})
  data, _status_code, _headers = patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, opts)
  data
end

#patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, opts = {}) ⇒ Array<(Bucket, Integer, Hash)>

Update a bucket

Parameters:

  • bucket_id (String)

    The bucket ID.

  • patch_bucket_request (PatchBucketRequest)

    Bucket update to apply

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    Bucket data, response status code and response headers



666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 666

def patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, opts = {})
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.patch_buckets_id"
  end
  # verify the required parameter 'patch_bucket_request' is set
  if @api_client.config.client_side_validation && patch_bucket_request.nil?
    fail ArgumentError, "Missing the required parameter 'patch_bucket_request' when calling BucketsApi.patch_buckets_id"
  end
  # resource path
  local_var_path = '/buckets/{bucketID}'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_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_bucket_request)

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

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

  new_options = opts.merge(
    :operation => :"BucketsApi.patch_buckets_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_buckets(post_bucket_request, opts = {}) ⇒ Bucket

Create a bucket

Parameters:

  • post_bucket_request (PostBucketRequest)

    Bucket to create

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



720
721
722
723
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 720

def post_buckets(post_bucket_request, opts = {})
  data, _status_code, _headers = post_buckets_with_http_info(post_bucket_request, opts)
  data
end

#post_buckets_id_labels(bucket_id, label_mapping, opts = {}) ⇒ LabelResponse

Add a label to a bucket

Parameters:

  • bucket_id (String)

    The bucket ID.

  • label_mapping (LabelMapping)

    Label to add

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



781
782
783
784
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 781

def post_buckets_id_labels(bucket_id, label_mapping, opts = {})
  data, _status_code, _headers = post_buckets_id_labels_with_http_info(bucket_id, label_mapping, opts)
  data
end

#post_buckets_id_labels_with_http_info(bucket_id, label_mapping, opts = {}) ⇒ Array<(LabelResponse, Integer, Hash)>

Add a label to a bucket

Parameters:

  • bucket_id (String)

    The bucket ID.

  • label_mapping (LabelMapping)

    Label to add

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    LabelResponse data, response status code and response headers



792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 792

def post_buckets_id_labels_with_http_info(bucket_id, label_mapping, opts = {})
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.post_buckets_id_labels"
  end
  # verify the required parameter 'label_mapping' is set
  if @api_client.config.client_side_validation && label_mapping.nil?
    fail ArgumentError, "Missing the required parameter 'label_mapping' when calling BucketsApi.post_buckets_id_labels"
  end
  # resource path
  local_var_path = '/buckets/{bucketID}/labels'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_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(label_mapping)

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

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

  new_options = opts.merge(
    :operation => :"BucketsApi.post_buckets_id_labels",
    :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_buckets_id_members(bucket_id, add_resource_member_request_body, opts = {}) ⇒ ResourceMember

Add a member to a bucket

Parameters:

  • bucket_id (String)

    The bucket 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:



847
848
849
850
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 847

def post_buckets_id_members(bucket_id, add_resource_member_request_body, opts = {})
  data, _status_code, _headers = post_buckets_id_members_with_http_info(bucket_id, add_resource_member_request_body, opts)
  data
end

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

Add a member to a bucket

Parameters:

  • bucket_id (String)

    The bucket 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



858
859
860
861
862
863
864
865
866
867
868
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
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 858

def post_buckets_id_members_with_http_info(bucket_id, add_resource_member_request_body, opts = {})
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.post_buckets_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 BucketsApi.post_buckets_id_members"
  end
  # resource path
  local_var_path = '/buckets/{bucketID}/members'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_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 => :"BucketsApi.post_buckets_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_buckets_id_owners(bucket_id, add_resource_member_request_body, opts = {}) ⇒ ResourceOwner

Add an owner to a bucket

Parameters:

  • bucket_id (String)

    The bucket 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:



913
914
915
916
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 913

def post_buckets_id_owners(bucket_id, add_resource_member_request_body, opts = {})
  data, _status_code, _headers = post_buckets_id_owners_with_http_info(bucket_id, add_resource_member_request_body, opts)
  data
end

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

Add an owner to a bucket

Parameters:

  • bucket_id (String)

    The bucket 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



924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
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
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 924

def post_buckets_id_owners_with_http_info(bucket_id, add_resource_member_request_body, opts = {})
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.post_buckets_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 BucketsApi.post_buckets_id_owners"
  end
  # resource path
  local_var_path = '/buckets/{bucketID}/owners'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_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 => :"BucketsApi.post_buckets_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_buckets_with_http_info(post_bucket_request, opts = {}) ⇒ Array<(Bucket, Integer, Hash)>

Create a bucket

Parameters:

  • post_bucket_request (PostBucketRequest)

    Bucket to create

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    Bucket data, response status code and response headers



730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 730

def post_buckets_with_http_info(post_bucket_request, opts = {})
  # verify the required parameter 'post_bucket_request' is set
  if @api_client.config.client_side_validation && post_bucket_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_bucket_request' when calling BucketsApi.post_buckets"
  end
  # resource path
  local_var_path = '/buckets'

  # 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_bucket_request)

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

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

  new_options = opts.merge(
    :operation => :"BucketsApi.post_buckets",
    :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