TDApiClient.API_Request | Google Vertex AI teradataml Extension Library - TDApiClient.API_Request - Teradata Vantage

Teradata Vantageā„¢ - API Integration Guide for Cloud Machine Learning

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Vantage
Release Number
1.4
Published
September 2023
ft:locale
en-US
ft:lastEdition
2023-09-28
dita:mapPath
mgu1643999543506.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
mgu1643999543506

TDApiClient.API_Request is a static helper function to invoke the in-database function API_Request.

This function returns a teradataml DataFrame.

Required Arguments:

  • dataframe: Specifies an input teradataml DataFrame which acts as the input query for the API_Request in-database function.
  • See list of additional required arguments and corresponding parameters in the in-database function API_Request in the following table.

Optional Arguments:

  • options: Specifies key-value arguments to be passed to the in-database function API_Request. See list of these key-value arguments in the following table.

This table shows the mapping between TDApiClient.API_Request arguments to the corresponding parameters in the in-database function API_Request. For details of these parameters, see API_Request In-database Function Syntax Elements.

TDApiClient.API_Request Argument Required or Optional API_Request in-database function Parameter
api_type Required API_TYPE
authorization Required AUTHORIZATION
content_type Optional CONTENT_TYPE
key_start_index Optional KEY_START_INDEX
endpoint Optional ENDPOINT

Example

from TDApiClient import TDApiClient
auth_info_fmt_str = ('{{ "key": "{}", "region" : "{}", "project": "{}"}}')
auth_info = auth_info_fmt_str.format(
            gcp_credentials_token,
            gcp_region,
            gcp_project_id
            )
df = TDApiClient.API_Request(reviews_df, "vertex-ai",
                          authorization=auth_info,
                          endpoint='6918043599082881024',
                          key_start_index=1)