bemgr-1 - This API provides functionality for getting information about Boot Environments(BE) on the system.
#include <rad/client/1/bemgr.h>
cc [ flag... ] file... -lbemgr1_client [ library... ]
interface BootEnv
const char * name ; (ro)
const char * fmri ; (ro)
boolean_t active ; (ro)
boolean_t activeOnBoot ; (ro)
boolean_t * activeUnbootable ; (ro)
boolean_t mounted ; (ro)
const char * mountpoint ; (ro)
unsigned long long spaceUsed ; (ro)
const rc_instance_t * rootDataset ; (ro)
const rc_instance_t ** datasets ; (ro)
const rc_instance_t ** snapshots ; (ro)
const char * zpool ; (ro)
const char * uuid ; (ro)
const char * policy ; (ro)
const rc_instance_t * parentBE ; (ro)
const rc_instance_t ** childBEs ; (ro)
int creation ; (ro)
unsigned long long pool_version ; (ro)
interface BEDataset
const char * name ; (ro)
const char * mountpoint ; (ro)
int creation ; (ro)
unsigned long long spaceUsed ; (ro)
interface BESnapshot
const char * name ; (ro)
int creation ; (ro)
unsigned long long spaceUsed ; (ro)
interface BEManager
rc_err_t bemgr_BEManager_getActiveBE(rc_instance_t *inst,
rc_instance_t **result,
bemgr_BeMgrRadError_t **error);
rc_err_t bemgr_BEManager_getActiveOnBootBE(rc_instance_t *inst,
const char *zpool,
rc_instance_t **result,
bemgr_BeMgrRadError_t **error);
rc_err_t bemgr_BEManager_getActiveOnBootZBE(rc_instance_t *inst,
const char *zonename,
const char *gzbe_fmri,
rc_instance_t **result,
bemgr_BeMgrRadError_t **error);
rc_err_t bemgr_BEManager_getZBEList(rc_instance_t *inst,
const char *zonename,
rc_instance_t ***result,
int *result_cnt,
bemgr_BeMgrRadError_t **error);
Enumerated Types
enum BeMgrRadErrType
typedef enum bemgr_BeMgrRadErrType {
BBMRET_INVALID_ARG = 0,
BBMRET_BE_OP_ERR = 1,
BBMRET_BE_RAD_ERR = 2,
} bemgr_BeMgrRadErrType_t;
Structured Types
struct BeMgrRadError
typedef struct bemgr_BeMgrRadError bemgr_BeMgrRadError_t;
struct bemgr_BeMgrRadError {
bemgr_BeMgrRadErrType_t bbmre_errType;
char *bbmre_info;
};
void bemgr_BeMgrRadError_free(bemgr_BeMgrRadError_t *in);
BEMGR-1(3rad) RAD Module Definitions BEMGR-1(3rad)
NAME
bemgr - This API provides functionality for getting information about
Boot Environments(BE) on the system.
SYNOPSIS
#include <rad/client/1/bemgr.h>
cc [ flag... ] file... -lbemgr1_client [ library... ]
interface BootEnv
const char * name ; (ro)
const char * fmri ; (ro)
boolean_t active ; (ro)
boolean_t activeOnBoot ; (ro)
boolean_t * activeUnbootable ; (ro)
boolean_t mounted ; (ro)
const char * mountpoint ; (ro)
unsigned long long spaceUsed ; (ro)
const rc_instance_t * rootDataset ; (ro)
const rc_instance_t ** datasets ; (ro)
const rc_instance_t ** snapshots ; (ro)
const char * zpool ; (ro)
const char * uuid ; (ro)
const char * policy ; (ro)
const rc_instance_t * parentBE ; (ro)
const rc_instance_t ** childBEs ; (ro)
int creation ; (ro)
unsigned long long pool_version ; (ro)
interface BEDataset
const char * name ; (ro)
const char * mountpoint ; (ro)
int creation ; (ro)
unsigned long long spaceUsed ; (ro)
interface BESnapshot
const char * name ; (ro)
int creation ; (ro)
unsigned long long spaceUsed ; (ro)
interface BEManager
rc_err_t bemgr_BEManager_getActiveBE(rc_instance_t *inst,
rc_instance_t **result,
bemgr_BeMgrRadError_t **error);
rc_err_t bemgr_BEManager_getActiveOnBootBE(rc_instance_t *inst,
const char *zpool,
rc_instance_t **result,
bemgr_BeMgrRadError_t **error);
rc_err_t bemgr_BEManager_getActiveOnBootZBE(rc_instance_t *inst,
const char *zonename,
const char *gzbe_fmri,
rc_instance_t **result,
bemgr_BeMgrRadError_t **error);
rc_err_t bemgr_BEManager_getZBEList(rc_instance_t *inst,
const char *zonename,
rc_instance_t ***result,
int *result_cnt,
bemgr_BeMgrRadError_t **error);
Enumerated Types
enum BeMgrRadErrType
typedef enum bemgr_BeMgrRadErrType {
BBMRET_INVALID_ARG = 0,
BBMRET_BE_OP_ERR = 1,
BBMRET_BE_RAD_ERR = 2,
} bemgr_BeMgrRadErrType_t;
Structured Types
struct BeMgrRadError
typedef struct bemgr_BeMgrRadError bemgr_BeMgrRadError_t;
struct bemgr_BeMgrRadError {
bemgr_BeMgrRadErrType_t bbmre_errType;
char *bbmre_info;
};
void bemgr_BeMgrRadError_free(bemgr_BeMgrRadError_t *in);
DESCRIPTION
API com.oracle.solaris.rad.bemgr [1]
This API provides functionality for getting information about Boot
Environments(BE) on the system. Management of BEs is not supported at
this time.
The following sample Python clients illustrate some simple interactions
with the module.
INTERFACES
interface BootEnv
Information about a Boot Environment.
BootEnv Properties
const char * name (read-only) -- Name of the BE.
rc_err_t bemgr_BootEnv_get_name(rc_instance_t *inst,
char **result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
const char * fmri (read-only) -- Full BE FMRI.
rc_err_t bemgr_BootEnv_get_fmri(rc_instance_t *inst,
char **result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
boolean_t active (read-only) -- Indicate whether this is an active
BE.
rc_err_t bemgr_BootEnv_get_active(rc_instance_t *inst,
boolean_t *result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
boolean_t activeOnBoot (read-only) -- Indicate whether this is an
active on boot BE.
rc_err_t bemgr_BootEnv_get_activeOnBoot(rc_instance_t *inst,
boolean_t *result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
boolean_t * activeUnbootable (read-only, nullable)
This field is only used for non-global zone BEs. Indicate
whether this BE is the active BE for global zone BE that's not
currently running, so, it is not bootable.
rc_err_t bemgr_BootEnv_get_activeUnbootable(rc_instance_t *inst,
boolean_t **result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
boolean_t mounted (read-only) -- Indicate whether this BE is
currently mounted.
rc_err_t bemgr_BootEnv_get_mounted(rc_instance_t *inst,
boolean_t *result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
const char * mountpoint (read-only, nullable) -- Mountpoint of the
BE, if mounted.
rc_err_t bemgr_BootEnv_get_mountpoint(rc_instance_t *inst,
char **result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
unsigned long long spaceUsed (read-only) -- Total size of the BE.
If the BE is a global BE, this includes size of all NGZ BEs
associated with the global zone BE.
rc_err_t bemgr_BootEnv_get_spaceUsed(rc_instance_t *inst,
unsigned long long *result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
const rc_instance_t * rootDataset (read-only) -- BEDataset object
representing the ZFS filesystem used as the root dataset for the
BE.
rc_err_t bemgr_BootEnv_get_rootDataset(rc_instance_t *inst,
rc_instance_t **result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
const rc_instance_t ** datasets (read-only) -- List of in-BE
datasets. The root dataset is also included in this list.
rc_err_t bemgr_BootEnv_get_datasets(rc_instance_t *inst,
rc_instance_t ***result,
int *result_cnt);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
result_cnt -- Number of items in result array
const rc_instance_t ** snapshots (read-only, nullable) -- List of
ZFS snapshots for all in-BE datasets.
rc_err_t bemgr_BootEnv_get_snapshots(rc_instance_t *inst,
rc_instance_t ***result,
int *result_cnt);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
result_cnt -- Number of items in result array
const char * zpool (read-only) -- Name of the zpool this BE resides
on.
rc_err_t bemgr_BootEnv_get_zpool(rc_instance_t *inst,
char **result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
const char * uuid (read-only) -- UUID for the BE resides on.
rc_err_t bemgr_BootEnv_get_uuid(rc_instance_t *inst,
char **result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
const char * policy (read-only) -- BE's policy
rc_err_t bemgr_BootEnv_get_policy(rc_instance_t *inst,
char **result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
const rc_instance_t * parentBE (read-only, nullable) -- Only used
for NGZ BEs. FMRI of the parent BE.
rc_err_t bemgr_BootEnv_get_parentBE(rc_instance_t *inst,
rc_instance_t **result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
const rc_instance_t ** childBEs (read-only, nullable) -- List of
FMRI of the child BE.
rc_err_t bemgr_BootEnv_get_childBEs(rc_instance_t *inst,
rc_instance_t ***result,
int *result_cnt);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
result_cnt -- Number of items in result array
int creation (read-only) -- BE's creation timestamp
rc_err_t bemgr_BootEnv_get_creation(rc_instance_t *inst,
int *result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
unsigned long long pool_version (read-only) -- The maximum pool
version this BE supports, if the BE is not mounted.
rc_err_t bemgr_BootEnv_get_pool_version(rc_instance_t *inst,
unsigned long long *result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
BootEnv Retrieve
rc_err_t bemgr_BootEnv__rad_get_name(adr_name_t **result,
int n,
...);
Obtain RAD name of a BootEnv object.
Arguments:
result -- RAD name
n -- Number of key-value pairs provided as variadic arguments
... -- Optional key-value pairs that compose the primary key
rc_err_t bemgr_BootEnv__rad_lookup(rc_conn_t *c,
boolean_t strict,
rc_instance_t **result,
int n,
...);
Lookup a BootEnv instance.
Construct a RAD name for the interface based on the provided
key-value pairs and perform a lookup. If successful, instance
reference is returned in the result.
Arguments:
c -- RAD connection handle
strict -- Strict (B_TRUE) or relaxed (B_FALSE) versioning
result -- RAD instance
n -- Number of key-value pairs provided as variadic arguments
... -- Optional key-value pairs that compose the primary key
rc_err_t bemgr_BootEnv__rad_list(rc_conn_t *c,
boolean_t strict,
adr_pattern_scheme_t scheme,
adr_name_t ***result,
int *result_count,
int n,
...);
List RAD names of a available BootEnv instances.
Returns an array and array size of matching object names.
Arguments:
c -- RAD connection handle
strict -- Strict (B_TRUE) or relaxed (B_FALSE) versioning
scheme -- Apply glob (NS_GLOB) or regex (NS_REGEX) matching
result -- Array of RAD names
result_count -- Number of names in result array
n -- Number of key-value pairs provided as variadic arguments
... -- Optional key-value pairs that compose the primary key
interface BEDataset
BEDataset Properties
const char * name (read-only) -- BEDataset's ZFS filesystem name
rc_err_t bemgr_BEDataset_get_name(rc_instance_t *inst,
char **result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
const char * mountpoint (read-only) -- Dataset's mountpoint
rc_err_t bemgr_BEDataset_get_mountpoint(rc_instance_t *inst,
char **result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
int creation (read-only) -- BE Dataset's creation timestamp
rc_err_t bemgr_BEDataset_get_creation(rc_instance_t *inst,
int *result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
unsigned long long spaceUsed (read-only) -- Amount of space used by
this BE Dataset
rc_err_t bemgr_BEDataset_get_spaceUsed(rc_instance_t *inst,
unsigned long long *result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
BEDataset Retrieve
rc_err_t bemgr_BEDataset__rad_get_name(adr_name_t **result,
int n,
...);
Obtain RAD name of a BEDataset object.
Arguments:
result -- RAD name
n -- Number of key-value pairs provided as variadic arguments
... -- Optional key-value pairs that compose the primary key
rc_err_t bemgr_BEDataset__rad_lookup(rc_conn_t *c,
boolean_t strict,
rc_instance_t **result,
int n,
...);
Lookup a BEDataset instance.
Construct a RAD name for the interface based on the provided
key-value pairs and perform a lookup. If successful, instance
reference is returned in the result.
Arguments:
c -- RAD connection handle
strict -- Strict (B_TRUE) or relaxed (B_FALSE) versioning
result -- RAD instance
n -- Number of key-value pairs provided as variadic arguments
... -- Optional key-value pairs that compose the primary key
rc_err_t bemgr_BEDataset__rad_list(rc_conn_t *c,
boolean_t strict,
adr_pattern_scheme_t scheme,
adr_name_t ***result,
int *result_count,
int n,
...);
List RAD names of a available BEDataset instances.
Returns an array and array size of matching object names.
Arguments:
c -- RAD connection handle
strict -- Strict (B_TRUE) or relaxed (B_FALSE) versioning
scheme -- Apply glob (NS_GLOB) or regex (NS_REGEX) matching
result -- Array of RAD names
result_count -- Number of names in result array
n -- Number of key-value pairs provided as variadic arguments
... -- Optional key-value pairs that compose the primary key
interface BESnapshot
BESnapshot Properties
const char * name (read-only) -- BE Snapshot's ZFS snapshot name
rc_err_t bemgr_BESnapshot_get_name(rc_instance_t *inst,
char **result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
int creation (read-only) -- BE Snapshot's creation timestamp
rc_err_t bemgr_BESnapshot_get_creation(rc_instance_t *inst,
int *result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
unsigned long long spaceUsed (read-only) -- Amount of space used by
this BE Snapshot
rc_err_t bemgr_BESnapshot_get_spaceUsed(rc_instance_t *inst,
unsigned long long *result);
Get property value.
Arguments:
inst -- RAD instance
result -- Property value returned
BESnapshot Retrieve
rc_err_t bemgr_BESnapshot__rad_get_name(adr_name_t **result,
int n,
...);
Obtain RAD name of a BESnapshot object.
Arguments:
result -- RAD name
n -- Number of key-value pairs provided as variadic arguments
... -- Optional key-value pairs that compose the primary key
rc_err_t bemgr_BESnapshot__rad_lookup(rc_conn_t *c,
boolean_t strict,
rc_instance_t **result,
int n,
...);
Lookup a BESnapshot instance.
Construct a RAD name for the interface based on the provided
key-value pairs and perform a lookup. If successful, instance
reference is returned in the result.
Arguments:
c -- RAD connection handle
strict -- Strict (B_TRUE) or relaxed (B_FALSE) versioning
result -- RAD instance
n -- Number of key-value pairs provided as variadic arguments
... -- Optional key-value pairs that compose the primary key
rc_err_t bemgr_BESnapshot__rad_list(rc_conn_t *c,
boolean_t strict,
adr_pattern_scheme_t scheme,
adr_name_t ***result,
int *result_count,
int n,
...);
List RAD names of a available BESnapshot instances.
Returns an array and array size of matching object names.
Arguments:
c -- RAD connection handle
strict -- Strict (B_TRUE) or relaxed (B_FALSE) versioning
scheme -- Apply glob (NS_GLOB) or regex (NS_REGEX) matching
result -- Array of RAD names
result_count -- Number of names in result array
n -- Number of key-value pairs provided as variadic arguments
... -- Optional key-value pairs that compose the primary key
interface BEManager
The BEManager interface is a RAD singleton. It provides interfaces for
getting information about Boot Environments on the system.
BEManager Methods
rc_err_t bemgr_BEManager_getActiveBE(rc_instance_t *inst,
rc_instance_t **result,
bemgr_BeMgrRadError_t **error);
Returns a BootEnv object representing the currently running
global zone BE.
Arguments:
inst -- RAD instance
result -- BootEnv object representing the currently running
global zone BE.
error
rc_err_t bemgr_BEManager_getActiveOnBootBE(rc_instance_t *inst,
const char *zpool,
rc_instance_t **result,
bemgr_BeMgrRadError_t **error);
Returns a BootEnv object representing the activated global zone
BE for the given zpool.
Arguments:
inst -- RAD instance
zpool (nullable) -- Optional. If name of a zpool is specified,
the activated global zone BE for the given zpool is returned.
If name of a zpool is not specified, the activated global zone
BE for the running BE's zpool is returned.
result -- BootEnv object representing the activated global zone
BE.
error
rc_err_t bemgr_BEManager_getActiveOnBootZBE(rc_instance_t *inst,
const char *zonename,
const char *gzbe_fmri,
rc_instance_t **result,
bemgr_BeMgrRadError_t **error);
Returns a BootEnv object representing the activated non-global
zone BE that's associated with the given global zone BE.
Arguments:
inst -- RAD instance
zonename -- Name of the zone for which the ZBE to be returned
belongs.
gzbe_fmri (nullable) -- Optional. If this value is specified,
this function will return the active-on-boot ZBE for the given
global zone. If this value is not specified, this function will
return the active-on-boot ZBE for the current running global
BE.
result -- BootEnv object of the activated non-global zone BE.
error
rc_err_t bemgr_BEManager_getZBEList(rc_instance_t *inst,
const char *zonename,
rc_instance_t ***result,
int *result_cnt,
bemgr_BeMgrRadError_t **error);
Returns a list of BootEnv objects representing all the zone BEs
in the given zone.
Arguments:
inst -- RAD instance
zonename -- Name of the zone for which the ZBEs to be returned
belongs.
result -- List of BootEnv objects representing NGZ BEs in a
zone.
result_cnt -- Number of items in result array
error
BEManager Retrieve
rc_err_t bemgr_BEManager__rad_get_name(adr_name_t **result,
int n,
...);
Obtain RAD name of a BEManager object.
Arguments:
result -- RAD name
n -- Number of key-value pairs provided as variadic arguments
... -- Optional key-value pairs that compose the primary key
rc_err_t bemgr_BEManager__rad_lookup(rc_conn_t *c,
boolean_t strict,
rc_instance_t **result,
int n,
...);
Lookup a BEManager instance.
Construct a RAD name for the interface based on the provided
key-value pairs and perform a lookup. If successful, instance
reference is returned in the result.
Arguments:
c -- RAD connection handle
strict -- Strict (B_TRUE) or relaxed (B_FALSE) versioning
result -- RAD instance
n -- Number of key-value pairs provided as variadic arguments
... -- Optional key-value pairs that compose the primary key
rc_err_t bemgr_BEManager__rad_list(rc_conn_t *c,
boolean_t strict,
adr_pattern_scheme_t scheme,
adr_name_t ***result,
int *result_count,
int n,
...);
List RAD names of a available BEManager instances.
Returns an array and array size of matching object names.
Arguments:
c -- RAD connection handle
strict -- Strict (B_TRUE) or relaxed (B_FALSE) versioning
scheme -- Apply glob (NS_GLOB) or regex (NS_REGEX) matching
result -- Array of RAD names
result_count -- Number of names in result array
n -- Number of key-value pairs provided as variadic arguments
... -- Optional key-value pairs that compose the primary key
ENUMERATED TYPES
enum BeMgrRadErrType -- Possible error types returned by the bemgr RAD
Module.
typedef enum bemgr_BeMgrRadErrType {
BBMRET_INVALID_ARG = 0,
BBMRET_BE_OP_ERR = 1,
BBMRET_BE_RAD_ERR = 2,
} bemgr_BeMgrRadErrType_t;
When the bemgr RAD Module encounters an error, it will return a
payload containing both an error type and an error message. This
enum defines the possible error types.
BBMRET_INVALID_ARG (0) -- This error type will be raised when a
method has been called with an invalid argument.
BBMRET_BE_OP_ERR (1) -- This error type will be raised when an
error occurred while performing BE management operations.
BBMRET_BE_RAD_ERR (2) -- This error type will be raised when an
error is occur in the bemgr RAD module that's not related to BE
managent operations.
STRUCTURED TYPES
struct BeMgrRadError -- Contains information about an error that
occurred in the bemgr RAD Module.
typedef struct bemgr_BeMgrRadError bemgr_BeMgrRadError_t;
struct bemgr_BeMgrRadError {
bemgr_BeMgrRadErrType_t bbmre_errType;
char *bbmre_info;
};
void bemgr_BeMgrRadError_free(bemgr_BeMgrRadError_t *in);
Fields:
bbmre_errType -- The error type is an enum value of
BeMgrRadErrType.
bbmre_info -- This field contains the error message, which is a
human readable string detailing the cause of the error.
VERSION
1.1
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
+--------------------+----------------------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+----------------------------------------+
|Availability | system/management/rad/module/rad-bemgr |
+--------------------+----------------------------------------+
|Interface Stability | Private |
+--------------------+----------------------------------------+
SEE ALSO
rad(8)
NOTES
1. Accessing Python documentation for this module:
$ pydoc rad.bindings.com.oracle.solaris.rad.bemgr_1
Solaris 11.4 2020-08-18 BEMGR-1(3rad)