阅读1014 返回首页    go 阿里云


UpdateLogstore__日志库相关接口_API-Reference_日志服务-阿里云

更新Logstore属性,目前只支持更新ttl,shard属性。

请求语法

PUT /logstores/{logstoreName} HTTP/1.1
Authorization: <AuthorizationString> 
Date: <GMT Date>
Host: <Project Endpoint>
x-log-apiversion: 0.6.0
x-log-signaturemethod: hmac-sha1

{
    "logstoreName": <logstoreName>,
    "ttl": <ttl>,
    "shardCount": <shardCount>
}

请求参数

参数名称 类型 是否必须 描述
logstoreName string 日志库名称,同一Project下唯一
ttl integer 日志数据生命周期(TTL),单位为天,范围[1,2]
shardCount integer Shard个数,单位为个,范围[1,10]

请求头

UpdateLogstore接口无特有请求头,关于Log Service API的公共请求头请参考公共请求头

响应头

UpdateLogstore接口无特有响应头,关于Log Service API的公共响应头请参考公共响应头

响应元素

HTTP状态码返回200

错误码

除了返回Log Service API的通用错误码,还可能返回如下特有错误码:

HTTP状态码 ErrorCode ErrorMessage
404 ProjectNotExist Project {ProjectName} not exist
404 LogStoreNotExist logstore {logstoreName} not exist
400 LogStoreAlreadyExist logstore {logstoreName} already exist
500 InternalServerError Specified Server Error Message
400 ParameterInvalid invalid shard count,you can only increase the count

细节描述

shard的数量目前只能增加不能减少。

请求示例:
PUT /logstores/test-logstore HTTP/1.1
Header:
{
x-log-apiversion=0.6.0, 
Authorization=LOG 94to3z418yupi6ikawqqd370:wFcl3ohVJupCi0ZFxRD0x4IA68A=, 
Host=ali-test-project.cn-hangzhou-devcommon-intranet.sls.aliyuncs.com, 
Date=Wed, 11 Nov 2015 08:28:19 GMT, 
Content-Length=55, 
x-log-signaturemethod=hmac-sha1, 
Content-MD5=757C60FC41CC7D3F60B88E0D916D051E, 
User-Agent=sls-java-sdk-v-0.6.0, 
Content-Type=application/json
}
Body : 
{
    "logstoreName": "test-logstore",
    "ttl": 1,
    "shardCount": 2
}
响应示例:
HTTP/1.1 200 OK
Header:
{
Date=Wed, 11 Nov 2015 08:28:20 GMT, 
Content-Length=0, 
x-log-requestid=5642FC2399248C8F7B0145FD, 
Connection=close, 
Server=nginx/1.6.1
}

最后更新:2016-11-23 16:04:02

  上一篇:go DeleteLogstore__日志库相关接口_API-Reference_日志服务-阿里云
  下一篇:go GetLogstore__日志库相关接口_API-Reference_日志服务-阿里云