class InfluxDB2::API::BucketsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 18
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

delete_buckets_id(bucket_id, opts = {}) click to toggle source

Delete a bucket @param bucket_id [String] The ID of the bucket to delete. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [nil]

# File 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 = {}) click to toggle source

Delete a label from a bucket @param bucket_id [String] The bucket ID. @param label_id [String] The ID of the label to delete. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [nil]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 91
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 = {}) click to toggle source

Delete a label from a bucket @param bucket_id [String] The bucket ID. @param label_id [String] The ID of the label to delete. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 102
def delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.delete_buckets_id_labels_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_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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#delete_buckets_id_labels_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_buckets_id_members_id(user_id, bucket_id, opts = {}) click to toggle source

Remove a member from a bucket @param user_id [String] The ID of the member to remove. @param bucket_id [String] The bucket ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [nil]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 161
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 = {}) click to toggle source

Remove a member from a bucket @param user_id [String] The ID of the member to remove. @param bucket_id [String] The bucket ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 172
def delete_buckets_id_members_id_with_http_info(user_id, bucket_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.delete_buckets_id_members_id ...'
  end
  # 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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#delete_buckets_id_members_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_buckets_id_owners_id(user_id, bucket_id, opts = {}) click to toggle source

Remove an owner from a bucket @param user_id [String] The ID of the owner to remove. @param bucket_id [String] The bucket ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [nil]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 231
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 = {}) click to toggle source

Remove an owner from a bucket @param user_id [String] The ID of the owner to remove. @param bucket_id [String] The bucket ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 242
def delete_buckets_id_owners_id_with_http_info(user_id, bucket_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.delete_buckets_id_owners_id ...'
  end
  # 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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#delete_buckets_id_owners_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_buckets_id_with_http_info(bucket_id, opts = {}) click to toggle source

Delete a bucket @param bucket_id [String] The ID of the bucket to delete. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 36
def delete_buckets_id_with_http_info(bucket_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.delete_buckets_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"
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#delete_buckets_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_buckets(opts = {}) click to toggle source

List all buckets @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @option opts [Integer] :offset @option opts [Integer] :limit (default to 20) @option opts [String] :after The last resource ID from which to seek from (but not including). This is to be used instead of &#x60;offset&#x60;. @option opts [String] :org The organization name. @option opts [String] :org_id The organization ID. @option opts [String] :name Only returns buckets with a specific name. @option opts [String] :id Only returns buckets with a specific ID. @return [Buckets]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 306
def get_buckets(opts = {})
  data, _status_code, _headers = get_buckets_with_http_info(opts)
  data
end
get_buckets_id(bucket_id, opts = {}) click to toggle source

Retrieve a bucket @param bucket_id [String] The bucket ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Bucket]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 391
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 = {}) click to toggle source

List all labels for a bucket @param bucket_id [String] The bucket ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [LabelsResponse]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 455
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 = {}) click to toggle source

List all labels for a bucket @param bucket_id [String] The bucket ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(LabelsResponse, Integer, Hash)>] LabelsResponse data, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 465
def get_buckets_id_labels_with_http_info(bucket_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.get_buckets_id_labels ...'
  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.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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#get_buckets_id_labels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_buckets_id_members(bucket_id, opts = {}) click to toggle source

List all users with member privileges for a bucket @param bucket_id [String] The bucket ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [ResourceMembers]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 519
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 = {}) click to toggle source

List all users with member privileges for a bucket @param bucket_id [String] The bucket ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(ResourceMembers, Integer, Hash)>] ResourceMembers data, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 529
def get_buckets_id_members_with_http_info(bucket_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.get_buckets_id_members ...'
  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.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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#get_buckets_id_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_buckets_id_owners(bucket_id, opts = {}) click to toggle source

List all owners of a bucket @param bucket_id [String] The bucket ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [ResourceOwners]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 583
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 = {}) click to toggle source

