Skip to main content

REST API for confluence

Project description

Simple python script to use a Atlassian Confluence Wiki via the CLI.

Usage

$ python confluence.py --help
usage: confluence.py [-h] -w WIKIURL -u USERNAME -p PASSWORD
                     {addpage,updatepage,copypage,listpages,removepage,getpagecontent,getpagesummary,getpagesource,getattachments,getattachment,listspaces,addspace,removespace,adduser,removeuser,deactivateuser,reactivateuser,changeuserpassword,addgroup,removegroup,listgroups,listusers,getallpages,addusertogroup,removeusergromgroup,listusergroups,pagesbylabel}
                     ...

Confluence wiki API

positional arguments:
  {addpage,updatepage,copypage,listpages,removepage,getpagecontent,getpagesummary,getpagesource,getattachments,getattachment,listspaces,addspace,removespace,adduser,removeuser,deactivateuser,reactivateuser,changeuserpassword,addgroup,removegroup,listgroups,listusers,getallpages,addusertogroup,removeusergromgroup,listusergroups,pagesbylabel}
    addpage             Add a page
    copypage            Copies a page
    updatepage          Update a page
    listpages           List pages in one or all spaces
    removepage          Remove a page
    getpagecontent      Get page content
    getpagesource       Get page source
    getpagesummary      Get page summary
    getattachments      Get a list of all attachments
    getattachment       Get a specific attachment
    listspaces          List all spaces
    addspace            Add a space
    removespace         Remove a space
    adduser             Add a user
    removeuser          Remove a user
    deactivateuser      Deactivate a user
    reactivateuser      Reactivate a user
    changeuserpassword  Change user password
    addgroup            Add a goup
    removegroup         Remove a goup
    listgroups          List all goup
    listusers           List all users
    getallpages         Save all pages to local files.
    addusertogroup      Add user to a group
    removeusergromgroup
                        Remove user from a group
    listusergroups      List groups user is in
    pagesbylabel        Pages by Label

optional arguments:
  -h, --help            show this help message and exit
  -w WIKIURL, --wikiurl WIKIURL
                        Wiki URL (only FQDN, no / and such)
  -u USERNAME, --username USERNAME
                        Login Username
  -p PASSWORD, --password PASSWORD
                        Login Password

Examples

Add page:

$ ./confluence.py --wikiurl="http://wiki.raymii.org" -u "api" -p "" addpage -f ./content.txt -n "CLI New Page" -s "RAY"
http://wiki.raymii.org/display/RAY/CLI+New+Page

Remove Page:

$ ./confluence.py --wikiurl="http://wiki.raymii.org" -u "api" -p "" removepage -n "CLI New Page" -s "RAY"

Update Page:

$ ./confluence.py --wikiurl="http://wiki.raymii.org" -u "api" -p "" updatepage -f ./content.txt -n "CLI New Page" -s "RAY"
http://wiki.raymii.org/display/RAY/CLI+New+Page

Get page content (HTML):

$ ./confluence.py --wikiurl="http://wiki.raymii.org" -u "api" -p "" getpagecontent -n "CLI New Page" -s "RAY"
<h1>Table of Contents</h1>
<p><ac:macro ac:name="toc" /></p>
<h1>Information</h1>

Add Space:

./confluence.py --wikiurl="http://wiki.raymii.org" -u "api" -p "" addspace -n "New Space" -s "NS"

Remove Space:

./confluence.py --wikiurl="http://wiki.raymii.org" -u "api" -p "" removespace -s "NS"

List all spaces:

$ ./confluence.py --wikiurl="http://wiki.raymii.org" -u "api" -p "" listspaces
NS, New Space, http://wiki.raymii.org/display/NS
ITS, IT Staff, http://wiki.raymii.org/display/ITS

Add user:

$ ./confluence.py --wikiurl="http://wiki.raymii.org" -u "api" -p "" adduser -U "newuser" -N "New user" -E "newuser@raymii.org" -X "password"

Remove user:

$ ./confluence.py --wikiurl="http://wiki.raymii.org" -u "api" -p "" removeuser -U newuser

Deactivate user:

$ ./confluence.py --wikiurl="http://wiki.raymii.org" -u "api" -p "" deactivateuser -U newuser

Reactivate user:

$ ./confluence.py --wikiurl="http://wiki.raymii.org" -u "api" -p "" reactivateuser -U newuser

For more actions, run ./confluence.py -h or see the usage section above.

More info

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

confluence_python_cli-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

File details

Details for the file confluence_python_cli-0.1.0.tar.gz.

File metadata

File hashes

Hashes for confluence_python_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8b35d5eefd023b46b06ded46dc2cd786a4907bf471cc5344c6dd7bb900d6e298
MD5 2c5376a380db5b4cb4368079e7b1ea33
BLAKE2b-256 e982381d34dcca493b35ac0c3b09c44fa17fbc329785401e0fd19dd4e7d68f72

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page