创建时序库(MetricStore),可用于存储时序数据。
接口说明
- 请求语法中的 Host 由 Project 名称和日志服务 Endpoint 构成,您需要在 Host 中指定 Project。 
- 已创建并获取 AccessKey。更多信息,请参见访问密钥。 
阿里云账号 AccessKey 拥有所有 API 的访问权限,风险很高。强烈建议您创建并使用 RAM 用户进行 API 访问或日常运维。RAM 用户需具备操作日志服务资源的权限。具体操作,请参见创建 RAM 用户及授权。
- 
已明确您查询日志所属的 Project 名称、所属地域等信息。如何查询,请参见管理 Project。 
- 
一个 Project 中,最多创建 200 个 LogStore 或 MetricStore。 
- 
当时序数据保存时间达到您所设置的数据保存时间后,数据将被删除。 
- 
同一个 Project 中,LogStore 与 MetricStore 不能重名。 
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
 调试
        
            调试
        
    
授权信息
| 操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 | 
| log:CreateMetricStore | create | *MetricStore 
 | 无 | 无 | 
请求语法
POST /metricstores HTTP/1.1请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
| body | object | 否 | 请求体 | |
| name | string | 是 | 要创建的时序库名称 | my_metric_store | 
| ttl | integer | 是 | 时序库的数据保存时间,单位为天 | 7 | 
| shardCount | integer | 是 | 时序库的 shard 分片数量 | 2 | 
| autoSplit | boolean | 否 | 是否开启自动分裂 | true | 
| maxSplitShard | integer | 否 | 自动分裂的最大 shard 数,仅当 autoSplit 为 true 时有效 | 64 | 
| mode | string | 否 | 时序库的类型,目前仅支持 standard,默认为 standard | standard | 
| metricType | string | 否 | 时序库类型,目前仅支持 prometheus,默认为 prometheus | prometheus | 
| hot_ttl | integer | 否 | ||
| infrequentAccessTTL | integer | 否 | 
返回参数
| 名称 | 类型 | 描述 | 示例值 | 
| headers | object | ||
| Server | string | nginx | |
| Content-Type | string | application/json | |
| Content-Length | string | 0 | |
| Connection | string | close | |
| Date | string | Sun, 27 May 2018 08:25:04 GMT | |
| x-log-requestid | string | 5B0A6B60BB6EE39764D458B5 | 
示例
正常返回示例
JSON格式
{}错误码
| HTTP status code | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 400 | MetricStoreAlreadyExist | The specified metricstore xxx already exists. | 参数所指定的时序库已存在 | 
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。