Google Search Appliance: Administrative API Developer’s Guide: Java 6
• Apache Ant version 1.7 or later (http://ant.apache.org/).
• Admin Console user name and password for the search appliance to which you direct your
commands.
After you download the software and acquire search appliance credentials, get started as follows:
1. Browse to the Administrative API download site (https://code.google.com/p/google-enterprise-
gdata-api).
2. Download the ZIP file gsa-admin-api-java-1.0.1.zip (http://google-enterprise-gdata-
api.googlecode.com/files/gsa-admin-api-java-1.0.1.zip) containing the client library and the sample
application files.
3. Unzip the file and navigate to the
gdata/java
folder. The client library JAR files are present in the
lib
folder and the sample applications are present in the
sample
folder.
Running Samples
Sample applications are located in the
gdata/java/sample
folder.
To see if you’ve installed the required software correctly, open a command prompt and change directory
to the
gdata/java
folder. Enter the following command:
ant -f build-samples.xml sample.dashboard.run
This command displays build output messages and opens an example dashboard that demonstrates
the features of the Google Search Appliance Administrative API. You can add your search appliance
configuration information to the dashboard and see the dashboard running.
To find out how to run each sample, go to
gdata/java/build-samples
folder and view the build file for
each sample, like
dashboard.xml
,
commandline.xml
, and
aclclient.xml
. Look for the
samples run
comment. Another example of how to run the
commandline
sample application, enter the following
command in the
gdata/java
folder:
ant -f build-samples.xml -Dargs="retrieve --hostname=gsa_hostname
--username=gsa_user --password=gsa_passwd --protocol=http
--port=gsa_port config crawlURLs" sample.commandline.run
Substitute these parameters:
•
gsa_hostname
—The host name of a search appliance (specify just the host name, not the domain
name)
•
gsa_port
—Port 8000, access to the Admin Console on the search appliance
•
gsa_user
—The user name for the Admin Console on the search appliance
•
gsa_password
—The password for the Admin Console on the search appliance
For example:
ant -f build-samples.xml -Dargs=’retrieve --hostname=gsa42.corp.example.com
--username=admin --password=greenparrot --protocol=http
--port=8000 config crawlURLs’ sample.commandline.run
This command displays the crawl URLs for a search appliance.
The
commandline
sample application requires that command line arguments be passed to Ant by using
the
-Dargs
option in the
commandline.xml
file.
Comentários a estes Manuais