Go to main content

man pages section 3: Remote Administration Daemon Module Interfaces

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

webuiprefs-1 (3rad)

Name

webuiprefs-1 - API for WebUI preferences

Synopsis

#include <rad/client/1/webuiprefs.h>
cc [ flag... ] file... -lwebuiprefs1_client [ library... ]

interface Preferences
const char * apps ; (ro)
const char * system ; (ro)
const char * user ; (rw)
const char ** import_formats ; (ro)

rc_err_t webuiprefs_Preferences_initialize(rc_instance_t *inst,
const char *base_dir,
const char *username,
webuiprefs_PreferencesError_t **error);

rc_err_t webuiprefs_Preferences_validate_json(rc_instance_t *inst,
const char *json_string,
boolean_t *is_schema,
const char *import_format,
char **result);

rc_err_t webuiprefs_Preferences_import_files(rc_instance_t *inst,
const char *format_name,
const char **files,
int files_count,
webuiprefs_ImportSummary_t **result,
webuiprefs_PreferencesError_t **error);

rc_err_t webuiprefs_Preferences_import_string(rc_instance_t *inst,
const char *format_name,
const char *json_string,
char **result,
webuiprefs_PreferencesError_t **error);

rc_err_t webuiprefs_Preferences_export_string(rc_instance_t *inst,
const char *format_name,
const char *json_string,
char **result,
webuiprefs_PreferencesError_t **error);

rc_err_t webuiprefs_Preferences_export_by_id(rc_instance_t *inst,
const char *format_name,
const char **id_list,
int id_list_count,
char **result,
webuiprefs_PreferencesError_t **error);

rc_err_t webuiprefs_Preferences_get_exportable_ids(rc_instance_t *inst,
const char *format_name,
webuiprefs_ExportableIds_t ***result,
int *result_cnt,
webuiprefs_PreferencesError_t **error);

rc_err_t webuiprefs_Preferences_verify_existing_ids(rc_instance_t *inst,
const char *format_name,
const char **id_list,
int id_list_count,
char ***result,
int *result_cnt,
webuiprefs_PreferencesError_t **error);

Enumerated Types
enum ERROR_TYPE

typedef enum webuiprefs_ERROR_TYPE {
WERRORTYPE_RUNTIME_ERROR = 0,
WERRORTYPE_PARSING_ERROR = 1,
WERRORTYPE_INVALID_VALUE = 2,
WERRORTYPE_INSUFFICIENT_ARGUMENTS = 3,
WERRORTYPE_INSUFFICIENT_AUTHORIZATION = 4,
} webuiprefs_ERROR_TYPE_t;

Structured Types
struct PreferencesError

typedef struct webuiprefs_PreferencesError
webuiprefs_PreferencesError_t;

struct webuiprefs_PreferencesError {
webuiprefs_ERROR_TYPE_t wpe_error_type;
char *wpe_reason;
};


void webuiprefs_PreferencesError_free(webuiprefs_PreferencesError_t *in);

struct FileImportError

typedef struct webuiprefs_FileImportError
webuiprefs_FileImportError_t;

struct webuiprefs_FileImportError {
char *wfie_file_path;
char *wfie_errors;
};


void webuiprefs_FileImportError_free(webuiprefs_FileImportError_t *in);

struct FormatSummary

typedef struct webuiprefs_FormatSummary webuiprefs_FormatSummary_t;

struct webuiprefs_FormatSummary {
char *wfs_format;
char **wfs_imported_files;
int wfs_imported_files_count;
webuiprefs_FileImportError_t **wfs_failed_files;
int wfs_failed_files_count;
webuiprefs_FileImportError_t **wfs_missing_files;
int wfs_missing_files_count;
char **wfs_skipped_files;
int wfs_skipped_files_count;
char *wfs_errors;
};


void webuiprefs_FormatSummary_free(webuiprefs_FormatSummary_t *in);

struct ImportSummary

typedef struct webuiprefs_ImportSummary webuiprefs_ImportSummary_t;

struct webuiprefs_ImportSummary {
int wis_num_found_files;
int wis_num_imported_files;
int wis_num_failed_files;
int wis_num_missing_files;
int wis_num_skipped_files;
webuiprefs_FormatSummary_t **wis_format_summaries;
int wis_format_summaries_count;
char *wis_errors;
};


void webuiprefs_ImportSummary_free(webuiprefs_ImportSummary_t *in);

struct ExportableIds

typedef struct webuiprefs_ExportableIds webuiprefs_ExportableIds_t;

