Google BigQuery Extension

You're viewing Apigee Edge documentation.
Go to the Apigee X documentation.
info

Version 1.0.0

Insert rows into a BigQuery table. List rows from the table.

Prerequisites

This content provides reference for configuring and using this extension. Before using the extension from an API proxy using the ExtensionCallout policy, you must:

  1. Ensure that you have enabled the BigQuery API for your account.

  2. Ensure that you have created a BigQuery dataset and table (with schema) before attempting to insert rows.

  3. Use the GCP Console to generate a key for the service account.

  4. Use the contents of the resulting key JSON file when adding and configuring the extension using the configuration reference.

About Google BigQuery

Google BigQuery is a serverless, scalable enterprise data warehouse that enables super-fast SQL queries using the processing power of Google's infrastructure. Because there is no infrastructure to manage, you can focus on analyzing data to find meaningful insights using familiar SQL without the need for a database administrator.

For a hands-on introduction, try one of the Google BigQuery quickstarts.

Actions

insert

Insert a set of records as a dataset directly into BigQuery, with rows to be inserted and dataset/table ID.

Syntax

<Action>insert</Action>
<Input><![CDATA[{
  "dataset" : dataset-to-insert,
  "table" : table-to-receive-data,
  "rows" : array-of-rows-to-insert
}]]></Input>

Example

<Action>insert</Action>
<Input><![CDATA[{
  "dataset" : "TestData",
  "table" : "TestTable",
  "rows" : [
    {"technology":"CRISPR","inventorFirstName":"Jennifer","inventorLastName":"Doudna"},
    {"technology":"World Wide Web","inventorFirstName":"Tim","inventorLastName":"Berners-Lee"}
    {"technology":"Alternating current","inventorFirstName":"Nikola","inventorLastName":"Tesla"}
  ]
}]]></Input>

Request parameters

Parameter Description Type Default Required
dataset ID of the dataset to insert into BigQuery. String None. Yes.
rows Rows to insert into the table. Array None. Yes.
table Name of the table to receive the data. String None. Yes.

Response

None.

listRows

Lists the rows in the table specified by the table ID and dataset ID.

Syntax

<Action>listRows</Action>
<Input><![CDATA[{
  "dataset" : ID-of-dataset-to-examine,
  "limit" : maximum-rows-to-list,
  "startIndex" : row-index-at-which-to-start-list
  "table" : ID-of-table-to-examine
}]]></Input>

Example

<Action>listRows</Action>
<Input><![CDATA[{
  "dataset" : "TestData",
  "limit" : 2,
  "startIndex" : 1,
  "table" : "TestTable"
}]]></Input>

Request parameters

Parameter Description Type Default Required
dataset ID of the dataset from which to list rows. String None. Yes.
limit Maximum number of rows to list. Integer None. No.
startIndex Row index at which to start the list. Integer None. No.
table ID of the table from which to list rows. String None. Yes.

Response

A rows array.

{
  "rows": [
    {"technology":"World Wide Web","inventorFirstName":"Tim","inventorLastName":"Berners-Lee"}
    {"technology":"Alternating current","inventorFirstName":"Nikola","inventorLastName":"Tesla"}
  ]
}
Parameter Description Type Default Required
rows Array of rows returned from the request. Array None. Yes.

Configuration Reference

Use the following when you're configuring and deploying this extension for use in API proxies. For steps to configure an extension using the Apigee console, see Adding and configuring an extension.

Common extension properties

The following properties are present for every extension.

Property Description Default Required
name Name you're giving this configuration of the extension. None Yes
packageName Name of the extension package as given by Apigee Edge. None Yes
version Version number for the extension package from which you're configuring an extension. None Yes
configuration Configuration value specific to the extension you're adding. See Properties for this extension package None Yes

Properties for this extension package

Specify values for the following configuration properties specific to this extension.

Property Description Default Required
projectId ID of the GCP project where the data. None. Yes.
credentials When entered in the Apigee Edge console, this is the contents of your service account key file. When sent via the management API, it is a base64-encoded value generated from the service account key file. None. Yes.