Get analysis breakdown for a billing group

This call returns an analysis breakdown for a billing group which contains information on both the tasks and Cruncher analysis.

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/analysis
https://eu-api.sbgenomics.com/v2/billing/groups/{billing_group}/breakdown/analysis

Example request

GET /v2/billing/groups/a7c6613e-7040-4d55-9f13-d73aa03010eae/breakdown/analysis 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/analysis"
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

integer

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

integer

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 transactions analysis in the following format: mm-dd-yyyy.

date_to

string

Specify the ending date for retrieving transactions 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.

To find the particular 'invoice_id' use the List invoices call.

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/a7c6613e-7040-4d55-9f13-d73aa03010eae/breakdown/analysis?offset=0&limit=2&date_from=11-04-2020",
    "items": [
        {
            "analysis_type": "TASK",
            "analysis_id": "2dfcfbe3-c305-4129-85ec-8bec448ab96b",
            "project_locked": false,
            "project_name": "my project",
            "analysis_app_name": "Alignment Metrics QC",
            "analysis_name": "Alignment Metrics QC run - 01-18-21 16:08:24",
            "ran_by": "div/rfranklin",
            "analysis_status": "COMPLETED",
            "analysis_cost": {
                "currency": "USD",
                "amount": "0.024162",
                "breakdown": {
                    "storage": "0.002312",
                    "computation": "0.021850",
                    "data_transfer_in": "0.000000"
                }
            },
            "refunded_amount": "0.000000",
            "time_started": "2021-01-18T16:08:26Z",
            "time_finished": "2021-01-18T16:12:08Z"
        },
        {
            "analysis_type": "CRUNCHER_ANALYSIS",
            "analysis_id": "a1698d65-f4d9-4b5b-b5e0-48019384d4ee",
            "project_locked": false,
            "project_name": "my project",
            "analysis_app_name": "",
            "analysis_name": "an-1",
            "ran_by": "div/rfranklin",
            "analysis_status": "STOPPED",
            "analysis_cost": {
                "currency": "USD",
                "amount": "0.256994",
                "breakdown": {
                    "storage": "0.074055",
                    "computation": "0.182939",
                    "data_transfer_in": "0.000000"
                }
            },
            "refunded_amount": "0.000000",
            "time_started": "2021-01-18T16:00:27Z",
            "time_finished": "2021-01-18T16:32:52Z"
        },
 
    "links": [
        {
            "href": "https://api.sbgenomics.com/v2/billing/groups/a7c6613e-7040-4d55-9f13-d73aa0300eae/breakdown/analysis?offset=2&limit=2&date_from=11-04-2020",
            "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/analysis?offset=0&limit=1",
    "items": [
        {
            "analysis_type": "TASK",
            "analysis_id": "470cbb61-6f27-4e0e-98ad-9b51d5292177",
            "project_locked": true,
            "analysis_cost": {
                "currency": "USD",
                "amount": "0.016491",
                "breakdown": {
                    "storage": "0.007302",
                    "computation": "0.009189",
                    "data_transfer_in": "0.000000"
                }
            },
            "refunded_amount": "0.000000"
        }
    ],
    "links": [
        {
            "href": "https://api.sbgenomics.com/v2/billing/groups/f9fd8fa0-e570-48a0-be00-335957f5ed2c/breakdown/analysis?offset=1&limit=1",
            "rel": "next",
            "method": "GET"
        }
    ]
}