Higher level ceph_command
Returns the list of available commands
Returns an enum value of:
CephHealth::Ok
CephHealth::Warning
CephHealth::Error
string with the health HEALTH_OK or HEALTH_WARN or HEALTH_ERR which is also not efficient.
Mon command that does not pass in a data payload.
Mon command that does pass in a data payload.
Most all of the commands pass through this function.
OSD command that does not pass in a data payload.
OSD command that does pass in a data payload.
PG command that does not pass in a data payload.
PG command that does pass in a data payload.
Only single String value
Ceph version - Ceph during the make release process generates the version number along with
the github hash of the release and embeds the hard coded value into ceph.py which is the
the default ceph utility.
This version call parses the ceph -s output. It does not need sudo rights like
ceph_version does since it pulls from the admin socket.
Connect to a Ceph cluster and return a connection handle rados_t
This just tells librados that you no longer need to use the io context.
It may not be freed immediately if there are pending asynchronous requests on it, but you
should not use an io context again after calling this function on it.
This does not guarantee any asynchronous writes have completed. You must call rados_aio_flush()
on the io context before destroying it to do that.
Disconnect from a Ceph cluster and destroy the connection handle rados_t
For clean up, this is only necessary after connect_to_ceph() has succeeded.
Create an io context. The io context allows you to perform operations within a particular pool.
For more details see rados_ioctx_t.
Create an io context. The io context allows you to perform operations within a particular pool.
For more details see rados_ioctx_t.
Ping a monitor to assess liveness
May be used as a simply way to assess liveness, or to obtain
information about the monitor in a simple way even in the
absence of quorum.
Create a pool with default settings
The default owner is the admin user (auid 0). The default crush rule is rule 0.
Delete a pool and all data inside it
The pool is removed from the cluster immediately, but the actual data is deleted in
the background.
Return the version of the last object read or written to.
This exposes the internal version number of the last object read or written via this io context
Get the pool name of the io context
Get the rados_xattrs_iter_t reference to iterate over xattrs on an object
Used in conjuction with XAttr::new() to iterate.
Get the version of librados.
Start listing objects in a pool
Set the key for mapping objects to pgs within an io context.
Lookup a Ceph pool id. If the pool doesn’t exist it will return Ok(None).
Append len bytes from buf into the oid object.
List clients that have locked the named object lock and information about the lock.
The number of bytes required in each buffer is put in the corresponding size out parameter.
If any of the provided buffers are too short, -ERANGE is returned after these sizes are filled in.
Releases a shared or exclusive lock on an object, which was taken by the specified client.
Efficiently copy a portion of one object to another
If the underlying filesystem on the OSD supports it, this will be a copy-on-write clone.
The src and dest objects must be in the same pg. To ensure this, the io context should
have a locator key set (see rados_ioctx_locator_set_key()).
Execute an OSD class method on an object
The OSD has a plugin mechanism for performing complicated operations on an object atomically.
These plugins are called classes. This function allows librados users to call the custom
methods. The input and output formats are defined by the class. Classes in ceph.git can
be found in src/cls subdirectories
Get the pool id of the io context
Get the value of an extended attribute on an object.
Take an exclusive lock on an object.
Take a shared lock on an object.
Sychronously notify watchers of an object
This blocks until all watchers of the object have received and reacted to the notify, or a timeout is reached.
Acknolwedge receipt of a notify
Read data from an object. This fills the slice given and returns the amount of bytes read
The io context determines the snapshot to read from, if any was set by
rados_ioctx_snap_set_read().
Default read size is 64K unless you call Vec::with_capacity(1024*128) with a larger size.
Delete an object
Note: This does not delete any snapshots of the object.
Delete an extended attribute from an object.
Set allocation hint for an object
This is an advisory operation, it will always succeed (as if it was submitted with a
LIBRADOS_OP_FLAG_FAILOK flag set) and is not guaranteed to do anything on the backend.
Set an extended attribute on an object.
Get object stats (size,SystemTime)
Fetch complete tmap (trivial map) object
Update tmap (trivial map)
Resize an object
If this enlarges the object, the new area is logically filled with zeroes.
If this shrinks the object, the excess data is removed.
Release a shared or exclusive lock on an object.
Write len bytes from buf into the oid object, starting at offset off.
The value of len must be <= UINT_MAX/2.
The object is filled with the provided data. If the object exists, it is atomically
truncated and then written.
Get the alignment flavor of a pool
Test whether the specified pool requires alignment or not.
Returns back a collection of Rados Pools
Allocate an ID for a self-managed snapshot
Get a unique ID to put in the snaphot context to create a snapshot.
A clone of an object is not created until a write with the new snapshot context is completed.
Remove a self-managed snapshot
This increases the snapshot sequence number, which will cause snapshots to be removed lazily.
Rollback an object to a self-managed snapshot
The contents of the object will be the same as when the snapshot was taken.
Set the namespace for objects within an io context
The namespace specification further refines a pool into different domains.
The mapping of objects to pgs is also based on this value.
Create a pool-wide snapshot
Get the name of a pool snapshot
Find when a pool snapshot occurred
Set the snapshot context for use when writing to objects
This is stored in the io context, and applies to all future writes.
List all the ids of pool snapshots
Get the id of a pool snapshot
Delete a pool snapshot
Rollback an object to a pool snapshot
The contents of the object will be the same as when the snapshot was taken.
Set the snapshot from which reads are performed.
Subsequent reads will return data as it was at the time of that snapshot.
Read usage info about the cluster
This tells you total space, space used, space available, and number of objects.
These are not updated immediately when data is written, they are eventually consistent.