TDApiClient .API_Request | teradataml Azure Extension Library |API Integration - 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.

  • dataframe: Specifies an input teradataml DataFrame which will act as the input query for the API_Request in-database function.

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.

The following 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" : "{}"}}')
auth_info = auth_info_fmt_str.format(access_key, azure_region)
df = TDApiClient.API_Request(
                 reviews_df,
                 "azure-ml",
                 authorization=auth_info,
                 endpoint='test-azure-ml-endpoint',
                 content_type="csv"
)