更新边属性
功能介绍
更新边的属性值,更新操作包含添加ADD,修改UPDATE和删除DEL。
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/properties/action?action_id={actionId}&source={sourceVertex}&target={targetVertex}&index={index}
| 参数 | 是否必选 | 类型 | 说明 |
|---|---|---|---|
| project_id | 是 | String | 项目ID。获取方法请参见获取项目ID。 |
| graph_name | 是 | String | 图名称。 |
| actionId | 是 | String | 操作符。
|
| sourceVertex | 是 | String | 边的起点。 |
| targetVertex | 是 | String | 边的终点。 |
| index | 否 | Integer | 边的标识号,若不设置,则修改两点间第一条边的属性。 |
请求参数
| 参数 | 是否必选 | 类型 | 说明 |
|---|---|---|---|
| properties | 是 | Object | 各个属性的值。 |
| label | 否 | String | label名称 |
| targetProperties | 否 | Array | 判断重复边所用的属性列表。
属性列表元素格式见表 targetProperty参数说明。 |
请求示例
更新边的属性值,属性名为Rating的值为7,属性名为Datetime的值为2020-12-27 23:44:41,标签名称为rate。
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/properties/action?action_id=update&source=Lily&target=Tom&index=1
{
"properties": {
"Rating": ["7"],
"Datetime":["2020-12-27 23:44:41"]
},
"targetProperties": [
{
"label": "rate",
"properties": [
"Rating"
]
}
]
} 响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| errorMessage | String | 系统提示信息。
|
| errorCode | String | 系统提示信息。
|
| result | String | 响应结果。成功时result值为success,失败时值为failed。 |
响应示例
状态码: 200
成功响应示例
Http Status Code: 200
{
"result": "success"
} 状态码: 400
Http Status Code: 400
{
"errorMessage": "edge [Lily-Tom-1] does not exist",
"errorCode": "GES.8221"
} 状态码
| 返回值 | 说明 |
|---|---|
| 400 Bad Request | 请求错误。 |
| 401 Unauthorized | 鉴权失败。 |
| 403 Forbidden | 没有操作权限。 |
| 404 Not Found | 找不到资源。 |
| 500 Internal Server Error | 服务内部错误。 |
| 503 Service Unavailable | 服务不可用。 |
错误码
请参见错误码。
