Skip to main content

Snappy is a Python library that facilitates taking root volume snapshots from EC2 as well as other EBS volumes.

Project description

Snappy

Snappy is a Python library that facilitates taking snapshots on EBS.

There are two ways to take snapshots, you can either provide a volume id or an ec2 instance id/instance ipv4/instance name. If you provide an ec2 detail, it will take a snapshot of the root volume of the instance.

Getting Started

Assuming that you have Python and virtualenv installed, set up your environment and install the required dependencies using pip:

pip install aws-snappy

Using Snappy

After installing snappy, you need to import the main Snappy object and instantiate it to create a connection to AWS:

from snappy.snappy import Snappy

snappy = Snappy(values)

Here,

instances is your list of instances to take snapshots of. i.e. ['10.10.10.10', 'my_instance_name'] Instance can be indentified both by their private IP address or the instance name in the same list. Snappy will break them apart and search them respectively.

Available function for Snappy Object

take_snapshots(tags_specifications)

This function will take a snapshot of the root volume of the specified instances and return the output in a list in the following format:

Parameters

tags_specifications <optional>: A list of dictionaries containing the tags to be applied to the snapshots in the following format:

[{
    "Key": "",
    "Value": ""
}]

Output

[
    {
        "SnapshotID": "",
        "InstanceName": "",
        "VolumeID": "",
    },
    .
    .
    .
]

Running Tests

You can run the tests by following the steps below:

  1. Clone or download the project to a folder on your computer.
  2. Connect to AWS using AWS CLI
  3. Run the tests using the command ./run_test.sh

License

Copyright Mervin Hemaraju

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws-snappy-2.1.0.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file aws-snappy-2.1.0.tar.gz.

File metadata

  • Download URL: aws-snappy-2.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for aws-snappy-2.1.0.tar.gz
Algorithm Hash digest
SHA256 bbf8f19faefa278487de6134f17daa82e1786ad7497ae41cc14c8126114b5d27
MD5 9162e24d9b1fb630cbf167802f997d4f
BLAKE2b-256 5a2d7d2df534e52b1e622d04dbf4b3f007fc6ef0f011bd3f0c6eb05bb4b0781b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page