struct webuiprefs_ExportableIds {
char *wei_identifier;
char *wei_format_module;
char *wei_id_type;
char *wei_description;
webuiprefs_ExportableIds_t **wei_contains;
int wei_contains_count;
};


void webuiprefs_ExportableIds_free(webuiprefs_ExportableIds_t *in);

Description

WEBUIPREFS-1(3rad)          RAD Module Definitions          WEBUIPREFS-1(3rad)



NAME
       webuiprefs - API for WebUI preferences

SYNOPSIS
       #include <rad/client/1/webuiprefs.h>
       cc [ flag... ] file... -lwebuiprefs1_client [ library... ]

   interface Preferences
       const char * apps ; (ro)
       const char * system ; (ro)
       const char * user ; (rw)
       const char ** import_formats ; (ro)

       rc_err_t webuiprefs_Preferences_initialize(rc_instance_t *inst,
                                                  const char *base_dir,
                                                  const char *username,
                                                  webuiprefs_PreferencesError_t **error);

       rc_err_t webuiprefs_Preferences_validate_json(rc_instance_t *inst,
                                                     const char *json_string,
                                                     boolean_t *is_schema,
                                                     const char *import_format,
                                                     char **result);

       rc_err_t webuiprefs_Preferences_import_files(rc_instance_t *inst,
                                                    const char *format_name,
                                                    const char **files,
                                                    int files_count,
                                                    webuiprefs_ImportSummary_t **result,
                                                    webuiprefs_PreferencesError_t **error);

       rc_err_t webuiprefs_Preferences_import_string(rc_instance_t *inst,
                                                     const char *format_name,
                                                     const char *json_string,
                                                     char **result,
                                                     webuiprefs_PreferencesError_t **error);

       rc_err_t webuiprefs_Preferences_export_string(rc_instance_t *inst,
                                                     const char *format_name,
                                                     const char *json_string,
                                                     char **result,
                                                     webuiprefs_PreferencesError_t **error);

       rc_err_t webuiprefs_Preferences_export_by_id(rc_instance_t *inst,
                                                    const char *format_name,
                                                    const char **id_list,
                                                    int id_list_count,
                                                    char **result,
                                                    webuiprefs_PreferencesError_t **error);

       rc_err_t webuiprefs_Preferences_get_exportable_ids(rc_instance_t *inst,
                                                          const char *format_name,
                                                          webuiprefs_ExportableIds_t ***result,
                                                          int *result_cnt,
                                                          webuiprefs_PreferencesError_t **error);

       rc_err_t webuiprefs_Preferences_verify_existing_ids(rc_instance_t *inst,
                                                           const char *format_name,
                                                           const char **id_list,
                                                           int id_list_count,
                                                           char ***result,
                                                           int *result_cnt,
                                                           webuiprefs_PreferencesError_t **error);

   Enumerated Types
       enum ERROR_TYPE

           typedef enum webuiprefs_ERROR_TYPE {
                WERRORTYPE_RUNTIME_ERROR = 0,
                WERRORTYPE_PARSING_ERROR = 1,
                WERRORTYPE_INVALID_VALUE = 2,
                WERRORTYPE_INSUFFICIENT_ARGUMENTS = 3,
                WERRORTYPE_INSUFFICIENT_AUTHORIZATION = 4,
           } webuiprefs_ERROR_TYPE_t;

   Structured Types
       struct PreferencesError

           typedef struct webuiprefs_PreferencesError
           webuiprefs_PreferencesError_t;

           struct webuiprefs_PreferencesError {
                webuiprefs_ERROR_TYPE_t wpe_error_type;
                char *wpe_reason;
           };


           void webuiprefs_PreferencesError_free(webuiprefs_PreferencesError_t *in);

       struct FileImportError

           typedef struct webuiprefs_FileImportError
           webuiprefs_FileImportError_t;

           struct webuiprefs_FileImportError {
                char *wfie_file_path;
                char *wfie_errors;
           };


           void webuiprefs_FileImportError_free(webuiprefs_FileImportError_t *in);

       struct FormatSummary

           typedef struct webuiprefs_FormatSummary webuiprefs_FormatSummary_t;

           struct webuiprefs_FormatSummary {
                char *wfs_format;
                char **wfs_imported_files;
                int wfs_imported_files_count;
                webuiprefs_FileImportError_t **wfs_failed_files;
                int wfs_failed_files_count;
                webuiprefs_FileImportError_t **wfs_missing_files;
                int wfs_missing_files_count;
                char **wfs_skipped_files;
                int wfs_skipped_files_count;
                char *wfs_errors;
           };


           void webuiprefs_FormatSummary_free(webuiprefs_FormatSummary_t *in);

       struct ImportSummary

           typedef struct webuiprefs_ImportSummary webuiprefs_ImportSummary_t;

           struct webuiprefs_ImportSummary {
                int wis_num_found_files;
                int wis_num_imported_files;
                int wis_num_failed_files;
                int wis_num_missing_files;
                int wis_num_skipped_files;
                webuiprefs_FormatSummary_t **wis_format_summaries;
                int wis_format_summaries_count;
                char *wis_errors;
           };


           void webuiprefs_ImportSummary_free(webuiprefs_ImportSummary_t *in);

       struct ExportableIds

           typedef struct webuiprefs_ExportableIds webuiprefs_ExportableIds_t;

           struct webuiprefs_ExportableIds {
                char *wei_identifier;
                char *wei_format_module;
                char *wei_id_type;
                char *wei_description;
                webuiprefs_ExportableIds_t **wei_contains;
                int wei_contains_count;
           };


           void webuiprefs_ExportableIds_free(webuiprefs_ExportableIds_t *in);

