You need to enable JavaScript to run this app.
导航
初始化客户端
最近更新时间:2023.11.21 16:38:02首次发布时间:2023.11.21 16:38:02

veDB MySQL Python 客户端提供了一系列接口与 veDB MySQL 服务进行交互,用来管理 veDB MySQL 数据库资源。您需要先初始化 veDB MySQL Python 客户端,才可以向 veDB MySQL 服务发送 HTTP/HTTPS 请求。本文介绍如何初始化 veDB MySQL Python 客户端。

前提条件

初始化客户端

使用如下代码初始化客户端。

import volcenginesdkcore
import volcenginesdkvedbm
from volcenginesdkvedbm import VEDBMApi

def init_client():
    configuration = volcenginesdkcore.Configuration()

    configuration.client_side_validation = True
    configuration.schema = "https"
    configuration.debug = False
    configuration.logger_file = "sdk.log"

    configuration.region = "your region"
    configuration.ak = "your ak"
    configuration.sk = "your sk"
    configuration.host = "service host"

    volcenginesdkcore.Configuration.set_default(configuration)

    return VEDBMApi(volcenginesdkcore.ApiClient(configuration))