Last active
August 29, 2015 14:06
-
-
Save premkumr/f3b590d7c6eb195a1c65 to your computer and use it in GitHub Desktop.
prems ipython init.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import sys | |
import time | |
import requests | |
FDSSOURCEDIR="/home/premkumar/repos/fds-src/source" | |
sys.path.append('/home/premkumar/bin') | |
sys.path.append(FDSSOURCEDIR + '/test/fdslib') | |
sys.path.append(FDSSOURCEDIR + '/test/fdslib/pyfdsp') | |
import fdstest | |
fds=fdstest.Api() | |
smoke=fds.getBucket('smoke_volume0') | |
bucket=fds.getBucket('fds_test_bucket') | |
from SvcHandle import SvcMap | |
import pyfdsp.snapshot.ttypes as snapshot | |
om=None | |
def initOm(): | |
global om | |
try: | |
svc_map = SvcMap("127.0.0.1", 7020) | |
om = svc_map.omConfig() | |
except: | |
print "[WARN] ... error initing om connection .. try later with initOm()" | |
ssp = snapshot.SnapshotPolicy(policyName='test', retentionTimeSeconds=0, id=None, recurrenceRule='FREQ=MINUTELY;INTERVAL=1') | |
initOm() | |
def testsnap(): | |
global bucket | |
global om | |
bucket.create() | |
initOm() | |
bucket.put('a','b') | |
om.createSnapshotPolicy(ssp) | |
om.attachSnapshotPolicy(om.getVolumeId('fds_test_bucket'), 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment