summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.version1
-rw-r--r--Makefile43
-rw-r--r--README.md23
-rw-r--r--README.txt35
-rw-r--r--docs/fapi.1171
-rw-r--r--docs/fapi.pod42
-rw-r--r--docs/fapi.txt35
-rwxr-xr-xsrc/fapi (renamed from src/fapi.py)0
8 files changed, 325 insertions, 25 deletions
diff --git a/.version b/.version
new file mode 100644
index 0000000..77d6f4c
--- /dev/null
+++ b/.version
@@ -0,0 +1 @@
+0.0.0
diff --git a/Makefile b/Makefile
index 2fb361a..9c6f29e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,41 @@
-all:
- @echo Not yet implemented
+NAME=fapi
+all: version documentation build
+build:
+ test ! -d bin && mkdir bin || exit 0
+ cp -p ./src/$(NAME) bin/$(NAME)
+ sed -i "s/VERSION_DEVEL/$$(cat .version)/" bin/$(NAME)
+# 'install' installes a fake-root, which will be used to build the Debian package
+# $DESTDIR is actually set by the Debian tools.
+install:
+ test ! -d $(DESTDIR)/usr/bin && mkdir -p $(DESTDIR)/usr/bin || exit 0
+ cp ./bin/fapi $(DESTDIR)/usr/bin/fapi
+ cp ./bin/fapi $(DESTDIR)/usr/bin/f
+deinstall:
+ test ! -z "$(DESTDIR)" && test -f $(DESTDIR)/usr/bin/$(NAME) && rm $(DESTDIR)/usr/bin/$(NAME) || exit 0
+clean:
+ rm bin/*
+# Parses the version out of the Debian changelog
+version:
+ cut -d' ' -f2 debian/changelog | head -n 1 | sed 's/(//;s/)//' > .version
+# Builds the documentation into a manpage
+documentation:
+ # To be replaced with sphynx instead of pod
+ pod2man --release="$(NAME) $$(cat .version)" \
+ --center="User Commands" ./docs/$(NAME).pod > ./docs/$(NAME).1
+ pod2text ./docs/$(NAME).pod | tee ./docs/$(NAME).txt > README.txt
+# Build a debian package (don't sign it, modify the arguments if you want to sign it)
+deb: all
+ dpkg-buildpackage -uc -us
+dch:
+ dch -i
+release: dch deb
+ bash -c "git tag $$(cat .version)"
+ git push --tags
+ git commit -a -m 'New release'
+ git push origin master
+clean-top:
+ rm ../$(NAME)_*.tar.gz
+ rm ../$(NAME)_*.dsc
+ rm ../$(NAME)_*.changes
+ rm ../$(NAME)_*.deb
+
diff --git a/README.md b/README.md
deleted file mode 100644
index 9dd719b..0000000
--- a/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-fapi
-====
-
-This might be a clone of http://github.com/rantanplan/fapi
-
-This is a simple command line client to do basic stuff with the iControl F5 API such as:
-
-* Managing Nodes
-* Managing Monitors
-* Managing Pools
-* Managing Virtual Servers
-
-todo
-====
-
-* Write documentation including examples
-* Support a Debian Package
-
-
-This is the reference of iControl:
-
-https://devcentral.f5.com/wiki/icontrol.apireference.ashx
-
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..b77b18f
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,35 @@
+NAME
+ fapi - A humble command line tool to manage F5 BigIP loadbalancers
+
+ This is a simple command line client to do basic stuff with the iControl
+ F5 API such as:
+
+ Managing Nodes
+ Managing Monitors
+ Managing Pools
+ Managing Virtual Servers
+
+Synopsis
+ Just run
+
+ fapi -h
+
+ or
+
+ f -h
+
+ because it's shorter to type.
+
+Requirement of bigsuds
+ This tool depends on bigsuds. Please install this library from F5 dev
+ central manually. Otherwise this script will not work.
+
+iControl reference
+ <https://devcentral.f5.com/wiki/icontrol.apireference.ashx>
+
+Project Homepage
+ See <http://japi.buetow.org>
+
+AUTHOR
+ Paul C. Buetow - <paul@buetow.org>
+
diff --git a/docs/fapi.1 b/docs/fapi.1
new file mode 100644
index 0000000..923ba11
--- /dev/null
+++ b/docs/fapi.1
@@ -0,0 +1,171 @@
+.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "FAPI 1"
+.TH FAPI 1 "2014-04-15" "fapi 0.0.0" "User Commands"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+fapi \- A humble command line tool to manage F5 BigIP loadbalancers
+.PP
+This is a simple command line client to do basic stuff with the iControl F5 API
+such as:
+.PP
+.Vb 4
+\& Managing Nodes
+\& Managing Monitors
+\& Managing Pools
+\& Managing Virtual Servers
+.Ve
+.SH "Synopsis"
+.IX Header "Synopsis"
+Just run
+.PP
+.Vb 1
+\& fapi \-h
+.Ve
+.PP
+or
+.PP
+.Vb 1
+\& f \-h
+.Ve
+.PP
+because it's shorter to type.
+.SH "Requirement of bigsuds"
+.IX Header "Requirement of bigsuds"
+This tool depends on bigsuds. Please install this library from F5 dev central
+manually. Otherwise this script will not work.
+.SH "iControl reference"
+.IX Header "iControl reference"
+<https://devcentral.f5.com/wiki/icontrol.apireference.ashx>
+.SH "Project Homepage"
+.IX Header "Project Homepage"
+See <http://japi.buetow.org>
+.SH "AUTHOR"
+.IX Header "AUTHOR"
+Paul C. Buetow \- <paul@buetow.org>
diff --git a/docs/fapi.pod b/docs/fapi.pod
new file mode 100644
index 0000000..9138771
--- /dev/null
+++ b/docs/fapi.pod
@@ -0,0 +1,42 @@
+=head1 NAME
+
+fapi - A humble command line tool to manage F5 BigIP loadbalancers
+
+This is a simple command line client to do basic stuff with the iControl F5 API
+such as:
+
+ Managing Nodes
+ Managing Monitors
+ Managing Pools
+ Managing Virtual Servers
+
+=head1 Synopsis
+
+Just run
+
+ fapi -h
+
+or
+
+ f -h
+
+because it's shorter to type.
+
+=head1 Requirement of bigsuds
+
+This tool depends on bigsuds. Please install this library from F5 dev central
+manually. Otherwise this script will not work.
+
+=head1 iControl reference
+
+L<https://devcentral.f5.com/wiki/icontrol.apireference.ashx>
+
+=head1 Project Homepage
+
+See L<http://japi.buetow.org>
+
+=head1 AUTHOR
+
+Paul C. Buetow - <paul@buetow.org>
+
+=cut
diff --git a/docs/fapi.txt b/docs/fapi.txt
new file mode 100644
index 0000000..b77b18f
--- /dev/null
+++ b/docs/fapi.txt
@@ -0,0 +1,35 @@
+NAME
+ fapi - A humble command line tool to manage F5 BigIP loadbalancers
+
+ This is a simple command line client to do basic stuff with the iControl
+ F5 API such as:
+
+ Managing Nodes
+ Managing Monitors
+ Managing Pools
+ Managing Virtual Servers
+
+Synopsis
+ Just run
+
+ fapi -h
+
+ or
+
+ f -h
+
+ because it's shorter to type.
+
+Requirement of bigsuds
+ This tool depends on bigsuds. Please install this library from F5 dev
+ central manually. Otherwise this script will not work.
+
+iControl reference
+ <https://devcentral.f5.com/wiki/icontrol.apireference.ashx>
+
+Project Homepage
+ See <http://japi.buetow.org>
+
+AUTHOR
+ Paul C. Buetow - <paul@buetow.org>
+
diff --git a/src/fapi.py b/src/fapi
index 6b67323..6b67323 100755
--- a/src/fapi.py
+++ b/src/fapi