Inserting a crawler access rule, Retrieving crawler access rules – Google Search Appliance Administrative API Developers Guide: .NET User Manual
Page 13

Google Search Appliance: Administrative API Developer’s Guide: .NET
13
Crawler access rules instruct the crawler how to authenticate when crawling the protected content.
Inserting a Crawler Access Rule
Insert a new crawler access rule as follows:
// Create an entry to hold properties to insert
GsaEntry insertEntry = new GsaEntry();
// Add properties to insertEntry
insertEntry.AddGsaContent("entryID", "#URL pattern for the new crawler access
rule");
insertEntry.AddGsaContent("domain", "domainone");
insertEntry.AddGsaContent("isPublic", "1");
insertEntry.AddGsaContent("username", "username");
insertEntry.AddGsaContent("password", "password");
// Send the request
myService.InsertEntry("crawlAccessNTLM", insertEntry);
Retrieving Crawler Access Rules
Retrieve a list of crawler access rules as follows:
// Send a request and print the response
GsaFeed myFeed = myService.GetFeed("crawlAccessNTLM");
foreach(GsaEntry myEntry in myFeed.Entries) {
Console.WriteLine("URL Pattern: " + myEntry.GetGsaContent("urlPattern"));
Console.WriteLine("User Name: " + myEntry.GetGsaContent("username"));
Console.WriteLine("Order: " + myEntry.GetGsaContent("order"));
Console.WriteLine("Domain: " + myEntry.GetGsaContent("domain"));
Console.WriteLine("Is Public: " + myEntry.GetGsaContent("isPublic"));
}
Property
Description
domain
Windows domain for NTLM, or empty for HTTP Basic authorization.
isPublic
Indicates whether to allow users to view results of both the public
content (normally available to everyone) and the secure (confidential)
content. The value can be 1 to enable users to view content as public,
or 0 to require users to authenticate to view secure content.
order
Indicates that the crawler access rules are sequential. The order
indicates the sequence. The order is an integer value starting from 1.
password
Password for authentication.
urlPattern
URL pattern that matches the protected files.
username
User name for authentication.