Get egress breakdown for a billing group

This call returns an egress breakdown for a billing group.

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

Request

https://cgc-api.sbgenomics.com/v2/billing/groups/{billing_group}/breakdown/egress

Example request

GET /v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/egress HTTP/1.1
Host: cgc-api.sbgenomics.com
X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74
curl -s -H "X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74" -H "content-type: application/json" - X GET "https://cgc-api.sbgenomics.com/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/egress"
from sevenbridges import Api

api = Api(url='cgc-api.sbgenomics.com/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 CGC 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 egress analysis in the following format: mm-dd-yyyy.
date_tostringSpecify the ending date for retrieving egress 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.

Response

See the list of specific response codes that may be contained in the body of the response.

Example response body

{
  "https://cgc-api.sbgenomics.com/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/egress?offset=0&limit=1",
  "items": [
    {
      "project_name": "my project",
      "project_locked": false,
      "downloaded_by":"rfranklin",
      "downloaded": {
          "size": "0.005730",
          "unit": "GB"
      }
      "egress_cost": {
          "currency": "USD",
          "amount": "0.000516"
      }
    }
  ],
  "links": [
     {
       "href": "https://cgc-api.sbgenomics.com/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/egress?offset=1&limit=1",
       "rel": "next",
       "method": "GET"
     }
  ]
}

Example of a response for a locked project

{
    "href": "https://cgc-api.sbgenomics.com/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/egress?offset=0&limit=1",
    "items": [
        {
            "project_locked": true,
            "downloaded": {
                "size": "0.005730",
                "unit": "GB"
            },
            "egress_cost": {
                "currency": "USD",
                "amount": "0.000516"
            }
        }
    ],
    "links": [
     {
       "href": "https://cgc-api.sbgenomics.com/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/egress?offset=1&limit=1",
       "rel": "next",
       "method": "GET"
     }
  ]
}