DESCRIPTION
       API com.oracle.solaris.rad.webuiprefs [1]

INTERFACES
   interface Preferences
       Singleton preferences object

       Preferences Properties
           const char * apps (read-only, nullable)

               Information about the applications that the user has access to.
               The output is a JSON object in the format: { app_url_base: <app
               URL base> (e.g. bui) apps: { "app_1": { schema: [<JSON
               Schemas]... }, "app_2": { schema: [<JSON Schemas]... } ... }
               "global_schema": [<JSON Schema files>] }

               rc_err_t webuiprefs_Preferences_get_apps(rc_instance_t *inst,
                                                        char **result,
                                                        webuiprefs_PreferencesError_t **error);

                   Get property value.

                   Arguments:

                   inst -- RAD instance

                   result -- Property value returned

                   error

               Read Error: webuiprefs_PreferencesError_t **

           const char * system (read-only, nullable) -- The system
           preferences, in JSON format.

               rc_err_t webuiprefs_Preferences_get_system(rc_instance_t *inst,
                                                          char **result,
                                                          webuiprefs_PreferencesError_t **error);

                   Get property value.

                   Arguments:

                   inst -- RAD instance

                   result -- Property value returned

                   error

               Read Error: webuiprefs_PreferencesError_t **

           const char * user (read-write, nullable) -- The authorized user's
           own preferences in JSON format, which is modifiable.

               rc_err_t webuiprefs_Preferences_get_user(rc_instance_t *inst,
                                                        char **result,
                                                        webuiprefs_PreferencesError_t **error);

                   Get property value.

                   Arguments:

                   inst -- RAD instance

                   result -- Property value returned

                   error

               rc_err_t webuiprefs_Preferences_set_user(rc_instance_t *inst,
                                                        const char *user,
                                                        webuiprefs_PreferencesError_t **error);

                   Set property value.

                   Arguments:

                   inst -- RAD instance

                   user -- Property value written

                   error

               Read-Write Error: webuiprefs_PreferencesError_t **

           const char ** import_formats (read-only, nullable)

               Get a list of import formats available

               rc_err_t webuiprefs_Preferences_get_import_formats(rc_instance_t *inst,
                                                                  char ***result,
                                                                  int *result_cnt,
                                                                  webuiprefs_PreferencesError_t **error);

                   Get property value.

                   Arguments:

                   inst -- RAD instance

                   result -- Property value returned

                   result_cnt -- Number of items in result array

                   error

               Read Error: webuiprefs_PreferencesError_t **

       Preferences Methods
           rc_err_t webuiprefs_Preferences_initialize(rc_instance_t *inst,
                                                      const char *base_dir,
                                                      const char *username,
                                                      webuiprefs_PreferencesError_t **error);

               Initialize the module, optional.

               Arguments:

               inst -- RAD instance

               base_dir (nullable)

               username (nullable)

               error

           rc_err_t webuiprefs_Preferences_validate_json(rc_instance_t *inst,
                                                         const char *json_string,
                                                         boolean_t *is_schema,
                                                         const char *import_format,
                                                         char **result);

               Validate the supplied JSON string.

               If is_schema is provided it will validate the JSON string as a
               new JSON Schema, against the currently used JSON Standard.

               If import_format is provided it will validate the JSON string
               against the specified import format (e.g. 'analytics').
               Otherwise, unless is_schema is true, it will be validated
               against the preferences own JSON Schema.

               Returns None if there are no errors, otherwise a string
               containing the available error messages.

               Arguments:

               inst -- RAD instance

               json_string

               is_schema (nullable)

               import_format (nullable)

               result

           rc_err_t webuiprefs_Preferences_import_files(rc_instance_t *inst,
                                                        const char *format_name,
                                                        const char **files,
                                                        int files_count,
                                                        webuiprefs_ImportSummary_t **result,
                                                        webuiprefs_PreferencesError_t **error);

               Look for files to be imported into the WebUI Preferences
               configuration.

               The directories searched will depend on each import module.

               Optionally, you may specify the format name for the files to be
               imported.

               Returns an ImportSummary structure with details of the actions
               performed.

               Arguments:

               inst -- RAD instance

               format_name (nullable)

               files (nullable)

               files_count -- Number of items in files array

               result

               error

           rc_err_t webuiprefs_Preferences_import_string(rc_instance_t *inst,
                                                         const char *format_name,
                                                         const char *json_string,
                                                         char **result,
                                                         webuiprefs_PreferencesError_t **error);

               Import the provided JSON string in the specified import format
               name.

               Returns the converted preferences

               If there are errors found when performing the import, then a
               PreferencesError will be raised

               Arguments:

               inst -- RAD instance

               format_name (nullable)

               json_string (nullable)

               result

               error

           rc_err_t webuiprefs_Preferences_export_string(rc_instance_t *inst,
                                                         const char *format_name,
                                                         const char *json_string,
                                                         char **result,
                                                         webuiprefs_PreferencesError_t **error);

               Export the provided JSON string in the specified export format
               name.

               Returns the converted preferences

               If there are errors found when performing the export, then a
               PreferencesError will be raised

               Arguments:

               inst -- RAD instance

               format_name (nullable)

               json_string (nullable)

               result

               error

           rc_err_t webuiprefs_Preferences_export_by_id(rc_instance_t *inst,
                                                        const char *format_name,
                                                        const char **id_list,
                                                        int id_list_count,
                                                        char **result,
                                                        webuiprefs_PreferencesError_t **error);

               Export the specified identifiers (UUIDs) to a JSON string in
               the specified export format name.

               Returns the converted preferences

               If there are errors found when performing the export, then a
               PreferencesError will be raised

               Arguments:

               inst -- RAD instance

               format_name

               id_list

               id_list_count -- Number of items in id_list array

               result

               error

           rc_err_t webuiprefs_Preferences_get_exportable_ids(rc_instance_t *inst,
                                                              const char *format_name,
                                                              webuiprefs_ExportableIds_t ***result,
                                                              int *result_cnt,
                                                              webuiprefs_PreferencesError_t **error);

               Get property value.

               Arguments:

               inst -- RAD instance

               format_name (nullable) -- Property value returned

               result

               result_cnt -- Number of items in result array

               error

           rc_err_t webuiprefs_Preferences_verify_existing_ids(rc_instance_t *inst,
                                                               const char *format_name,
                                                               const char **id_list,
                                                               int id_list_count,
                                                               char ***result,
                                                               int *result_cnt,
                                                               webuiprefs_PreferencesError_t **error);

               Given a list of identifiers (UUIDs) check if they exist in the
               specified export format name.

               Returns a list of identifiers that do NOT exist.

               If there are errors found when performing the check, then a
               PreferencesError will be raised

               Arguments:

               inst -- RAD instance

               format_name

               id_list

               id_list_count -- Number of items in id_list array

               result

               result_cnt -- Number of items in result array

               error

       Preferences Retrieve
           rc_err_t webuiprefs_Preferences__rad_get_name(adr_name_t **result,
                                                         int n,
                                                         ...);

               Obtain RAD name of a Preferences 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 webuiprefs_Preferences__rad_lookup(rc_conn_t *c,
                                                       boolean_t strict,
                                                       rc_instance_t **result,
                                                       int n,
                                                       ...);

               Lookup a Preferences 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 webuiprefs_Preferences__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 Preferences 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 ERROR_TYPE

           typedef enum webuiprefs_ERROR_TYPE {
                WERRORTYPE_RUNTIME_ERROR = 0,
                WERRORTYPE_PARSING_ERROR = 1,
                WERRORTYPE_INVALID_VALUE = 2,
                WERRORTYPE_INSUFFICIENT_ARGUMENTS = 3,
                WERRORTYPE_INSUFFICIENT_AUTHORIZATION = 4,
           } webuiprefs_ERROR_TYPE_t;

           WERRORTYPE_RUNTIME_ERROR (0)

           WERRORTYPE_PARSING_ERROR (1)

           WERRORTYPE_INVALID_VALUE (2)

           WERRORTYPE_INSUFFICIENT_ARGUMENTS (3)

           WERRORTYPE_INSUFFICIENT_AUTHORIZATION (4)

