addVHostAlias()

RTMP/E

 addVHostAlias(vhost:String, alias:String, persist:Boolean) : Object

HTTP

 http://www.example.com:1111/admin/addVHostAlias?auser=username&apswd=password&vhost=hostname&alias=alias&persist=value

Adds an alias to a virtual host. Aliases are alternative names for virtual hosts that are used as targets by incoming Adobe Media Server connections. When you remove an alias, that name is no longer available for incoming connections.

Availability

Flash Media Server 2.0.

Parameters

vhost

A String indicating the virtual host to which to add an alias.

alias

A String indicating the alias name to add to the specified virtual host.

persist

A Boolean value indicating whether the alias change will be written to the configuration file to last beyond the virtual host’s next restart (true), or whether this alias will be lost on virtual host restart (false).

auser

A String indicating the user name of the administrator.

apswd

A String indicating the password of the administrator.

Returns

RTMP/E

If the call succeeds, the server returns an Object with a level property of status and a code property of NetConnection.Call.Success. If the call fails, the server returns an Object with a level property of error and a code property of NetConnection.Admin.CommandFailed.

HTTP

A call returns XML with the following structure:

 <result>   <level></level>   <code></code>   <timestamp></timestamp>  </result>

The XML elements contain the same information as the Object properties returned in an RTMP/E call.

Note: The timestamp response over HTTP is formatted differently on Windows (9/23/2007 6:16:40 PM) and Linux (Sun 23 Sep 2007 06:16:40 PM IST).

Example

 nc_admin = new NetConnection(); 
 nc_admin.connect("rtmp://localhost:1111/admin", "JLee", "x52z49ab"); 
 nc_admin.call("addVHostAlias",new Result(),"myvhost","myalias",true);

See also

Get help faster and easier

New user?