Retrieves the contents of a managed permission in JSON format.
Parameters:
-
permission_arn
(String)
–
Specifies the Amazon Resource Name (ARN) of the permission whose contents you want to retrieve. To find the ARN for a permission, use either the ListPermissions operation or go to the Permissions library page in the RAM console and then choose the name of the permission. The ARN is displayed on the detail page.
-
permission_version
(Optional[Integer], default:
None
)
–
Specifies the version number of the RAM permission to retrieve. If you don't specify this parameter, the operation retrieves the default version.
To see the list of available versions, use ListPermissionVersions.
Raises:
Source code in docs_src/capo_ram/_services/ram.py
| def get_permission(
self,
permission_arn: "capo_ram.types.string.String",
*,
config_overrides: Optional[RAMClientConfig] = None,
permission_version: Optional["capo_ram.types.integer.Integer"] = None,
) -> "capo_ram.types.get_permission_response.GetPermissionResponse":
"""<p>Retrieves the contents of a managed permission in JSON format.</p>
Args:
permission_arn: <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the permission whose contents you want to retrieve. To find the ARN for a permission, use either the <a>ListPermissions</a> operation or go to the <a href="https://console.aws.amazon.com/ram/home#Permissions:">Permissions library</a> page in the RAM console and then choose the name of the permission. The ARN is displayed on the detail page.</p>
permission_version: <p>Specifies the version number of the RAM permission to retrieve. If you don't specify this parameter, the operation retrieves the default version.</p> <p>To see the list of available versions, use <a>ListPermissionVersions</a>.</p>
Raises:
capo_ram.errors.invalid_parameter_exception.InvalidParameterException: <p>The operation failed because a parameter you specified isn't valid.</p>
capo_ram.errors.malformed_arn_exception.MalformedArnException: <p>The operation failed because the specified <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> has a format that isn't valid.</p>
capo_ram.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>The operation failed because the requested operation isn't permitted.</p>
capo_ram.errors.server_internal_exception.ServerInternalException: <p>The operation failed because the service could not respond to the request due to an internal problem. Try again later.</p>
capo_ram.errors.service_unavailable_exception.ServiceUnavailableException: <p>The operation failed because the service isn't available. Try again later.</p>
capo_ram.errors.unknown_resource_exception.UnknownResourceException: <p>The operation failed because a specified resource couldn't be found.</p>
capo_ram.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_ram.types.get_permission_request.GetPermissionRequest]",
) -> OperationResponse[
"capo_ram.types.get_permission_response.GetPermissionResponse"
]:
import capo_ram._operations.amazon_resource_sharing.get_permission
output, http_response = (
capo_ram._operations.amazon_resource_sharing.get_permission.get_permission(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetPermission")
)
input_: capo_ram.types.get_permission_request.GetPermissionRequest = {
"permission_arn": permission_arn
}
if permission_version is not None:
input_["permission_version"] = permission_version
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|