Operations

You execute various operations to manage the administration objects. Chapter 3, "searchadmin Commands," provides the syntax of these operations and command examples. The same operations are available as XML documents in the Web services interface, described in Chapter 4, "Web Service Operations."

Command Syntax

The commands have this general syntax for universal object types:

operation object_type [parameters] [options]

The syntax for creatable types includes the object key for operations performed on a single object:

operation object_type [object_key] [parameters] [options]

For example, the following command activates clustering. The clustering object is a universal object type, and the command consists only of the required operation and object_type:

activate clustering

The next command updates the clustering configuration. This command requires the path to the input XML file with the new configuration settings and an update method:

update clustering --INPUT_FILE=clustering.xml --UPDATE_METHOD=overwrite

Most parameters and some common options have a shortcut notation. The previous update command can also be expressed with this syntax:

update clustering -i clustering.xml -a overwrite

Sources are creatable, so the command to change the configuration of a source requires the object key. For sources, the object key is the name. The following command also includes the INPUT_FILE parameter.

update source --NAME="Doc Library" --UPDATE_METHOD=overwrite --INPUT_FILE=sources.xml

The shortcut notation looks like this:

update source -n "Doc Library" -a overwrite -i sources.xml

Using the Message Logs

The message logs can help you debug problems executing an operation.

Log Files

The searchadmin command logs messages in

ORACLE_HOME/search/log/searchadmin/searchadmin.log.

The WebLogic server for Web services logs messages in

ORACLE_HOME/search/base_domain/servers/AdminServer/logs/AdminServer.out.

Configuration File

The Administration API uses Apache log4j logging services. The configuration file sets the logging level and other properties. To change the settings, edit

ORACLE_HOME/search/config/searchadmin/log4j.properties.

Table 1-5 describes the properties.

Table 1-5 Logging Properties

Property Description

rootLogger

Sets the level of detail:

  • DEBUG: Tracks the status of operations throughout execution and logs details about common errors, such as invalid input.

  • INFO: Generates important status messages, such as a warning that a federated source cannot be contacted. (Default)

File

Path to the log file, initially set to

ORACLE_HOME/search/log/searchadmin/searchadmin.log.

Append

Set to append messages to the file (default), or false to overwrite it.

MaxFileSize

Maximum size of the log file, initially set to 1MB. It starts over when it reaches that size.

MaxBackupIndex

Number of backup files. Initially set to 1.

layout

Describes the layout of the messages.


See Also:

Documentation for Apache Logging Services log4j 1.2:

http://logging.apache.org

Managing Universal Objects

Use these operations to manage universal administration objects:

Table 1-6 Operations on Universal Objects

Operation Description

export

Returns the XML description of an object.

update

Sets the parameters of an object from an XML file.


Managing Creatable Objects

Use these operations to manage creatable administration objects:

Table 1-7 Operations on Creatable Objects

Operation Description

create

Creates an object from an XML file.

createAll

Creates all the objects of a particular type from an XML file.

delete

Deletes a single object.

deleteAll

Deletes all objects of a particular type.

deleteList

Deletes a list of objects of a particular type.

export

Returns the XML description of an object.

exportAll

Returns the XML descriptions of all objects of a particular type.

exportList

Returns the XML descriptions of a list of objects of a particular type.

update

Sets the parameters of an object from an XML file.

updateAll

Sets the parameters of all objects of a particular type from an XML file.


Managing Object State

Use these operations to manage both universal and creatable administration objects with state properties.

Table 1-8 Operations on Objects With State Properties

Operation Description

activate

Enables an object. Objects that can be enabled have a status state property.

deactivate

Disables an object. Objects that can be disabled have a status state property.

getAllStates

Returns the current state of all objects of a particular type as an XML document.

getState

Returns the state of an object as an XML document.

getStateList

Returns the state of a list of objects of a particular type as an XML document.

start

Initiates the starting process of an object.

stop

Initiates the stopping process of an object.


Status Codes for Bulk Operations

Operations that involve multiple objects, such as createAll, deleteAll and deleteList, return status codes for each processed object, as described in Table 1-9.

Table 1-9 Status Codes

Status Code Description

CREATE_NOT_SUPPORTED

The object cannot be created.

CREATE_SUCCEEDED

The object was successfully created.

DELETE_NOT_SUPPORTED

The object cannot be deleted.

DELETE_SUCCEEDED

The object was successfully deleted.

DUPLICATE_IGNORED

The object already existed. The operation ignored the pre-existing object.

DUPLICATE_OVERWRITTEN

The object already existed. The operation overwrote the pre-existing object.

INVALID_STATE_IGNORED

The object was ignored because it was in an invalid state.

NOT_FOUND_CREATED

The object did not exist. The operation created the object.

NOT_FOUND_IGNORED

The object did not exist. The operation ignored the object.

UPDATE_NOT_SUPPORTED

The object cannot be updated.

UPDATE_SUCCEEDED

The object was successfully updated.