This topic describes examples and the SDK for Python for calling services in Elastic Algorithm Service (EAS).

The sample code for EAS can be obtained from the GitHub website.

Call examples in Python

You can send an HTTP request to call a service over a public endpoint or VPC endpoint. The formats of the request inputs and outputs are specified by the processor that is used to deploy the service. The authentication method varies depending on whether you use a public endpoint or VPC endpoint. EAS provides sample code for calling services that are deployed based on the official processor. For more information, see Demos for PMML/TensorFlow services in Python. The following demos are provided:
  • Demo for calling a Predictive Model Markup Language (PMML) service over a public endpoint.
  • Demo for calling a PMML service over a VPC endpoint.
  • Demo for calling a TensorFlow service over a public endpoint. You can follow this demo when you call a Caffe service over a public endpoint. The input and output for the two service types are the same.
  • Demo for calling a TensorFlow service over a VPC endpoint. You can follow this demo when you call a Caffe service over a VPC endpoint. The input and output for the two service types are the same.

SDK for Python for calling services

The SDK for Python for calling services encapsulates a multi-thread connection pool, request data construction, and service requests. For more information, see the official Python SDK.