beautypg.com

Event log, Exporting a configuration, Importing a configuration – Google Search Appliance Administrative API Developers Guide: .NET User Manual

Page 51

background image

Google Search Appliance: Administrative API Developer’s Guide: .NET

51

Exporting a Configuration

Export a search appliance configuration by sending an authenticated GET request to the importExport
entry of the config feed.

The following importExport entry is returned:

Dictionary queries = new Dictionary();
queries.Add("password", "12345678");

GsaEntry entry = myService.QueryEntry("config", "importExport", queries);
Console.WriteLine("XML Data: " + entry.GetGsaContent("xmlData"));

Importing a Configuration

Import a search appliance configuration sending an authenticated PUT request to the importExport
entry of the config feed.

GsaEntry updateEntry = new GsaEntry();
updateEntry.AddGsaContent("xmlData", "");
updateEntry.AddGsaContent("password", "12345678");

myService.UpdateEntry("config", "importExport", updateEntry);

Event Log

Retrieve lines from the event log for a search appliance by using the eventLog entry of the logs feed.
The following parameters let you make a query, specify a starting line, and specify the number of event
log statements to retrieve.

Use the following properties to retrieve event log lines and event log content.

Parameter

Description

query

Query string for the logContent. The logContent contains many lines
of logs. The query string applies to each line, only lines that contain the
query string are returned.

startLine

The starting line number to retrieve from the event log. The default
value is 1.

maxLines

The maximum number of lines in the event log to retrieve. The default
value is 50 lines.

Property

Description

fromLine

The starting line of a log.

logContent

The log’s content.

toLine

The ending line of a log.

totalLines

Total lines of the log.