Add Method (Aliases collection)

                    

 

Adds an alias and its corresponding server name(handle) to the Aliases collection. Adds the alias to the Known Servers Table for the machine. 

 

Syntax

object.Add Alias, ServerHandle

The Add method syntax has these parts:

Part

Description

object

An object expression that evaluates to an Aliases collection.

Alias

A string containing the alias name to be associated with the passed handle. This may be an alternate serverID or alternate name in the case of the Aliases collection obtained from the Servers.Aliases property or an alternate server path in the case of the Servers.PathAliases property.

ServerHandle

A string containing a server name (handle) from the Known Servers Table. This server handle is mapped to the new alias.  Starting with version 1.3.6 of the PI-SDK, the server handle must exist before the alias can be added.

 

Remarks

Add will attempt to add the alias to the Aliases collection and the underlying persistent representation. In the case of the Servers.Aliases collection this will be the ServersAliases Table. In the case of the Servers.PathAliases collection this will be the PathAliases Table.

In order to store the new alias in the Known Servers Table, this method modifies the system registry. You may need to log in from a privileged account in order to use this and other methods that enter or modify values in the Known Servers Table.

 

The Servers.Item routine returns a Server object that matches the passed index.  It first compares the index to items in the Known Servers Table then checks if the index matches the name or ServerID of a member server of any collective in the Known Servers Table then checks the Servers.Aliases table for a match.  The first match is returned.  Adding aliases provides a way to obtain the proper server object when names persisted in displays, spreadsheets, and data files, don't match the current server name.  

 

Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:

Error

Description

pseALIASADD

Unable to add this alias to the Server Aliases table. There may already be an alias of this name. Try removing this aliases before adding.

psePATHALIASADD

Unable to add this alias to the Path Aliases table. There may already be an alias of this name.

pseSERVNOTFOUND The passed server handle for the alias to be constructed does not exist. 

Enabling Operational Intelligence