调用UpdateLogStore接口更新Logstore的属性信息。
接口说明
目前该接口只支持更新数据保存时间(TTL)属性。
请求头
该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。
请求语法
PUT /logstores/{logstore} HTTP/1.1
请求参数
名称 | 类型 | 位置 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|---|
project | String | Host | 是 | ali-test-project |
Project名称。 |
logstore | String | Path | 是 | test-logstore |
Logstore名称。 |
Object | Body | 是 |
请求体参数。 |
||
appendMeta | Boolean | Body | 否 | false |
是否记录外网IP地址功能。默认值为false。
|
autoSplit | Boolean | Body | 否 | true |
是否自动分裂Shard。
|
enable_tracking | Boolean | Body | 否 | false |
是否开启WebTracking功能。默认值为false。
|
encrypt_conf | EncryptConf | Body | 否 |
加密配置数据结构。 |
|
logstoreName | String | Body | 是 | test-logstore |
Logstore名称。 |
maxSplitShard | Integer | Body | 否 | 64 |
自动分裂时最大的Shard个数,最小值是1,最大值是64。 说明 当autoSplit为true时必须指定。
|
shardCount | Integer | Body | 是 | 2 |
Shard分区个数。 说明 该接口不支持更新分区个数。只能通过SplitShard或MergeShards接口修改分区个数。
|
ttl | Integer | Body | 是 | 30 |
数据的保存时间,单位为天。取值范围为1~3650。如果配置为3650,表示永久保存。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Server | String | nginx |
服务器名称。 |
Content-Length | String | 0 |
内容长度。 |
Connection | String | close |
是否长链接。取值包括:
|
Access-Control-Allow-Origin | String | * |
允许所有跨域脚本访问该资源。 |
Date | String | Sun, 27 May 2018 08:25:04 GMT |
时间。 |
x-log-requestid | String | 5B0A6B60BB6EE39764D458B5 |
返回的请求ID。 |
示例
请求示例
PUT /logstores/test-logstore HTTP/1.1
Host:ali-test-project.cn-hangzhou.log.aliyuncs.com
Content-Type:application/json
{
"appendMeta" : false,
"autoSplit" : true,
"enable_tracking" : false,
"encrypt_conf" : {
"user_cmk_info" : { }
},
"logstoreName" : "test-logstore",
"maxSplitShard" : 64,
"shardCount" : 2,
"ttl" : 30
}
正常返回示例
JSON
格式
HTTP/1.1 200 OK
错误码
访问错误中心查看更多错误码。
HttpStatusCode |
ErrorCode |
ErrorMessage |
错误码描述 |
---|---|---|---|
404 |
ProjectNotExist |
Project does not exist. |
Project不存在。 |
404 |
LogStoreNotExist |
Logstore does not exist. |
Logstore不存在。 |
400 |
LogStoreAlreadyExist |
Logstore already exists. |
Logstore已存在。 |
400 |
ParameterInvalid |
invalid shard count,you can only modify shardCount by split& merge shard. |
无效Shard个数,您只能通过SplitShard或MergeShards接口修改分区个数(shardCount)属性。 |
500 |
InternalServerError |
Specified Server Error Message. |
内部服务调用错误。 |
更多信息,请参见通用错误码。