Skip to content

reset_snapshot_attribute

reset_snapshot_attribute(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    attribute: Optional[SnapshotAttributeName] = None,
    snapshot_id: Optional[SnapshotId] = None,
    dry_run: Optional[Boolean] = None,
) -> None

Resets permission settings for the specified snapshot.

For more information about modifying snapshot permissions, see Share a snapshot in the Amazon EBS User Guide.

Parameters:

  • attribute (Optional[SnapshotAttributeName], default: None ) –

    The attribute to reset. Currently, only the attribute for permission to create volumes can be reset.

  • snapshot_id (Optional[SnapshotId], default: None ) –

    The ID of the snapshot.

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Raises:

Examples:

To reset a snapshot attribute This example resets the create volume permissions for snapshot snap-1234567890abcdef0. If the command succeeds, no output is returned.

>>> client.reset_snapshot_attribute(snapshot_id='snap-1234567890abcdef0', attribute='createVolumePermission')
Source code in docs_src/capo_ec2/_services/ec2.py
def reset_snapshot_attribute(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    attribute: Optional[
        "capo_ec2.types.snapshot_attribute_name.SnapshotAttributeName"
    ] = None,
    snapshot_id: Optional["capo_ec2.types.snapshot_id.SnapshotId"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> None:
    """<p>Resets permission settings for the specified snapshot.</p> <p>For more information about modifying snapshot permissions, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-modifying-snapshot-permissions.html">Share a snapshot</a> in the <i>Amazon EBS User Guide</i>.</p>

    Args:
        attribute: <p>The attribute to reset. Currently, only the attribute for permission to create volumes can be reset.</p>
        snapshot_id: <p>The ID of the snapshot.</p>
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To reset a snapshot attribute
        This example resets the create volume permissions for snapshot ``snap-1234567890abcdef0``. If the command succeeds, no output is returned.

        >>> client.reset_snapshot_attribute(snapshot_id='snap-1234567890abcdef0', attribute='createVolumePermission')
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.reset_snapshot_attribute_request.ResetSnapshotAttributeRequest]",
    ) -> OperationResponse[None]:
        import capo_ec2._operations.amazon_ec2.reset_snapshot_attribute

        output, http_response = (
            capo_ec2._operations.amazon_ec2.reset_snapshot_attribute.reset_snapshot_attribute(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ResetSnapshotAttribute")
    )
    input_: capo_ec2.types.reset_snapshot_attribute_request.ResetSnapshotAttributeRequest = {}
    if attribute is not None:
        input_["attribute"] = attribute
    if snapshot_id is not None:
        input_["snapshot_id"] = snapshot_id
    if dry_run is not None:
        input_["dry_run"] = dry_run

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