Get storage breakdown for a billing group

This call returns a storage breakdown for a billing group.

To find the billing_group, use the call list billing groups to list all your billing groups.

Request

https://api.sbgenomics.com/v2/billing/groups/{billing_group}/breakdown/storage
https://eu-api.sbgenomics.com/v2/billing/groups/{billing_group}/breakdown/storage

Example request

GET /v2/billing/groups/8ccc6222-ef6f-4526-99d7-9f56b716d43a/breakdown/storage HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
curl -s -H "X-SBG-Auth-Token: 8ccc6222-ef6f-4526-99d7-9f56b716d43a" -H "content-type: application/json" - X GET "https://api.sbgenomics.com/v2/billing/groups/eb5fdee2-36c3-41d1-b179-d9f5d0a0f6f7/breakdown/storage"
from sevenbridges import Api

api = Api(url='https://api.sbgenomics.com/v2',
          token='3259c50e1ac5426ea8f1273259740f74')

billing_group = api.billing_groups.get(
    id='8ccc6222-ef6f-4526-99d7-9f56b716d43a'
)

# send GET request to SB API
breakdown = billing_group.breakdown()

print(breakdown.total_spending.currency, breakdown.total_spending.amount)
for project_breakdown in breakdown.project_breakdown:
    print(project_breakdown.analysis_spending.currency,
          project_breakdown.analysis_spending.amount)
    print(len(project_breakdown.task_breakdown))

Header Fields

Name

Description

X-SBG-Auth-Token
required

Your Seven Bridges Platform authentication token.

Path parameters

Name

Description

billing_group

The ID of the billing group.

Query parameters

Name

Data type

Description

limit

string

The maximum number of collection items to return for a single request.

The default value is 50, while the maximum value is 100.

This is a pagination-specific attribute.

offset

string

The zero-based starting index in the entire collection of the first item to return.

The default value is 0. This is a pagination-specific attribute.

fields

string

Selector specifying a subset of fields to include in the response.

date_from

string

Specify the starting date for retrieving storage analysis in the following format: mm-dd-yyyy.

date_to

string

Specify the ending date for retrieving storage analysis in the following format: mm-dd-yyyy.

invoice_id

string

Specify Invoice ID to show a breakdown for the specific invoice.

If omitted, the current spending breakdown is returned.

Response

See the list of Seven Bridges Platform-specific response codes that may be contained in the body of the response.

Example response body

{
   "href": "https://api.sbgenomics.com/v2/billing/groups/8ccc6222-ef6f-4526-99d7-9f56b716d43a/breakdown/storage?offset=0&limit=2",
   "items": [
     {
        "project_name": "my project",
        "project_locked": false,
        "project_created_by":"voluptatem-quasi-iusto-pariatu/rfranklin",
        "active": {
            "size": "0.032300",
            "unit": "GB/Month"
        },
        "archived": {
            "size": "0.000000",
            "unit": "GB/Month"
        }
        "location": "aws:us-east-1"
      },
      {
         "project_name": "my project",
         "project_locked": false
         "project_created_by": "div/rfranklin",
         "active": {
             "size": "0.032300",
             "unit": "GB/Month"
          },
         "archived": {
             "size": "0.000000"
              "unit": "GB/Month"
         },
        "location": "aws:us-east-1"
     }
   ],
 "links": [
     {
         "href": "https://api.sbgenomics.com/v2/billing/groups/8ccc6222-ef6f-4526-99d7-9f56b716d43a/breakdown/storage?offset=2&limit=2",
         "rel": "next",
         "method": "GET"
     }
   ]
}

Example of a response for a locked project

{
    "href": "https://api.sbgenomics.com/v2/billing/groups/f9fd8fa0-e570-48a0-be00-335957f5ed2c/breakdown/storage?offset=0&limit=5",
    "items": [
        {
            "active": {
                "size": "0.032300",
                "unit": "GB/Month"
            },
            "archived": {
                "size": "0.000000",
                "unit": "GB/Month"
            },
            "project_locked": true
        }
    ],
    "links": []
}