Skip to content

describe_document_permission

describe_document_permission(
    name: DocumentName,
    permission_type: DocumentPermissionType,
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    max_results: Optional[DocumentPermissionMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> DescribeDocumentPermissionResponse

Describes the permissions for a Amazon Web Services Systems Manager document (SSM document). If you created the document, you are the owner. If a document is shared, it can either be shared privately (by specifying a user's Amazon Web Services account ID) or publicly (All).

Parameters:

  • name (DocumentName) –

    The name of the document for which you are the owner.

  • permission_type (DocumentPermissionType) –

    The permission type for the document. The permission type can be Share.

  • max_results (Optional[DocumentPermissionMaxResults], default: None ) –

    The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

  • next_token (Optional[NextToken], default: None ) –

    The token for the next set of items to return. (You received this token from a previous call.)

Raises:

Source code in docs_src/capo_ssm/_services/ssm.py
def describe_document_permission(
    self,
    name: "capo_ssm.types.document_name.DocumentName",
    permission_type: "capo_ssm.types.document_permission_type.DocumentPermissionType",
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    max_results: Optional[
        "capo_ssm.types.document_permission_max_results.DocumentPermissionMaxResults"
    ] = None,
    next_token: Optional["capo_ssm.types.next_token.NextToken"] = None,
) -> "capo_ssm.types.describe_document_permission_response.DescribeDocumentPermissionResponse":
    """<p>Describes the permissions for a Amazon Web Services Systems Manager document (SSM document). If you created the document, you are the owner. If a document is shared, it can either be shared privately (by specifying a user's Amazon Web Services account ID) or publicly (<i>All</i>). </p>

    Args:
        name: <p>The name of the document for which you are the owner. </p>
        permission_type: <p>The permission type for the document. The permission type can be <i>Share</i>.</p>
        max_results: <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
        next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</p>

    Raises:
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.invalid_document.InvalidDocument: <p>The specified SSM document doesn't exist.</p>
        capo_ssm.errors.invalid_document_operation.InvalidDocumentOperation: <p>You attempted to delete a document while it is still shared. You must stop sharing the document before you can delete it.</p>
        capo_ssm.errors.invalid_next_token.InvalidNextToken: <p>The specified token isn't valid.</p>
        capo_ssm.errors.invalid_permission_type.InvalidPermissionType: <p>The permission type isn't supported. <i>Share</i> is the only supported permission type.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ssm.types.describe_document_permission_request.DescribeDocumentPermissionRequest]",
    ) -> OperationResponse[
        "capo_ssm.types.describe_document_permission_response.DescribeDocumentPermissionResponse"
    ]:
        import capo_ssm._operations.amazon_ssm.describe_document_permission

        output, http_response = (
            capo_ssm._operations.amazon_ssm.describe_document_permission.describe_document_permission(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeDocumentPermission")
    )
    input_: capo_ssm.types.describe_document_permission_request.DescribeDocumentPermissionRequest = {
        "name": name,
        "permission_type": permission_type,
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output