Getting samples – Google Search Appliance Administrative API Developers Guide: .NET User Manual
Page 6

Google Search Appliance: Administrative API Developer’s Guide: .NET
6
The information in this section helps you understand how to write your own applications based on the
C#.NET client library and how to run the provided open source sample applications.
Before starting, you need the following:
•
Microsoft Visual C# 2008 Express Edition (
), which includes a free version of Visual Studio so that you can work with the .NET client
library.
•
The latest version of the API software, which contains the client library and the sample application
files. The API software is available at
.
•
Admin Console user name and password for the search appliance to which you direct your
commands.
Getting Samples
After you download the software and acquire search appliance credentials, get started as follows:
1.
Unzip the API ZIP file and navigate to the cs folder. The client library DLL files are present in the lib
folder and the sample application is present in the sample folder.
2.
Start Microsoft Visual C# 2008 Express Edition and click File > Open Project, browse to the location
where you stored the gsa.sln solution file, and open the solution file, which appears in the
Solution Explorer.
3.
Click Build > Build Solution to build the project. Ensure that the build runs without errors. The
binaries and DLL files are put in the cs\sample\bin \Release folder. The output binary is the
GsaCommandLine.exe executable file in the Release folder.
4.
Open a command prompt and run the command to view its options:
C:\GoogleDataAdministrativeAPI\cs\sample\bin\Release>GsaCommandLine.exe
Usage: GsaCommandLine
commands:
retrieve
update
insert
delete
options:
--protocol:
--hostname:
--port:
--username:
--password:
--input: The input entry file for insert/update
All the query parameters can be specified by --
Example:
GsaCommandLine retrieve --protocol=http --hostname=gsa1 --port=8000
--username=user --password=password config crawlURLs
C:\GoogleDataAdministrativeAPI\API-Gdata\cs\sample\bin\Release>
You can run a command using the parameters that are shown. Be sure for the host name to use just the
search appliance name and not a URL.