install -m 755 lib/lxcf-export-docker $(DESTDIR)$(libdir)/lxcf/lxcf-export-docker
install -m 755 lib/lxcf-distro $(DESTDIR)$(libdir)/lxcf/lxcf-distro
install -m 755 lib/lxcf-rename $(DESTDIR)$(libdir)/lxcf/lxcf-rename
- install -m 755 lib/lxcf-pull $(DESTDIR)$(libdir)/lxcf/lxcf-pull
+ install -m 755 lib/lxcf-snapshot-pull $(DESTDIR)$(libdir)/lxcf/lxcf-snapshot-pull
install_sbin_lxcf: .prepare
install -d -m 755 $(DESTDIR)$(sbindir)
install -m 755 cmd/rename $(DESTDIR)$(libdir)/lxcf/sbin/rename
install -m 755 cmd/api $(DESTDIR)$(libdir)/lxcf/sbin/api
install -m 755 cmd/api-passwd $(DESTDIR)$(libdir)/lxcf/sbin/api-passwd
- install -m 755 cmd/pull $(DESTDIR)$(libdir)/lxcf/sbin/pull
+ install -m 755 cmd/snapshot-pull $(DESTDIR)$(libdir)/lxcf/sbin/snapshot-pull
install_conf: .prepare
install -m 644 conf/helpfile.txt $(DESTDIR)$(libdir)/lxcf/helpfile.txt
exit 1
fi
-/usr/lib64/lxcf/lxcf-pull $*
+/usr/lib64/lxcf/lxcf-snapshot-pull $*
exit $?
snapshot [ -f ] [ -p PATH ] [ -n SNAPSHOT_IMAGE ] (UUID | NAME)...
restore [ -f ] [ -s ] [ -p PATH ] SNAPSHOT_IMAGE
- pull [ -f ] [ -s ] [ -p PASSWORD ] [ -n NEW_SNAP_NAME ] SERVER_NAME:PORT SNAPSHOT_NAME
+ snapshot-pull [ -f ] [ -s ] [ -p PASSWORD ] [ -n NEW_SNAP_NAME ] SERVER_NAME:PORT SNAPSHOT_NAME
- snapshot-list [ -p PASSWORD ] [ -n SERVERNAME:PORT ] [ SNAPSHOT_IMAGE ... ]
+ snapshot-list [ -p PASSWORD ] [ -i SERVERNAME:PORT ] [ SNAPSHOT_IMAGE ... ]
snapshot-erase [ -f ] SNAPSHOT_IMAGE ...
*** REST API ***
.B lxcf restore [ -f ] [ -s ] [-p PATH ] SNAPSHOT_IMAGE
-.B lxcf pull [ -f ] [ -s ] [ -p PASSWORD ] [ -n NEW_SNAP_NAME ] SERVER_NAME:PORT SNAPSHOT_NAME
+.B lxcf snapshot-pull [ -f ] [ -s ] [ -p PASSWORD ] [ -n NEW_SNAP_NAME ] SERVER_NAME:PORT SNAPSHOT_NAME
-.B lxcf snapshot-list [ -p PASSWORD ] [ -n SERVERNAME:PORT ] [ SNAPSHOT_IMAGE ... ]
+.B lxcf snapshot-list [ -p PASSWORD ] [ -i SERVERNAME:PORT ] [ SNAPSHOT_IMAGE ... ]
.B lxcf snapshot-erase [ -f ] SNAPSHOT_IMAGE ...
fi
# check options
-FLG_N=0 ; HOSTNAME=""
+FLG_I=0 ; HOSTNAME=""
FLG_P=0 ; PASSWORD=""
-while getopts n:p: OPT ; do
+while getopts i:p: OPT ; do
case $OPT in
- n) FLG_N=1 ; HOSTNAME=$OPTARG ;;
+ n) FLG_I=1 ; HOSTNAME=$OPTARG ;;
p) FLG_P=1 ; PASSWORD=$OPTARG ;;
esac
done
PROXYARGS=${PROXYARGS}" --noproxy "$NOPROXY
fi
-if [ $FLG_N -eq 1 ]; then
+if [ $FLG_I -eq 1 ]; then
if [ $# -gt 0 ]; then
ARG=`echo $* | sed 's% %/%g'`
fi
# check args
if [ $# -ne 2 ]; then
- echo "usage lxcf pull [ -f ] [ -s ] [ -p PASSWORD ] [ -n NEW_SNAP_NAME ] SERVER_NAME:PORT SNAPSHOT_NAME"
+ echo "usage lxcf snapshot-pull [ -f ] [ -s ] [ -p PASSWORD ] [ -n NEW_SNAP_NAME ] SERVER_NAME:PORT SNAPSHOT_NAME"
exit 1
fi
pushd /opt/lxcf_rep >& /dev/null
RESULT=`curl $PROXYARGS -# $SILENT -F "password=\'${PASSWORD}\'" \
- -o $NEWNAME http://${SERVERNAME}/lxcfv1/pull_data/${SNAPNAME} | \
+ -o $NEWNAME http://${SERVERNAME}/lxcfv1/snapshot-pull-data/${SNAPNAME} | \
awk 'BEGIN{f=1}{if ($0~/pre/){f=f*(-1)}else if (f == -1) print}'`
RESNO=`echo $RESULT | awk '{print $1}' | awk -F '=' '{print $2}'`
def __init__(self, callcmd):
super(api_version, self).__init__(callcmd)
-# API: pull_data from repository
-class api_pull_data(api_common):
+
+# API: snapshot-pull-data from repository
+class api_snapshot_pull_data(api_common):
def __init__(self):
self.messages = "no operation"
self.status = 0
check = (1, "error: argument is mistaken.")
elif (check_passwd(password)):
if (sanity_check(cmdline[1])):
- check = (0, "OK pull_data "+cmdline[1])
+ check = (0, "OK snapshot-pull-data "+cmdline[1])
else:
errorflg = 1
check = (255, "error: sanity error ... "+cmdline[1])
try:
fp = open(file_path,'rb')
self.status = 0
- self.messages = "Pull succeeded. "
+ self.messages = "snapshot-pull-data succeeded. "
start_response('200 OK', [('Content-Disposition', \
'inline; filename="' + file_name + '"'), \
('Content-Length', file_size), \
return self.common_response(environ, start_response, errorflg, result)
-# API: pull
-def call_pull(cmdline):
- cmdstr = "pull -s "
+# API: snapshot-pull
+def call_snapshot_pull(cmdline):
+ cmdstr = "snapshot-pull"
for str in cmdline:
cmdstr = cmdstr + " " + str
return cmdstr
-class api_pull(api_common):
+class api_snapshot_pull(api_common):
def __init__(self, callcmd):
- super(api_pull, self).__init__(callcmd)
-
+ super(api_snapshot_pull, self).__init__(callcmd)
'/lxcfv1/sysgen':api_common.api_sysgen(api_common.call_sysgen), \
'/lxcfv1/sysgen-n':api_common.api_sysgen_n(api_common.call_sysgen_n), \
'/lxcfv1/version':api_common.api_version(api_common.call_version), \
-'/lxcfv1/pull_data':api_common.api_pull_data(), \
-'/lxcfv1/pull':api_common.api_pull(api_common.call_pull), \
+'/lxcfv1/snapshot-pull-data':api_common.api_snapshot_pull_data(), \
+'/lxcfv1/snapshot-pull':api_common.api_snapshot_pull(api_common.call_snapshot_pull), \
}
class ThreadingWsgiServer(ThreadingMixIn, WSGIServer):