List all owners of a bucket @param bucket_id [String] The bucket ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(ResourceOwners, Integer, Hash)>] ResourceOwners data, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 593
def get_buckets_id_owners_with_http_info(bucket_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.get_buckets_id_owners ...'
  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.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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#get_buckets_id_owners\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_buckets_id_with_http_info(bucket_id, opts = {}) click to toggle source

Retrieve a bucket @param bucket_id [String] The bucket ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(Bucket, Integer, Hash)>] Bucket data, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 401
def get_buckets_id_with_http_info(bucket_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.get_buckets_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.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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#get_buckets_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_buckets_with_http_info(opts = {}) click to toggle source

List all buckets @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @option opts [Integer] :offset @option opts [Integer] :limit @option opts [String] :after The last resource ID from which to seek from (but not including). This is to be used instead of &#x60;offset&#x60;. @option opts [String] :org The organization name. @option opts [String] :org_id The organization ID. @option opts [String] :name Only returns buckets with a specific name. @option opts [String] :id Only returns buckets with a specific ID. @return [Array<(Buckets, Integer, Hash)>] Buckets data, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 322
def get_buckets_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.get_buckets ...'
  end
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#get_buckets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_sources_id_buckets(source_id, opts = {}) click to toggle source

Get buckets in a source @param source_id [String] The source ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @option opts [String] :org The organization name. @return [Buckets]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 648
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 = {}) click to toggle source

Get buckets in a source @param source_id [String] The source ID. @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @option opts [String] :org The organization name. @return [Array<(Buckets, Integer, Hash)>] Buckets data, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 659
def get_sources_id_buckets_with_http_info(source_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.get_sources_id_buckets ...'
  end
  # 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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#get_sources_id_buckets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
patch_buckets_id(bucket_id, patch_bucket_request, opts = {}) click to toggle source

Update a bucket @param bucket_id [String] The bucket ID. @param patch_bucket_request [PatchBucketRequest] Bucket update to apply @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Bucket]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 715
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 = {}) click to toggle source

Update a bucket @param bucket_id [String] The bucket ID. @param patch_bucket_request [PatchBucketRequest] Bucket update to apply @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(Bucket, Integer, Hash)>] Bucket data, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 726
def patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.patch_buckets_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.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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#patch_buckets_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_buckets(post_bucket_request, opts = {}) click to toggle source

Create a bucket @param post_bucket_request [PostBucketRequest] Bucket to create @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Bucket]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 786
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 = {}) click to toggle source

Add a label to a bucket @param bucket_id [String] The bucket ID. @param label_mapping [LabelMapping] Label to add @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [LabelResponse]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 853
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 = {}) click to toggle source

Add a label to a bucket @param bucket_id [String] The bucket ID. @param label_mapping [LabelMapping] Label to add @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(LabelResponse, Integer, Hash)>] LabelResponse data, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 864
def post_buckets_id_labels_with_http_info(bucket_id, label_mapping, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.post_buckets_id_labels ...'
  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.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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#post_buckets_id_labels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_buckets_id_members(bucket_id, add_resource_member_request_body, opts = {}) click to toggle source

Add a member to a bucket @param bucket_id [String] The bucket ID. @param add_resource_member_request_body [AddResourceMemberRequestBody] User to add as member @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [ResourceMember]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 925
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 = {}) click to toggle source

Add a member to a bucket @param bucket_id [String] The bucket ID. @param add_resource_member_request_body [AddResourceMemberRequestBody] User to add as member @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(ResourceMember, Integer, Hash)>] ResourceMember data, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 936
def post_buckets_id_members_with_http_info(bucket_id, add_resource_member_request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.post_buckets_id_members ...'
  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.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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#post_buckets_id_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_buckets_id_owners(bucket_id, add_resource_member_request_body, opts = {}) click to toggle source

Add an owner to a bucket @param bucket_id [String] The bucket ID. @param add_resource_member_request_body [AddResourceMemberRequestBody] User to add as owner @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [ResourceOwner]

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 997
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 = {}) click to toggle source

Add an owner to a bucket @param bucket_id [String] The bucket ID. @param add_resource_member_request_body [AddResourceMemberRequestBody] User to add as owner @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(ResourceOwner, Integer, Hash)>] ResourceOwner data, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 1008
def post_buckets_id_owners_with_http_info(bucket_id, add_resource_member_request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.post_buckets_id_owners ...'
  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.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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#post_buckets_id_owners\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_buckets_with_http_info(post_bucket_request, opts = {}) click to toggle source

Create a bucket @param post_bucket_request [PostBucketRequest] Bucket to create @param [Hash] opts the optional parameters @option opts [String] :zap_trace_span OpenTracing span context @return [Array<(Bucket, Integer, Hash)>] Bucket data, response status code and response headers

# File lib/influxdb2/apis/generated/api/buckets_api.rb, line 796
def post_buckets_with_http_info(post_bucket_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BucketsApi.post_buckets ...'
  end
  # 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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BucketsApi#post_buckets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end