Enable Catalog

Enable Catalog#

This example enables the Catalog using the vastpy library.

!pip install --quiet vastpy
VMS_HOST='10.91.7.204'
VMS_USER='admin'
VMS_PASS='123456'
from vastpy import VASTClient
import pprint


client = VASTClient(user=VMS_USER, password=VMS_PASS, address=VMS_HOST)

try:
    configs = client.bigcatalogconfig.get()
    for config in configs:
        data = {
            "frames": [
                {
                    "every": "15m",
                    "every_value": "15m",
                    "every_unit": "m",
                    "start-at": config['frames'][0]['start-at'],
                    "keep-local": "2H",
                    "keep-remote": "15m",
                    "local-period": "H",
                    "remote-period": "m"
                }
            ],
            "enable": True
        }
        response = client.bigcatalogconfig[config['id']].request(method='PATCH', data=data)
        print("Updated Big Catalog config")
        pprint.pp(response)
except Exception as e:
    print("Error enabling BigCatalog")
    print(e)
{'id': 1,
 'name': 'Vast Catalog Policy',
 'frames': [{'every': '30m',
             'start-at': '2024-06-10 22:11:08',
             'keep-local': '1H',
             'keep-remote': '30m'}],
 'prefix': 'big_catalog',
 'enable': True,
 'state': 'working',
 'clone_type': 'LOCAL',
 'big_catalog': True,
 'splits': 2}