python-cassandra-cli


Namepython-cassandra-cli JSON
Version 1.4.0 PyPI version JSON
download
home_page
SummaryPython CLI for cassandra snapshots. CLI allows to store and restore snapshot and uses AWS S3 bucket as storage.
upload_time2023-02-07 03:33:22
maintainer
docs_urlNone
authorAndrii Derevianko
requires_python>=3.6
license
keywords snapshot python package cassandra backup migration
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python Cassandra CLI tool

## Descirptoin
  CLI has **7** main commands:
  1. copy-snapshot-folder       Copy folder with snapshots from s3 bucket
  2. restore-snapshot-keyspace  Restore Keyspace snapshot from s3 bucket
  3. restore-snapshot-table     Restore Table snapshot from s3 bucket
  4. store-snapshot-keyspace    Take and store Keyspace snapshot to s3 bucket
  5. store-snapshot-table       Take and store Table snapshot to s3 bucket
  6. store-backup-keyspace      Take and store Keyspace backup to s3 bucket without running nodetool, sstableloader, and cqlsh
  7. restore-backup-keyspace    Restore Keyspace backup from s3 bucket without running nodetool, sstableloader, and cqlsh

## Release Notes

### 1.4.0
  1. Updated store-backup-keyspace and restore-backup-keyspace.
### 1.3.6
  1. Updated readme.
### 1.3.5
  1. cleanup.

### 1.3.4
  1. copy backup updates.

### 1.3.3
  1. boolean values updates.


### 1.3.2
  1. null values updates.

### 1.3.1
  1. Increased CSV file field size limit.
  2. Creation schema fix.  

### 1.3.0
  1. **store-backup-keyspace** and **restore-backup-keyspace** commands which doesn't run nodetool, sstableloader, and cqlsh. It uses only cassandra-driver.

### 1.2.1
  1. --truststore-password and --keystore-password options \
  which is used in **sstableloader** command in *"restore-snapshot-keyspace"* and *"restore-snapshot-table"*
  2. --version option

### 1.1.1
  Clean up code
### 1.1.0
  1. Added --ssl flag for cqlsh command if connection supports only SSL connection; --ssl-cqlsh option
  2. Logic -p flag for sstableloader not mandatory for SSL connection type
  3. Overriding folder main folder name; --snapshot-folder-override option
### 1.0.3
  Fix option description: create-keyspace-schema

### 1.0.2
  Updated Authentication logic

### 1.0.1
  Added boto3 libs in requirements

### 1.0.0
  Initial release

## AWS resources access

## AWS S3 bucket
  1. You need to set -s3(--s3-bucket), -id(--aws-access-key-id) and  -key(--aws-secret-access-key) options for the connection to AWS S3
    bucket via access key. 
  2. If your host has AWS profile setup in .aws/credentials and/or IAM role with s3 bucket permissons then CLI
    needs only -s3(--s3-bucket) option.
## AWS Systems Manager
  1. You need to set -sn(--secret-name), -id(--aws-access-key-id) and  -key(--aws-secret-access-key) for getting secrest from Paramenter Store.
  2. If your host has AWS profile setup in .aws/credentials and/or IAM role with SSM permissons then CLI
    needs only -sn(--secret-name) option.
  3. Optionally you can change -r(--aws-region) for SSM. Default value is 'us-east-1'


## Commands examples:

### Store keyspace snapshot on s3 
```
python-cassandra-cli store-snapshot-keyspace  
  -k my_keyspace 
  -t tag-01-keyspace
  -e dev 
  -s3 my.s3.bucket 
  -h "10.99.3.55"   
  --ssm-secret -sn /cassandra/dev 
```

### Store keyspace snapshot on s3 with keyspace schema
```
python-cassandra-cli store-snapshot-keyspace  
  -k my_keyspace 
  -t tag-01-keyspace
  -e dev -s3 my.s3.bucket -h "10.99.3.55"  
  --ssm-secret -sn /cassandra/dev 
  --create-keyspace-schema
``` 

### Store table snapshot on s3 with keyspace schema
```
python-cassandra-cli store-snapshot-table 
  -k my_keyspace 
  -tn my_table
  -t tag-01-table 
  -e dev 
  -s3 my.s3.bucket 
  -h "10.99.3.55"  
  --ssm-secret
  -sn /cassandra/dev 
  --create-keyspace-schema
```

### Resotore table

