Skip to content

Latest commit

 

History

History
284 lines (201 loc) · 8.71 KB

File metadata and controls

284 lines (201 loc) · 8.71 KB

billabear.UsageApi

All URIs are relative to https://{customerId}.billabear.cloud/api/v1

Method HTTP request Description
create_customer_usage_limit POST /customer/{customerId}/uasge-limit Create Usage Limit
create_event POST /events Create Event
customer_customer_id_uasge_limit_limit_id_delete DELETE /customer/{customerId}/uasge-limit/{limitId} Delete Usage Limit
get_customer_costs GET /customer/{customerId}/costs Usage Cost Estimate
get_customer_usage_limits_by_id GET /customer/{customerId}/uasge-limit Fetch Customer Usage Limits

create_customer_usage_limit

UsageLimit create_customer_usage_limit(body, customer_id)

Create Usage Limit

Create Usage Limit for the custoemr

Example

from __future__ import print_function
import time
import billabear
from billabear.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = billabear.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = billabear.UsageApi(billabear.ApiClient(configuration))
body = billabear.CustomerIdUasgelimitBody() # CustomerIdUasgelimitBody | 
customer_id = 'customer_id_example' # str | The id of the customer to retrieve

try:
    # Create Usage Limit
    api_response = api_instance.create_customer_usage_limit(body, customer_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UsageApi->create_customer_usage_limit: %s\n" % e)

Parameters

Name Type Description Notes
body CustomerIdUasgelimitBody
customer_id str The id of the customer to retrieve

Return type

UsageLimit

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_event

create_event(body)

Create Event

Creates an event that is used for usage billing

Example

from __future__ import print_function
import time
import billabear
from billabear.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = billabear.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = billabear.UsageApi(billabear.ApiClient(configuration))
body = billabear.Event() # Event | 

try:
    # Create Event
    api_instance.create_event(body)
except ApiException as e:
    print("Exception when calling UsageApi->create_event: %s\n" % e)

Parameters

Name Type Description Notes
body Event

Return type

void (empty response body)

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

customer_customer_id_uasge_limit_limit_id_delete

customer_customer_id_uasge_limit_limit_id_delete(customer_id, usage_limit_id)

Delete Usage Limit

Delete Usage Limit for the custoemr

Example

from __future__ import print_function
import time
import billabear
from billabear.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = billabear.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = billabear.UsageApi(billabear.ApiClient(configuration))
customer_id = 'customer_id_example' # str | The id of the customer to retrieve
usage_limit_id = 'usage_limit_id_example' # str | The id of the usage limit

try:
    # Delete Usage Limit
    api_instance.customer_customer_id_uasge_limit_limit_id_delete(customer_id, usage_limit_id)
except ApiException as e:
    print("Exception when calling UsageApi->customer_customer_id_uasge_limit_limit_id_delete: %s\n" % e)

Parameters

Name Type Description Notes
customer_id str The id of the customer to retrieve
usage_limit_id str The id of the usage limit

Return type

void (empty response body)

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_customer_costs

InlineResponse2001 get_customer_costs(customer_id)

Usage Cost Estimate

The estimated costs from usage based billing for a customer

Example

from __future__ import print_function
import time
import billabear
from billabear.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = billabear.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = billabear.UsageApi(billabear.ApiClient(configuration))
customer_id = 'customer_id_example' # str | The id of the customer to retrieve

try:
    # Usage Cost Estimate
    api_response = api_instance.get_customer_costs(customer_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UsageApi->get_customer_costs: %s\n" % e)

Parameters

Name Type Description Notes
customer_id str The id of the customer to retrieve

Return type

InlineResponse2001

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_customer_usage_limits_by_id

InlineResponse2005 get_customer_usage_limits_by_id(customer_id)

Fetch Customer Usage Limits

Usage Limits for a specific customer

Example

from __future__ import print_function
import time
import billabear
from billabear.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyAuth
configuration = billabear.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = billabear.UsageApi(billabear.ApiClient(configuration))
customer_id = 'customer_id_example' # str | The id of the customer to retrieve

try:
    # Fetch Customer Usage Limits
    api_response = api_instance.get_customer_usage_limits_by_id(customer_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UsageApi->get_customer_usage_limits_by_id: %s\n" % e)

Parameters

Name Type Description Notes
customer_id str The id of the customer to retrieve

Return type

InlineResponse2005

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]