调用CreateSlrAndSlsProject创建服务关联角色(SLR)以及日志服务(SLS)项目。
说明 单用户调用频率:100次/秒。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateSlrAndSlsProject |
系统规定参数。取值:CreateSlrAndSlsProject。 |
Region | String | 是 | cn-shanghai |
日志服务所在区域,取值范围:
|
BusinessType | String | 否 | cdn_log_access_l1 |
业务类型,取值:
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | fe33a379-5053-4f22-a73c-826e2b44355d |
请求ID。 |
SlsInfo | Object |
创建的日志服务(SLS)信息。 |
|
Project | String | dcdn-edge-rtlog-cn-cfc7**** |
日志服务(SLS)项目。 |
LogStore | String | dcdn-edge-trlog |
日志服务(SLS)日志库。 |
EndPoint | String | cn-shanghai.log.*.com |
日志服务(SLS)接入点。 |
Region | String | cn-shanghai |
日志服务(SLS)区域。 |
示例
请求示例
http(s)://dcdn.aliyuncs.com/?Action=CreateSlrAndSlsProject
&Region=cn-shanghai
&BusinessType=cdn_log_access_l1
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateSlrAndSlsProjectResponse>
<SlsInfo>
<Project>dcdn-edge-rtlog-cn-cfc7****</Project>
<LogStore>dcdn-edge-trlog</LogStore>
<EndPoint>cn-shanghai.log.*.com</EndPoint>
<Region>cn-shanghai</Region>
</SlsInfo>
<RequestId>fe33a379-5053-4f22-a73c-826e2b44355d</RequestId>
</CreateSlrAndSlsProjectResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"SlsInfo" : {
"Project" : "dcdn-edge-rtlog-cn-cfc7****",
"LogStore" : "dcdn-edge-trlog",
"EndPoint" : "cn-shanghai.log.*.com",
"Region" : "cn-shanghai"
},
"RequestId" : "fe33a379-5053-4f22-a73c-826e2b44355d"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | Unauthorized | RealtimeLogDelivery service is not authorized. | 实时日志投递没有授权。 |
400 | CreateSlr.PermissionDenied | You are not authorized to create service-linked roles. Contact your Alibaba Cloud account or an administrator to grant you the AliyunDCDNFullAccess policy or the custom policy used to create service-linked roles. Service name: realtimelogdelivery.dcdn.aliyuncs.com. Action: ram:CreateServiceLinkedRole. | 用户没有创建服务关联角色的权限,请联系主账号或权限管理员授权当前用户AliyunDCDNFullAccess或创建服务关联角色的自定义权限和策略。自定义权限策略的相关信息如下:Service Name:realtimelogdelivery.dcdn.aliyuncs.com,服务关联角色名称:AliyunServiceRoleForDCDNRealTimeLogDelivery, 执行该操作所需的用户权限:ram:CreateServiceLinkedRole |
400 | CreateSlsProjectError | Failed to create a Log Service project. Make sure that you have activated Log Service and the service is in the available state. | 创建日志服务(SLS) Project失败,请确保您已经正确开通了SLS,且SLS处于可用状态。 |
访问错误中心查看更多错误码。