调用CreateProject创建一个Project。

请求语法

POST / HTTP/1.1
Authorization: <AuthorizationString> 
x-log-bodyrawsize: 0
User-Agent: <UserAgent>
x-log-apiversion: 0.6.0
Host: <Project Endpoint>
x-log-signaturemethod: hmac-sha1
Date: <GMT Date>
Content-Type: application/json
Content-MD5: <Content-MD5>
Content-Length: <ContentLength>
Connection: Keep-Alive
{
  "projectName": <ProjectName>,
  "description": <Description>
}

请求参数

  • 请求头

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

  • 参数列表
    属性名称 类型 是否必须 示例值 描述
    projectName string my-project-test Project名称。
    description string Description of my-project-test Project描述。

返回数据

  • 响应头

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

  • 响应元素

    HTTP状态码返回200。

示例

  • 请求示例
    POST / HTTP/1.1
    Authorization: LOG <yourAccessKeyId>:<yourSignature>
    x-log-bodyrawsize: 0
    User-Agent: sls-java-sdk-v-0.6.1
    x-log-apiversion: 0.6.0
    Host: my-project-test.cn-shanghai.log.aliyuncs.com
    x-log-signaturemethod: hmac-sha1
    Date: Sun, 27 May 2018 07:43:26 GMT
    Content-Type: application/json
    Content-MD5: A7967D81EFF5E3CD447FB6D8DF294E20
    Content-Length: 80
    Connection: Keep-Alive
    {
      "projectName": "my-project-test",
      "description": "Description of my-project-test"
    }
  • 正常返回示例
    HTTP/1.1 200
    Server: nginx
    Content-Length: 0
    Connection: close
    Access-Control-Allow-Origin: *
    Date: Sun, 27 May 2018 07:43:27 GMT
    x-log-requestid: 5B0A619F205DC3F30EDA9322

错误码

HTTP状态码 错误码 错误信息 描述
400 ProjectAlreadyExist Project {project} already exist. 项目已存在。
400 ParameterInvalid The body is not valid json string. 无效的参数。
500 InternalServerError Specified Server Error Message. 内部服务调用错误。

更多错误码,请参见通用错误码