Skip to main content
= GlusterCLI - Python bindings for GlusterFS Commands


== Gluster CLI instance.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

# With default Options
gcli = GlusterCLI()

# With custom gluster executable path
gcli = GlusterCLI(exec_path="/usr/local/sbin/gluster")

# Set Current Host to replace `localhost` in Peers list output
gcli = GlusterCLI(current_host="server1.kadalu")

# Set Glusterd socket Path
gcli = GlusterCLI(
exec_path="/usr/local/sbin/gluster",
current_host="server1.kadalu",
socket_path="/usr/local/var/run/glusterd.sock"
)
----


== Peer Add/Probe

Add a Peer to Cluster.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.add_peer("server2.kadalu")
----


== Volume Create

Create a Volume.

Example:

[source,python]
----
from glustercli2 import GlusterCLI, VolumeCreateOptions

gcli = GlusterCLI()
opts = VolumeCreateOptions()
opts.replica_count = 3
opts.force = True

bricks = [
"server1.kadalu:/bricks/gvol1/brick1/brick",
"server2.kadalu:/bricks/gvol1/brick2/brick",
"server3.kadalu:/bricks/gvol1/brick3/brick"
]

gcli.create_volume("gvol1", bricks, opts)
----


== Peers List

List Peers available.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.list_peers()
----


== Volumes List and Status

List Volumes available.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.list_volumes()
gcli.list_volumes(status=True)
----


== Get Peer instance.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.peer("server2.kadalu")
----


== Docker exec

Set Remote plugin as docker and set the container name

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.set_container_name("server1.kadalu")
----


== Execute over SSH

Set Remote plugin as ssh and set the SSH parameters

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.set_ssh_params(
"remote1.kadalu",
port=22,
user="root",
key="/root/.ssh/id_rsa",
use_sudo=False
)
----


== GlusterFS Version

Return the GlusterFS version

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
print(gcli.version())
----


== Get Volume instance.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.volume("gvol1")
----


== Volume Delete

Delete the Volume.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.volume("gvol1").delete()
----


== Volume Info and Status

Get Volume info or Status.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.volume("gvol1").info()
gcli.volume("gvol1").info(status=True)
----


== Reset Volume Option

Reset Volume Option.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.volume("gvol1").option_reset(["changelog.changelog"])
----


== Set Volume Option

Set Volume Option.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.volume("gvol1").option_set({
"changelog.changelog": "on"
})
----


== Volume Start

Start the Volume.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.volume("gvol1").start()

# or using force option
gcli.volume("gvol1").start(force=True)
----


== Volume Stop

Stop the Volume.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.volume("gvol1").stop()

# or using force option
gcli.volume("gvol1").stop(force=True)
----


== Peer Delete/Detach

Delete or Detach a Peer from Cluster.

Example:

[source,python]
----
from glustercli2 import GlusterCLI

gcli = GlusterCLI()
gcli.peer("server2.kadalu").delete()
----

Metadata

Release files for glustercli2 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glustercli2 0.3.0
File Size Uploaded
glustercli2-0.3.0.tar.gz 9.4 kB Details

Release files / glustercli2-0.3.0.tar.gz

Download URL glustercli2-0.3.0.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
270197be6473db189282d3c9cbf78f377396605d3133aacacd67ac309bad9a50
BLAKE2b-256 checksum
How to use checksums
76c1dbc6bee87f509c49e5a2bb9a5df38082f570f3b24024a9b6e6150775edd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page