All Products
Search
Document Center

:PutProjectPolicy

Last Updated:Jul 25, 2024

Creates a project policy.

Operation description

Usage notes

  • Host consists of a project name and a Simple Log Service endpoint. You must specify a project in Host.

  • Alibaba Cloud Simple Log Service allows you to configure a project policy to authorize other users to access the specified Log Service resources.

    • You must configure a project policy based on policy syntax. Before you configure a project policy, you must be familiar with the Action, Resource, and Condition parameters. For more information, see RAM .
    • If you set the Principal element to an asterisk (*) and do not configure the Condition element when you configure a project policy, the policy applies to all users except for the project owner. If you set the Principal element to an asterisk (*) and configure the Condition element when you configure a project policy, the policy applies to all users including the project owner.
    • You can configure multiple project policies for a project. The total size of the policies cannot exceed 16 KB.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /policy

Request parameters

ParameterTypeRequiredDescriptionExample
bodystringNo

The project policy.

{ "Version": "1", "Statement": [{ "Action": ["log:PostLogStoreLogs"], "Resource": "acs:log:*:*:project/exampleproject/*", "Effect": "Deny", "Condition": { "StringNotLike": { "acs:SourceVpc": ["vpc-*"] } } }] }

Response parameters

ParameterTypeDescriptionExample
headersobject
Serverstring

The name of the server.

nginx
Content-Typestring

The format in which the response body is returned. Valid values: application/json and application/x-protobuf.

application/json
Content-Lengthstring

The length of the response body.

0
Connectionstring

Indicates whether the connection is persistent. Valid values:

  • close: The connection is non-persistent. A new TCP connection is established for each HTTP request.
  • keep-alive: The connection is persistent. After a TCP connection is established, the connection remains open, and no more time or bandwidth are consumed to re-establish connections.
close
Datestring

The time when the response was returned.

Sun, 27 May 2018 08:25:04 GMT
x-log-requestidstring

The request ID.

5B0A6B60BB6EE39764D458B5

Examples

Sample success responses

JSONformat

{}

Error codes

For a list of error codes, visit the Service error codes.