STRUCTURED TYPES
       struct PreferencesError

           typedef struct webuiprefs_PreferencesError
           webuiprefs_PreferencesError_t;

           struct webuiprefs_PreferencesError {
                webuiprefs_ERROR_TYPE_t wpe_error_type;
                char *wpe_reason;
           };


           void webuiprefs_PreferencesError_free(webuiprefs_PreferencesError_t *in);

           Fields:

           wpe_error_type

           wpe_reason

       struct FileImportError

           typedef struct webuiprefs_FileImportError
           webuiprefs_FileImportError_t;

           struct webuiprefs_FileImportError {
                char *wfie_file_path;
                char *wfie_errors;
           };


           void webuiprefs_FileImportError_free(webuiprefs_FileImportError_t *in);

           Fields:

           wfie_file_path

           wfie_errors

       struct FormatSummary -- Structure with format, and a list of associated
       files

           typedef struct webuiprefs_FormatSummary webuiprefs_FormatSummary_t;

           struct webuiprefs_FormatSummary {
                char *wfs_format;
                char **wfs_imported_files;
                int wfs_imported_files_count;
                webuiprefs_FileImportError_t **wfs_failed_files;
                int wfs_failed_files_count;
                webuiprefs_FileImportError_t **wfs_missing_files;
                int wfs_missing_files_count;
                char **wfs_skipped_files;
                int wfs_skipped_files_count;
                char *wfs_errors;
           };


           void webuiprefs_FormatSummary_free(webuiprefs_FormatSummary_t *in);

           Fields:

           wfs_format

           wfs_imported_files

           wfs_imported_files_count

           wfs_failed_files

           wfs_failed_files_count

           wfs_missing_files

           wfs_missing_files_count

           wfs_skipped_files

           wfs_skipped_files_count

           wfs_errors

       struct ImportSummary -- Summary of the import that was just performed

           typedef struct webuiprefs_ImportSummary webuiprefs_ImportSummary_t;

           struct webuiprefs_ImportSummary {
                int wis_num_found_files;
                int wis_num_imported_files;
                int wis_num_failed_files;
                int wis_num_missing_files;
                int wis_num_skipped_files;
                webuiprefs_FormatSummary_t **wis_format_summaries;
                int wis_format_summaries_count;
                char *wis_errors;
           };


           void webuiprefs_ImportSummary_free(webuiprefs_ImportSummary_t *in);

           Fields:

           wis_num_found_files

           wis_num_imported_files

           wis_num_failed_files

           wis_num_missing_files

           wis_num_skipped_files

           wis_format_summaries

           wis_format_summaries_count

           wis_errors

       struct ExportableIds

           typedef struct webuiprefs_ExportableIds webuiprefs_ExportableIds_t;

           struct webuiprefs_ExportableIds {
                char *wei_identifier;
                char *wei_format_module;
                char *wei_id_type;
                char *wei_description;
                webuiprefs_ExportableIds_t **wei_contains;
                int wei_contains_count;
           };


           void webuiprefs_ExportableIds_free(webuiprefs_ExportableIds_t *in);

           Structure to contain identifiers that are available for export, the
           format that is possible to export to, as well as as possible useful
           type.

           Fields:

           wei_identifier

           wei_format_module

           wei_id_type

           wei_description

           wei_contains

           wei_contains_count

VERSION
       1.0

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       +--------------------+---------------------------------------------+
       |  ATTRIBUTE TYPE    |               ATTRIBUTE VALUE               |
       +--------------------+---------------------------------------------+
       |Availability        | system/management/rad/module/rad-webuiprefs |
       +--------------------+---------------------------------------------+
       |Interface Stability | Private                                     |
       +--------------------+---------------------------------------------+

SEE ALSO
       rad(8)

NOTES
        1. Accessing Python documentation for this module:

           $ pydoc rad.bindings.com.oracle.solaris.rad.webuiprefs_1





Solaris 11.4                      2017-02-01                WEBUIPREFS-1(3rad)