```
python-cassandra-cli restore-snapshot-table 
  -sf 1608700346_snapshots_tag-01-keyspace_my_keyspace_develop 
  -t tag-01-table 
  -k my_keyspace 
  -tn my_table -h "10.99.3.55" 
  --ssm-secret 
  -sn /cassandra/dev 
  -s3 my.s3.bucket
```
### Restore table ssl
```
python-cassandra-cli restore-snapshot-table  
  -sf 1608700346_snapshots_tag-01-table_my_table_develop 
  -t tag-01-table 
  -k my_keyspace 
  -tn my_table 
  -h "10.99.3.55" 
  --ssm-secret 
  -s3 my.s3.bucket 
  -sn /cassandra/dev 
  -cf /etc/cassandra/conf/cassandra.yaml  
  -ks /etc/cassandra/conf/keystore.node0 
  -ts /etc/cassandra/conf/truststore.node0 
  -ssl 
  -pt 9142 
```
### Restore keyspace ssl with keyspace creation
```
python-cassandra-cli restore-snapshot-keyspace  
  -sf 608700346_snapshots_tag-01-keyspace_my_keyspace_develop 
  -t tag-01-keyspace 
  -k my_keyspace  
  -h "10.99.3.55" 
  --ssm-secret 
  -s3 my.s3.bucket 
  -sn /cassandra/dev 
  --create-keyspace-schema 
  -e develop 
  -cf /etc/cassandra/conf/cassandra.yaml  
  -ks /etc/cassandra/conf/keystore.node0 
  -ts /etc/cassandra/conf/truststore.node0 
  -ssl 
  -pt 9142 
```
### Copy folder with sanpshot on local
```
python-cassandra-cli copy-snapshot-folder 
  -s3 my.s3.bucket 
  -sf 1608700346_snapshots_tag-01-keyspace_my_keyspace_develop
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "python-cassandra-cli",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "snapshot python package cassandra backup migration",
    "author": "Andrii Derevianko",
    "author_email": "sof2025@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/20/b8/d40f862d6d21bde4af90b78e84c3a68cf33cfa5ef6e43300837acab2bd69/python-cassandra-cli-1.4.0.tar.gz",
    "platform": null,
    "description": "# Python Cassandra CLI tool\n\n## Descirptoin\n  CLI has **7** main commands:\n  1. copy-snapshot-folder       Copy folder with snapshots from s3 bucket\n  2. restore-snapshot-keyspace  Restore Keyspace snapshot from s3 bucket\n  3. restore-snapshot-table     Restore Table snapshot from s3 bucket\n  4. store-snapshot-keyspace    Take and store Keyspace snapshot to s3 bucket\n  5. store-snapshot-table       Take and store Table snapshot to s3 bucket\n  6. store-backup-keyspace      Take and store Keyspace backup to s3 bucket without running nodetool, sstableloader, and cqlsh\n  7. restore-backup-keyspace    Restore Keyspace backup from s3 bucket without running nodetool, sstableloader, and cqlsh\n\n## Release Notes\n\n### 1.4.0\n  1. Updated store-backup-keyspace and restore-backup-keyspace.\n### 1.3.6\n  1. Updated readme.\n### 1.3.5\n  1. cleanup.\n\n### 1.3.4\n  1. copy backup updates.\n\n### 1.3.3\n  1. boolean values updates.\n\n\n### 1.3.2\n  1. null values updates.\n\n### 1.3.1\n  1. Increased CSV file field size limit.\n  2. Creation schema fix.  \n\n### 1.3.0\n  1. **store-backup-keyspace** and **restore-backup-keyspace** commands which doesn't run nodetool, sstableloader, and cqlsh. It uses only cassandra-driver.\n\n### 1.2.1\n  1. --truststore-password and --keystore-password options \\\n  which is used in **sstableloader** command in *\"restore-snapshot-keyspace\"* and *\"restore-snapshot-table\"*\n  2. --version option\n\n### 1.1.1\n  Clean up code\n### 1.1.0\n  1. Added --ssl flag for cqlsh command if connection supports only SSL connection; --ssl-cqlsh option\n  2. Logic -p flag for sstableloader not mandatory for SSL connection type\n  3. Overriding folder main folder name; --snapshot-folder-override option\n### 1.0.3\n  Fix option description: create-keyspace-schema\n\n### 1.0.2\n  Updated Authentication logic\n\n### 1.0.1\n  Added boto3 libs in requirements\n\n### 1.0.0\n  Initial release\n\n## AWS resources access\n\n## AWS S3 bucket\n  1. You need to set -s3(--s3-bucket), -id(--aws-access-key-id) and  -key(--aws-secret-access-key) options for the connection to AWS S3\n    bucket via access key. \n  2. If your host has AWS profile setup in .aws/credentials and/or IAM role with s3 bucket permissons then CLI\n    needs only -s3(--s3-bucket) option.\n## AWS Systems Manager\n  1. You need to set -sn(--secret-name), -id(--aws-access-key-id) and  -key(--aws-secret-access-key) for getting secrest from Paramenter Store.\n  2. If your host has AWS profile setup in .aws/credentials and/or IAM role with SSM permissons then CLI\n    needs only -sn(--secret-name) option.\n  3. Optionally you can change -r(--aws-region) for SSM. Default value is 'us-east-1'\n\n\n## Commands examples:\n\n### Store keyspace snapshot on s3 \n```\npython-cassandra-cli store-snapshot-keyspace  \n  -k my_keyspace \n  -t tag-01-keyspace\n  -e dev \n  -s3 my.s3.bucket \n  -h \"10.99.3.55\"   \n  --ssm-secret -sn /cassandra/dev \n```\n\n### Store keyspace snapshot on s3 with keyspace schema\n```\npython-cassandra-cli store-snapshot-keyspace  \n  -k my_keyspace \n  -t tag-01-keyspace\n  -e dev -s3 my.s3.bucket -h \"10.99.3.55\"  \n  --ssm-secret -sn /cassandra/dev \n  --create-keyspace-schema\n``` \n\n### Store table snapshot on s3 with keyspace schema\n```\npython-cassandra-cli store-snapshot-table \n  -k my_keyspace \n  -tn my_table\n  -t tag-01-table \n  -e dev \n  -s3 my.s3.bucket \n  -h \"10.99.3.55\"  \n  --ssm-secret\n  -sn /cassandra/dev \n  --create-keyspace-schema\n```\n\n### Resotore table\n\n```\npython-cassandra-cli restore-snapshot-table \n  -sf 1608700346_snapshots_tag-01-keyspace_my_keyspace_develop \n  -t tag-01-table \n  -k my_keyspace \n  -tn my_table -h \"10.99.3.55\" \n  --ssm-secret \n  -sn /cassandra/dev \n  -s3 my.s3.bucket\n```\n### Restore table ssl\n```\npython-cassandra-cli restore-snapshot-table  \n  -sf 1608700346_snapshots_tag-01-table_my_table_develop \n  -t tag-01-table \n  -k my_keyspace \n  -tn my_table \n  -h \"10.99.3.55\" \n  --ssm-secret \n  -s3 my.s3.bucket \n  -sn /cassandra/dev \n  -cf /etc/cassandra/conf/cassandra.yaml  \n  -ks /etc/cassandra/conf/keystore.node0 \n  -ts /etc/cassandra/conf/truststore.node0 \n  -ssl \n  -pt 9142 \n```\n### Restore keyspace ssl with keyspace creation\n```\npython-cassandra-cli restore-snapshot-keyspace  \n  -sf 608700346_snapshots_tag-01-keyspace_my_keyspace_develop \n  -t tag-01-keyspace \n  -k my_keyspace  \n  -h \"10.99.3.55\" \n  --ssm-secret \n  -s3 my.s3.bucket \n  -sn /cassandra/dev \n  --create-keyspace-schema \n  -e develop \n  -cf /etc/cassandra/conf/cassandra.yaml  \n  -ks /etc/cassandra/conf/keystore.node0 \n  -ts /etc/cassandra/conf/truststore.node0 \n  -ssl \n  -pt 9142 \n```\n### Copy folder with sanpshot on local\n```\npython-cassandra-cli copy-snapshot-folder \n  -s3 my.s3.bucket \n  -sf 1608700346_snapshots_tag-01-keyspace_my_keyspace_develop\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python CLI for cassandra snapshots. CLI allows to store and restore snapshot and uses AWS S3 bucket as storage.",
    "version": "1.4.0",
    "split_keywords": [
        "snapshot",
        "python",
        "package",
        "cassandra",
        "backup",
        "migration"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e04b5e2dd752517a5aac8f0245f501898101f1ce3f7b295e4ff8db2202a40ae6",
                "md5": "68c6e1722ca6b677fa480ec317a8a07f",
                "sha256": "e2f8c4a032ca8e7a2359abdb67401907cc69468b1900cb257aa8be506bff107d"
            },
            "downloads": -1,
            "filename": "python_cassandra_cli-1.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "68c6e1722ca6b677fa480ec317a8a07f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 22320,
            "upload_time": "2023-02-07T03:33:21",
            "upload_time_iso_8601": "2023-02-07T03:33:21.006595Z",
            "url": "https://files.pythonhosted.org/packages/e0/4b/5e2dd752517a5aac8f0245f501898101f1ce3f7b295e4ff8db2202a40ae6/python_cassandra_cli-1.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20b8d40f862d6d21bde4af90b78e84c3a68cf33cfa5ef6e43300837acab2bd69",
                "md5": "31c6f3dec397f3943456e056dae9d736",
                "sha256": "6734e07dcfc75d5bcbb2c974cb3fe0dd510d4dbbe76b398974d19b1fc498cf5f"
            },
            "downloads": -1,
            "filename": "python-cassandra-cli-1.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "31c6f3dec397f3943456e056dae9d736",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 13616,
            "upload_time": "2023-02-07T03:33:22",
            "upload_time_iso_8601": "2023-02-07T03:33:22.706413Z",
            "url": "https://files.pythonhosted.org/packages/20/b8/d40f862d6d21bde4af90b78e84c3a68cf33cfa5ef6e43300837acab2bd69/python-cassandra-cli-1.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-07 03:33:22",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "python-cassandra-cli"
}
        
Elapsed time: 0.04372s