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 Studio analysis.

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

Request

https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/billing/groups/{billing_group}/breakdown/analysis

Example request

GET /v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/analysis HTTP/1.1
Host: api.sb.biodatacatalyst.nhlbi.nih.gov
X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74
curl -s -H "X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f747" -H "content-type: application/json" - X GET "https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/analysis"
from sevenbridges import Api

api = Api(url='https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2',
          token='3210a98c1db9318fa9d9273156740f74')

billing_group = api.billing_groups.get(
    id='ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7'
)

# 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

NameDescription
X-SBG-Auth-Token
required
Your Platform authentication token.

Path parameters

NameDescription
billing_groupThe ID of the billing group.

Query parameters

NameData typeDescription
limitintegerThe 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.
offsetintegerThe 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.
fieldsstringSelector specifying a subset of fields to include in the response.
date_fromstringSpecify the starting date for retrieving transactions analysis in the following format: mm-dd-yyyy.
date_tostringSpecify the ending date for retrieving transactions analysis in the following format: mm-dd-yyyy.
invoice_idstringSpecify 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 a list specific response codes that may be contained in the body of the response.

Example response body

{
    "href": "https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/analysis?offset=0&limit=2&date_from=11-04-2020",
    "items": [
        {
            "analysis_type": "TASK",
            "analysis_id": "2dfcfbd3-123a-456b-789c-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": "a1698d63-123a-456b-789c-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.sb.biodatacatalyst.nhlbi.nih.gov/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/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.sb.biodatacatalyst.nhlbi.nih.gov/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/analysis?offset=0&limit=1",
    "items": [
        {
            "analysis_type": "TASK",
            "analysis_id": "48f79ccf-12b3-45b6-789c-b1e8d88dabcd",
            "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.sb.biodatacatalyst.nhlbi.nih.gov/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/analysis?offset=1&limit=1",
            "rel": "next",
            "method": "GET"
        }
    ]
}