[object Object] Icon

Encoding
Learn how to create, start, manage and modify Encodings

[object Object] Icon

Player
Learn how to create, start, manage and modify Players

[object Object] Icon

Analytics
Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Fri Jan 22 2021

How to create an GCS Service-Account Output for Analytics exports

OverviewLink Icon

In order to export Analytics data to a Google Cloud Storage Bucket a Output needs to be configured within the Bitmovin API. This guide will walk you through the required steps.

To do so you'll need the following pre-requisites:

  • A GCS Bucket
  • A GCE Service Account whith Read/Write Privileges to the Bucket
  • The GCE Service Account JSON Credentials

To create a GCS Bucket please follow the official Google Documentation on creating buckets.

To create a Service Account follow the official Google Documentation on creating and managing service accounts

Retrieving GCE Service Account CredentialsLink Icon

In order to configure the GCS Output via the API you first have to create Service-Account Credentials which the Bitmovin Analytics Exporter will use to write to your bucket.

To do so please visit your Google Cloud Console and navigate to the Service-Account you want to create credentials for and select "Add Key" and generate a JSON Key like shown in the following Screenshots.

How to download GCP Service Account Credentials

Create private key for GCP Service Account

Creating the Analytics Output ResourceLink Icon

Next you simply have to create the analytics output resource using either our OpenAPI Clients or CURL on POST /v1/analytics/outputs/gcs-service-account:

1curl -X POST \
2 https://api.bitmovin.com/v1/analytics/outputs/gcs-service-account \
3 -H 'Content-Type: application/json' \
4 -H 'X-Api-Key: <YOUR API KEY>' \
5 -d '{
6 "name": "<Descriptive name for your export resource>",
7 "bucketName": "<YOUR GCS BUCKET NAME>",
8 "serviceAccountCredentials": "<JSON ENCODED GCS SERVICE ACCOUNT CREDENTIALS>"
9}'

Important: Make sure to correctly encode the credentials.json as whitespaces and newlines in the PEM Key are relevant.

Important: Make sure you are creating this resource in the appropriate Organization if you have been invited into a Multi-Tenant Organization. Your personal API Key will by default create all resources in your user's organization and not in the organization you have been invited to. You can pass the X-Tenant-Org-Id HTTP Header or use the withTenantOrgId() API to indicate which Organization your API call is targetting (see Using an API SDK with different Organisations ).

The response will contain a id for the newly created Output which you can then use to trigger a Analytics Export.

What's next?Link Icon

What's next? Now that you have an GCS Service-Account Output for Bitmovin Analytics available, you can export your Bitmovin analytics Data to it :)

Give us feedback