def info(name=None): cmd = VOLUME_CMD + ["info"] + ([name] if name else []) data = utils.execute_and_output(cmd, _parseinfo) if name and not data: raise GlusterCliFailure("Volume %s does not exist" % name) return data
def create(volName, snapName, description="", force=False, activate_snapshot=False): cmd = SNAPSHOT_CMD + ["create", snapName, volName] if description != "": cmd += ["description", str(description)] if force: cmd += ["force"] # If volume needs to be started, then run create command without # decorator else return create command and statuszerotrue # decorator will take care of running cmd data = utils.execute_and_output(cmd, _parseCreateOutput) if activate_snapshot: if not data: raise GlusterCliFailure("Snapshot not created %s does not exist" % snapName) # utils.checkstatuszero(cmd) else: activate(data) else: utils.checkstatuszero(cmd) return data
def info(): cmd = POOL_CMD + ["list"] return utils.execute_and_output(cmd, _parsepoollist)