Giter VIP home page Giter VIP logo

aip_snapshotcleaner's Introduction

AIP Snapshot Cleaner

This script can be used to cleanup older snapshots in CAST AIP. Snapshots are cleaned up based on the retention criteria specified in the resources/AIPCleaner.yaml file.

Prerequisites

The script is written in Python. Ensure that you have Python 3.6 or above installed. It uses the following Python packages. Ensure these are installed using the Python PIP command. PIP installs dependent packages, where needed.

From this project root directory:

pip install -r requirements.txt

Refer to Installing Python Modules webpage for more information on how to install Python modules.

First time setup

  1. Copy the files and folder into a folder named AIP_SnapshotCleaner.
  2. Create a blank folder named logs in the newly created folder.
  3. Edit the AIPCleaner.YAML file in the resources file and setup the retention criteria as needed. See for details.

Snapshot retention criteria and other settings:

At this time, the script support the following retention criterias:

  • M - Retain monthly snapshots
  • Q - Retain quarterly snapshots
  • Y - Retain yearly snapshots

Setup the retention criteria as follows, for example, to retain monthly snapshots for the current year, quarterly snapshots for the prior year and yearly snapshots for the rest of the years.

retention_policy:
  current_year: M
  prev_year: Q
  other_years: Y

Use the following option to ensure that the latest N number of snapshots are always kept:
  keep_latest_n_snapshots: 5

Additionally, use the following option to retain baseline snapshots:
  keep_baseline: true

Other settings

Update the AAD URL, credentials, name and location of the CAST-MS PMX file, log folder location and CAST installation folder location.

Before running cleanup

The script deletes the snapshots that match the criteria specified, using the CAST-MS CLI command. This causes snapshots to be dropped from the dashboard service schema for each of the apps. So before running cleanup each time, ensure that the dashboard service schema is backed up.

How to run the cleanup script

The script can by running by invoking python and passing in the name of the script as an argument. Before starting, change directoy to move to the script folder.

python AIPSnapshotCleaner.py - This will invoke the script in a display only mode, where it does not delete snapshots, but will display which snapshots will be dropped. To drop outdated snapshots, invoke the script with a -drop argument as in: python AIPSnapshotCleaner.py -drop

๐Ÿ‘‰ NOTE: Ensure that the id being used for connecting to AAD (the username specified in the dashboard section in the YAML file) has admin rights to the HD dashboard. Else, some actions will fail.

aip_snapshotcleaner's People

Contributors

guru-cast avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.