重置用户密码

最近更新时间:2025-01-21 19:52:12

我的收藏

接口定义

change_password() 用于修改自定义用户密码。
def change_password(self,
user: str,
password: str) -> dict:

使用示例

import tcvectordb
from tcvectordb.model.enum import ReadConsistency
#create a database client object
client = tcvectordb.RPCVectorDBClient(url='http://10.0.X.X:80', username='root', key='eC4bLRy2va******************************', read_consistency=ReadConsistency.EVENTUAL_CONSISTENCY, timeout=30)
res = client.change_password(user='app_user', password='########')
print(res)

入参描述

参数名
参数含义
数据类型
是否必填
参数配置
user
指定用户名
string
长度要求:1~32字符。
字符类型要求:只能使用英文字母、数字、下划线,并以英文字母开头。
password
设置新密码
string
密码长度要求:8~128字符。
密码字符类型要求如下:
字母:大写 A~Z、小写 a~z。
数字:0~9。
特殊符号包括:下划线(_)、加号(+)、减号(-)、逗号(,)、和号(&)、等号(=)、感叹号(!)、@符号(@)、井号(#)、美元符号($)、百分号(%)、脱字符(^)、星号(*)、圆括号(())、点号(.)。

响应消息

{
"code": 0,
"msg": "Operation success"
}