You can call this operation to query the RAM policy required for an execution.
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GenerateExecutionPolicy | The operation that you want to perform. Set this parameter to GenerateExecutionPolicy. |
TemplateName | String | Yes | myTemplate | The name of the template. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 14A07460-EBE7-47CA-9757-12CC4761D47A | The ID of the request. |
Policy | String | {} | The RAM policy. |
Examples
Sample request
https://oos.cn-hangzhou.aliyuncs.com/?Action=GenerateExecutionPolicy
&TemplateName=myTemplate
&<Common request parameters>
Sample success responseJSON
format
{
"Policy": {
"Statement": [
{
"Action": [
"ecs:InvokeCommand",
"ecs:DeleteCommand",
"ecs:DescribeInvocations",
"ecs:DescribeInvocationResults",
"ecs:CreateCommand",
"ecs:DescribeInstances"
],
"Effect": "Allow",
"Resource": "*"
}
],
"Version": "1"
},
"RequestId": "C04B668D-D2DD-4B40-B6E9-0E3C4F53D5B5"
}
Error codes
Error code | HTTP status code | Error message | Description |
---|---|---|---|
InvalidVersion | 400 | The specified Version is invalid. | The error message returned because the specified version is invalid. Specify a valid version in the URL and try again. |
InvalidAction.NotFound | 400 | Specified api is not found, please check your url and method. | The error message returned because the specified operation does not exist. Specify a valid value as the Action parameter. |
User.NoPermission | 401 | User has no permission to do the action: ({api_name}) | The error message returned because the user is not authorized to call this operation. Check whether the current user is authorized to call the OOS API operation in the RAM console. |
InvalidStsToken | 400 | Invalid STS token to do the action: ({api_name}) | The error message returned because the specified STS token is invalid. |
ExpiredStsToken | 400 | Expired STS token to do the action: ({api_name}) | The error message returned because the specified STS token has expired. |
InvalidAccountType | 400 | The account type ({account_type}) was not supported. | The error message returned because the specified account type is not supported. |
ExecutionDeleteFailed | 403 | Execution delete failed {{reason}} | The error message returned because you cannot perform the specified operation on an execution in the current state. |
EntityNotExist.Execution | 404 | The specific execution {{key}} does not exist. | The error message returned because the specified execution does not exist. |