You need to enable JavaScript to run this app.
Streaming Computing Flink Version

Streaming Computing Flink Version

Copy page
Download PDF
SDK Reference
Python
Copy page
Download PDF
Python

Description

This document provides instructions for using the Flink SDK. To view all API details, see the API documentation. Use API Explorer to quickly make API calls, get responses, and view code examples.

Download URL

Release URL

https://pypi.org/project/volcengine-python-sdk/1.1.3/

Source code URL

https://github.com/volcengine/volcengine-python-sdk/tree/master/volcenginesdkflink20250101

Installation instructions

Prerequisites

Environment requirements

Python 2.7 or later.
Note
Installation may fail due to the maximum path length limit in Windows. Configure your settings as follows:

  1. Press Win+R and enter "regedit" to open the Registry Editor.
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem and set the LongPathsEnabled value to 1.

Installation Steps

Step 1: integrate the service repository
Install via pip:

pip install volcengine-python-sdk

Install via Setuptools:

python setup.py install --user

Or sudo python setup.py install to install dependencies for all users.

Step 2: initialize on startup and configure the global default parameters for Configuration

configuration = volcenginesdkcore.Configuration()
configuration.client_side_validation = True  # Whether the client performs parameter validation
configuration.schema = "http"  # https or http
configuration.debug = False  # Whether to enable debugging
configuration.logger_file = "sdk.log"

volcenginesdkcore.Configuration.set_default(configuration)

Step 3: get the Client

def get_client(ak, sk, region):
    # Include default properties
    configuration = volcenginesdkcore.Configuration()
    configuration.ak = ak # Leaking the AK is risky. It is recommended to retrieve it from a configuration file.
    configuration.sk = sk # SK leakage is a security risk. We recommend obtaining the SK from a configuration file.
    configuration.region = region
    client = volcenginesdkautoscaling.AUTOSCALINGApi(volcenginesdkcore.ApiClient(configuration))
    return client

Usage Instructions

Endpoint Settings

If you want to customize the SDK's Endpoint, you can configure it with the following code example:

configuration = volcenginesdkcore.Configuration()
configuration.host = 'ecs.cn-beijing-autodriving.volcengineapi.com'

Volcengine standard Endpoint rules:

Regional Service

Global Service

{service}.{region}.volcengineapi.com
For example, the domain name for the ECS cloud service in the cn-beijing-autodriving Region is ecs.cn-beijing-autodriving.volcengineapi.com.

{service}.volcengineapi.com
For example, Access Control (IAM) is a Global service, and its domain name is iam.volcengineapi.com.

Note: Convert underscores (_) in the Service name to hyphens (-) for the Endpoint. Convert uppercase letters to lowercase.

SDK example

The following is an SDK code sample for calling the GetApplicationInstance API. You can replace it with any other API supported by the SDK in your project.

# Example Code generated by Beijing Volcanoengine Technology.
from __future__ import print_function
import volcenginesdkcore
import volcenginesdkflink20250101
from pprint import pprint
from volcenginesdkcore.rest import ApiException

if __name__ == '__main__':
    configuration = volcenginesdkcore.Configuration()
    configuration.ak = "Your AK"
    configuration.sk = "Your SK"
    configuration.region = "cn-beijing"
    # set default configuration
    volcenginesdkcore.Configuration.set_default(configuration)

    # use global default configuration
    api_instance = volcenginesdkflink20250101.FLINK20250101Api()
    get_application_instance_request = volcenginesdkflink20250101.GetApplicationInstanceRequest(
    )

    try:
        resp = api_instance.get_application_instance(get_application_instance_request)
        pprint(resp)
    except ApiException as e:
        print("Exception when calling api: %s\n" % e)
Last updated: 2026.04.01 11:04:46