Server Management ActionScript Dictionary

fawnhobbiesSoftware and s/w Development

Jul 4, 2012 (4 years and 11 months ago)

458 views

Server Management
ActionScript Dictionary
Trademarks
1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central,
ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite,
FlashPaper, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder, Macromedia, MXML,
RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit, Studio MX, UltraDev,
and WebHelp are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in the United States or
in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within
this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and may be registered in
certain jurisdictions including internationally.
Third-Party Information
This guide contains links to third-party websites that are not under the control of Macromedia, and Macromedia is not
responsible for the content on any linked site. If you access a third-party website mentioned in this guide, then you do so at your
own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia
endorses or accepts any responsibility for the content on those third-party sites.
Sorenson™ Spark™ video compression and decompression technology licensed from
Sorenson Media, Inc.
Copyright © 2002-2005 Macromedia, Inc. All rights reserved. This manual may not be copied, photocopied, reproduced,
translated, or converted to any electronic or machine-readable form in whole or in part without written approval from
Macromedia, Inc. Notwithstanding the foregoing, the owner or authorized user of a valid copy of the software with which
this manual was provided may print out one copy of this manual from an electronic version of this manual for the sole
purpose of such owner or authorized user learning to use such software, provided that no part of this manual may be
printed out, reproduced, distributed, resold, or transmitted for any other purposes, including, without limitation,
commercial purposes, such as selling copies of this documentation or providing paid-for support services.
Acknowledgments
Project Management: Suzanne Smith
Writing: Jody Bleyle
Managing Editor: Rosana Francescato
Editing: Geta Carlson
Production Manager: Patrice O’Neill
Media Design and Production: Adam Barnett, Aaron Begley, Paul Benkman, John Francis, Mario Reynoso
Special thanks to Erick Vera and the Flash Media Server engineering and QA teams.
First Edition: October 2005
Macromedia, Inc.
601 Townsend St.
San Francisco, CA 94103
3
Contents
Chapter 1: Server Management ActionScript Dictionary. . . . . . . .5
Using the Server Management ActionScript API . . . . . . . . . . . . . . . . . . .5
Establishing the connection to the server. . . . . . . . . . . . . . . . . . . . . . . . . .5
A simple application example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
Information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
Method summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
addAdmin() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
addApp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
addVHostAlias(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
approveDebugSession(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
changePswd(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
gc(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
getActiveInstances() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
getAdaptors() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
getAdminContext(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
getAdmins(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
getApps() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
getAppStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
getConfig(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
getConfig2() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
getGroupMembers() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
getGroupStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
getGroups() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
getInstanceStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
getIOStats(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
getLicenseInfo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37
getLiveStreams() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
getLiveStreamStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
getMsgCacheStats(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
getNetStreams(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
getNetStreamStats(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
getRecordedStreams(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
getRecordedStreamStats(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
getScriptStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4
getServerStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
getServices() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48
getSharedObjects() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49
getSharedObjectStats(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50
getUsers() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
getUserStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
getVHosts(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53
getVHostStats(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
ping() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56
reloadApp(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56
removeAdmin() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
removeApp(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
removeVHostAlias() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
restartVHost(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
setConfig() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
setConfig2() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
startServer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68
startVHost() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
stopServer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70
stopVHost() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
unloadApp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5
1
CHAPTER 1
Server Management
ActionScript Dictionary
Macromedia Flash Media Server includes a set of advanced methods, the Server Management
ActionScript application programming interface (API), that lets you extend the management
console or make your own administration and monitoring tools by creating Macromedia
Flash applications.
This document describes the Server Management ActionScript API. For information about
ActionScript, see the ActionScript 2.0 Language Reference. For information about Flash Media
Server, see the Client-Side ActionScript Language Reference for Flash Media Server 2, the
Server-Side ActionScript Language Reference, and Managing Flash Media Server.
Using the Server Management
ActionScript API
To use the Server Management ActionScript API, you need to have Flash and Flash Media
Server installed, and you need to have administrative access to Flash Media Server. You should
be fluent in ActionScript and in creating Flash applications.
Establishing the connection to the server
Flash Media Server communicates on port 1935 (the default port). However, to use the Server
Management ActionScript API, you must connect to Flash Media Server through the
administration server on port 1111.
You establish a connection using the
NetConnection.connect()
method, passing in three
parameters: the URI of the host administration server, an administrator user name, and an
administrator password.
NOTE
This document assumes that you have not changed the default port number for the
administration server; if you have, use your valid port number instead of port 1111.
6 Server Management ActionScript Dictionary
When the administration server host to which you want to connect is a virtual host (one of
several services on the same machine), make sure to specify the virtual host’s domain name, or
IP Address, as part of the URI—for example,
rtmp://www.myVhost.com/admin:1111
. That
way, when you connect to the host machine, you connect to an instance of the server running
on your specified virtual host.
Only valid administrators, as defined in the Users.xml configuration file, can connect to the
server. You must specify two administrative parameters, the user name and the password for a
valid administrator, to the
NetConnection.connect
method.
The following example shows the call that lets the administrator
MHill
with password
635xjh27
connect to the server on
localhost
:
nc = new NetConnection();
nc.connect("rtmp://localhost:1111/admin", "MHill", "635xjh27");
To prevent unauthorized users from accessing the administration server, you should use a
firewall and limit access to the administration server port (port 1111). For more information
about security for Flash Media Server, see the security white papers at www.macromedia.com/
go/flashmediaserver_security_en.
Syntax example
To make a Server Management ActionScript API call, you’ll want to include a callback
handler and any required parameters in your code.
In the following example, the
getAppStats
method is called to retrieve the performance data
of a running application; the callback handler
new receiveAppStats
captures the result of
the call; and the value
ChatApp
is a required parameter that specifies the name of the
application:
nc = new NetConnection();
nc.connect("rtmp://localhost:1111/admin", "MHill", "635xjh27");
// Call getAppStats
nc.call("getAppStats", new receiveAppStats(), "ChatApp");
A simple application example 7
A simple application example
This section contains the code for a simple Flash application that calls the
getAppStats

method. You can copy and paste this code into Flash to see how a simple call works.
In Flash, create an application with the following elements:

An input field named Application Name with a border

A button that calls the
doGetAppStats()
method (shown in the code sample that
follows)

A multiline, dynamic text field called outputBox that has a border

A scroll component next to the text field
This simple interface lets you test the Server Management ActionScript API.
Next, in the Actions panel, enter the sample ActionScript code that follows. Be sure to replace
admin_name
and
admin_pass
with your valid administrator name and password.
/** Establishes the connection to Flash Media Server **/
nc = new NetConnection();
nc.connect("rtmp://localhost:1111/admin","admin_name","admin_pass");
/** Makes the API call, for example, "GetAppStats" **/
function doGetAppStats() {
function onGetAppStats()
{
this.onResult = function(info)
{
if (info.code != "NetConnection.Call.Success")
outputBox.text = "Call failed: " + info.description;
else {
outputBox.text = "Info for "+appName.text+ " returned:" + ¬
newline;
printObj(info, outputBox);
}
}
}
nc.call("getAppStats", new onGetAppStats(), appName.text);
}
// This function proceeds through an object, printing all values to the
// destination, including recursively printing objects within objects.
// The tabLevel parameter is used for cosmetic purposes.
function printObj(obj, destination, tabLevel)
NOTE
The continuation character (
¬
) indicates that the code continues to the next line; this
character should not appear in code.
8 Server Management ActionScript Dictionary
{
if(arguments.length < 2) {
trace("ERROR! you need to supply a text object to output to");
return;
}
if (arguments.length < 3)
tabLevel = 0;

for (var prop in obj) {
for (var i = 0; i < tabLevel; i++) // insert requested # of tab
characters
destination.text += "\t";

destination.text += prop + " = " + obj[prop] + newline;
if (typeof (obj[prop]) == "object") { // recursively call printObj
printObj(obj[prop], destination, tabLevel+1 );
}
}
}
// Alerts you if there are errors connecting to the server.nc.onStatus =
function(info) {
if (info.code == "NetConnection.Connect.Success") {
trace("Connected! The call should work")
} else {
// Use nc.isConnected to test condition of server
if (! nc.isConnected)
trace("NO netConnection to server. Call will not work");
}
}
Method summary 9
Information objects
All Server Management ActionScript API methods return data in an information object with
the following properties:
level
,
code
,
timestamp
,
data
,
description
, and
details
. All
information objects have
level
,
code
, and
timestamp
properties. Some methods have the
data
property, which contains return data (often in an object or array), and the
description

and
details
properties, which typically provide information about errors.
In addition to the information objects that are documented in the Client-Side ActionScript
Language Reference for Flash Media Server 2, the NetConnection class has information objects
that are specific to the Server Management ActionScript API. The following table lists the
code
and
level
properties, as well as the meaning of commonly returned information
objects.
Method summary
The Server Management ActionScript API contains the following three types of methods:

Queries let you monitor Flash Media Server, its applications, and specific instances of its
applications.

Administrative commands let you perform administrative tasks for Flash Media Server,
such as adding administrative users and starting and stopping the server, virtual hosts, and
applications.

Configuration commands: the
getConfig2()
command lets you view server
configuration keys, and the
setConfig2()
command lets you set values for the keys.
Code Level Meaning
NetConnection.Call.Success Status
The call is successful.
This information object includes a
data

property, which returns detailed information
in an object or array.
NetConnection.Admin.CommandFailed Error
The method called is nonexistent.*
NetConnection.Call.Failed Error
A general failure has occurred.*
NetConnection.Call.BadValue Error
The value of a parameter is invalid.*
* This information object contains description and detail properties, which are strings that
provide a more specific reason for the failure.
10 Server Management ActionScript Dictionary
Some methods are available only to server administrators, as indicated by an asterisk (*) in the
description of each method; virtual host administrators cannot use these methods. In some
cases, virtual administrators can use a method with restrictions; these restrictions are described
in the dictionary entry for the method.
Queries for monitoring the server
The following table lists the methods you can use to monitor the server.
NOTE
Parameters in square brackets (
[]
) are optional; all other parameters are required. If you
don’t specify an optional parameter, a default value might be used, depending on the
method. For example, if you don’t specify a virtual host in the
scope
parameter, it is
assumed that you want to perform the command on the virtual host to which you
connected when you logged on to Flash Media Server.
Method Description
approveDebugSession()
Approves a pending debug session’s request to connect to a
selected application.
getActiveInstances()
Returns an array of strings that contains the names of all running
application instances on the connected virtual host.
getAdaptors()
Returns an array of adaptor names.
getAdminContext()
Returns the administrative context for the administrator
(administrator type, name of adaptor, and name of the virtual
host).
getAdmins()
Returns all the administrators on the Flash Media Server.
getApps()
Returns an array of strings that contains the names of all the
applications that are installed.
getAppStats()
Returns aggregate information of all instances for an application.
getGroupMembers()
Returns a list of the group members for a particular group.
getGroupStats()
Returns statistics for a particular group connection.
getGroups()
Returns a list of the group connections for a particular application
instance.
getInstanceStats()
Returns detailed information about a single running instance of
an application.
getIOStats()
Returns the I/O information: bytes in, bytes out, and so on.*
getLicenseInfo()
Returns license key information.
getLiveStreams()
Returns a list of all live streams currently publishing to a particular
application.
Method summary 11
getLiveStreamStats()
Returns detailed information about a live stream.
getMsgCacheStats()
Returns server TCMessage cache statistics.
getNetStreams()
Returns a list of all network streams that are currently connected
to the application.
getNetStreamStats()
Returns detailed information about a specific network stream.
getRecordedStreamStats()
Returns detailed information about a recorded stream.
getRecordedStreams()
Returns an Array containing the name of all the recorded streams
currently playing from a particular instance of an application.
getScriptStats()
Gets the performance data for a script running on the specified
instance of an application.
getServerStats()
Retrieves the server status and statistics about the operation of
the server, including the length of time the server has been
running and I/O and message cache statistics.*
getServices()
Returns an array containing the names of all the services
currently connected to Flash Media Server.
getSharedObjects()
Returns a list of all persistent and nonpersistent shared objects
that are currently in use by the specified instance of an
application.
getSharedObjectStats()
Returns detailed information about a shared object.
getUsers()
Returns a list of all users who are currently connected to the
specified instance of an application.
getUserStats()
Returns detailed information about a specified user.
getVHosts()
Returns an array of vhosts defined for the specified adaptor.
getVHostStats()
Returns statistics for a vhost.
ping()
Returns a status string indicating the condition of the server.
* Only server administrators can use this method.
Method Description
12 Server Management ActionScript Dictionary
Commands for managing the server
The following table lists the methods you can use to manage the server.
Commands for configuring the server
The following table lists the methods you can use to configure the server.
Entries in this document are listed alphabetically.
Method Brief description
addAdmin()
Adds an administrator to the system.*
* Only server administrators can use this command.
addApp()
Adds a new application.
addVHostAlias()
Adds an alias to a virtual host.
changePswd()
Changes the password for an administrator in the system.
gc()
Forces garbage collection of server resources.*
reloadApp()
Unloads an instance of an application if it is loaded, and then reloads the
instance.
removeAdmin()
Removes an administrator from the system.*
removeApp()
Removes an application or an instance of an application.
removeVHostAlias()
Removes an alias from a virtual host.
restartVHost()
Restarts a virtual host.
startServer()
Starts or restarts Flash Media Server.*
startVHost()
Starts the specified virtual host if it stops. Enables a new virtual host if
the virtual host directories have been created in the file system.*
stopServer()
Shuts down the Flash Media Server.*
stopVHost()
Stops a virtual host.
unloadApp()
Unloads all instances of an application or one instance of an application.
Disconnects all users.
Method Description
getConfig2()
Returns configuration information for the specified configuration key.
setConfig2()
Sets a value for a specified configuration key.
addAdmin() 13
addAdmin()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
addAdmin(admin_name, password [,scope])
Parameters
admin_name
A string that contains the user name of the administrator being added.
password
Password of that administrator. The password is encoded before it is written to
the Server.xml configuration file.
scope
Optional; string that specifies whether the administrator is a server administrator or a
virtual host administrator, and for which virtual host. To add a server administrator, specify
server
.
To add a virtual host administrator to the virtual host to which you’re connected, omit this
parameter. To add a virtual host administrator to a different virtual host, specify the virtual
host as
adaptor_name/virtual_host_name
.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
and a
code
property of
NetConnection.Call.Success
. The Server.xml
configuration file is updated with the new administrator.
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Admin.CommandFailed
or a more specific value, if
available. Some objects might also have a
description
property that contains a string
describing the cause of the failure.
If the specified administrator already exists in the system, this command fails.
Description
Adds an administrator to the system. You can add a server administrator or a virtual host
administrator, depending on the parameters you specify.
You must be a server administrator to add an administrator to the system.
14 Server Management ActionScript Dictionary
Example
The following three examples show how you can specify parameters in a call to the
addAdmin

command:
/* Adds a server administrator named "GLee" with password "boat4907" */
nc.call("addAdmin", new onAddAdmin(), "GLee", "boat4907", "server");
/* Adds a virtual host administrator named "ChrisM" with password "tree2981"
*/
nc.call("addAdmin", new onAddAdmin(), "ChrisM", "tree2981");
/* Adds a virtual host administrator "DHong" with password "wate3235" */
/* for vhost tree.oak.com */
nc.call("addAdmin", new onAddAdmin(), "DHong", "wate3235", "_defaultRoot_/¬
tree.oak.com");
addApp()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
addApp(app_name)
Parameters
app_name
A string that contains the name of the application to be added.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
and a
code
property of
NetConnection.Call.Success
.
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.BadValue
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
Description
Adds a new application to the virtual host by creating the required directory for the new
application in the directory tree. Once the directory for the new application is created, you (or
another administrator with file system access) can put any required server-side scripts in the
directory. The client-side code uses the new application directory in the URI parameter of the
NetConnection.Connect
call.
addVHostAlias() 15
Example
The following example shows a call to add the
ChatApp
application to the connected virtual
host:
nc = new NetConnection();
nc.connect("rtmp://localhost:1111/admin", "JLee", "x52z49ab");
nc.call("addApp", new onAddApp(), "ChatApp");
addVHostAlias()
Availability

Flash Player 6.

Flash Media Server 2.
Usage
addVHostAlias(VHostName, AliasName, PersistValue)
Parameters
VHostName
A string indicating the virtual host to which to add an alias.
AliasName
A string indicating the alias name to add to the specified vhost.
PersistValue
A Boolean value indicating whether the alias change will be written to the
configuration file to last beyond the vhost's next restart (true), or whether this alias will be lost
on vhost restart (false).
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, and a
code
property of
NetConnection.Call.Success
.
Description
Adds an alias to a virtual host. Aliases are alternative names for vhosts that are used as targets
by incoming Flash Media Server connections. When you remove an alias, that name is no
longer available for incoming connections.
Before this API was available, alias names had to be added to the configuration files manually.
See also
removeVHostAlias()
16 Server Management ActionScript Dictionary
approveDebugSession()
Availability

Flash Player 6.

Flash Media Server 2.
Usage
approveDebugSession(appInst, PIN)
Parameters
appInst
A string indicating the application and instance name that has a pending debug
connection to approve.
PIN
A number indicating the debug session Personal Identification Number. Each debug
connection issues a debug number when queueing to connect to an application. This same
number is included on this API. When this API is processed, the PIN numbers are matched
and the corresponding connection is allowed to connect. This is a security measure to prevent
unauthorized users from using the debug connection.
Keep in mind that 0 is not a valid
PIN
value. To maintain security, PIN numbers should not
be able to be easily guessed. PIN numbers must be non-zero and must be within the range of
+/- (2^31 - 1) that is between positive or negative 2147483648. If there is a pending
connection with a given PIN, and another connection arrives with the same PIN while the
original is still waiting, the second connection with the same PIN will be rejected as a security
measure.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
.
Description
Approves a pending debug session’s request to connect to a selected application. Once
approved and permitted, the debug session may connect to its application through the
Services.onDebugConnect
gateway and act as a regular client.
Connecting to an application with a debug session allows you to view the streams and shared
objects for an application through the management console.
Example
The following is an example of a Debug connection:
nc.connect("rtmp://serverName/appName%3F%5Ffcs%5Fdebugreq%5F%3D1234");
// The original string is _fcs_debugreq_=1234.
changePswd() 17
The following is an example of a Debug approval request:
nc_admin.call("approveDebugSession", null, appName/instName", 1234);
changePswd()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
changePswd(admin_name, password [, scope])
Parameters
admin_name
A string that contains the name of the administrator whose password is being
changed.
password
A string that contains that administrator’s new password.
scope
Optional; a string that specifies whether the administrator is a server administrator or
virtual host administrator, and for which virtual host.
To change the password for the specified administrator on the virtual host to which you’re
connected, omit this parameter. To change the password for the specified administrator on a
different virtual host, specify
adaptor_name/virtual_hostname
.
To change a server administrator’s password, specify
server
.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
and a
code
property of
NetConnection.Call.Success
.
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Admin.CommandFailed
or a more specific value, if
available. Some objects might also have a
description
property that contains a string
describing the cause of the failure.
If the specified administrator does not exist, this command fails.
Description
Changes the password for the specified administrator. The password is encoded before it is
written to the Server.xml configuration file.
Virtual host administrators can change only their own password.
18 Server Management ActionScript Dictionary
Example
/* Change password for server administrator named "ASilva" to "cbx5978y" */
nc.call("changePswd", new onChangePswd(), "ASilva", "cbx5978y", "server");
/* Change password for virtual host administrator named "JLee" to "kbat3786"
*/
nc.call("changePswd", new onChangePswd(), "JLee", "kbat3786");
/* Change password for virtual host administrator "JLee" to "kbat3786" on */
/* virtual host "tree.oak.com" */
nc.call("changePswd", new onChangePswd(), "JLee", "kbat3786",
"_defaultRoot_/¬ tree.oak.com");
gc()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
gc()
Parameters
None.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
and a
code
property of
NetConnection.Call.Success
.
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Admin.CommandFailed
or a more specific value, if
available. Some objects might also have a
description
property that contains a string
describing the cause of the failure.
Description
Forces collection and elimination of all server resources that are no longer used, such as closed
streams, instances of applications, and nonpersistent shared objects. This operation is
performed within about one second of the call.
You must be a server administrator to perform this operation.
getAdaptors() 19
getActiveInstances()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getActiveInstances([processID])
Parameters
processID
A number; the process identifier of a Flash Media Server core process. This
parameter is optional.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
array of strings containing the names of all running instances of an application on the server
or on a specified process.
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.Failed
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
Description
Returns an array of strings that contains the names of all running application instances on the
entire server (if no
processID
parameter is passed), or on the process specified by the
processID
parameter.
getAdaptors()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getAdaptors()
Parameters
None.
20 Server Management ActionScript Dictionary
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
array of strings containing the names of all the adaptors.
Description
Returns an array of adaptors that are defined. You must be a server administrator to perform
this command.
getAdminContext()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getAdminContext([adminName][,

adaptorName][,

vhostName])
Parameters
adminName
The name of an administrator.
adaptorName
An alternate adaptor, other than
_defaultRoot_
, on which to find
administrators. If not specified,
_defaultRoot_
is used
vhostName
An alternate vhost, other than
_defaultVHost_
, on which to find vhost
administrators. If not specified, server level admin is used.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
object. The
data
object has the following properties:
Property Description
admin_type
String; the type of administrator, either
server
or
vhost
.
adaptor
String; name of the adaptor for which the user is an administrator.
vhost
String; name of the virtual host for which the user is an administrator.
connected
String; this property is deprecated and always returns
true
.
getAdmins() 21
Description
Gets the administrative context for an administrator, including information about the
specified user’s administrative permissions, the name of the adaptor and virtual host to which
the user is connected, and whether the user is currently connected to Flash Media Server.
getAdmins()
Availability

Flash Player 6.

Flash Media Server 2.
Usage
getAdmins(adaptorName)
Parameters
adaptorName
Alternate adaptor, other than
_defaultRoot_
, on which to find vhost
administrators. If not specified,
_defaultRoot_
is used.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
array. The
data
object has the following properties:
Description
Returns an array of all administrators on Flash Media Server. The returned data has two
top-level groups: server level administrators and vhost-level administrators. The server-level
administrators group is a simple list of names. The vhost administrators are subdivided by
vhost and each vhost contains a list of administrators names.
Property Description
server_admins
Array; an array of admin names.
admin name
String; name of an administrator.
vhost_admins
Array; an array of vhost names.
vhost
String; name of the virtual host for which the user is an administrator.
22 Server Management ActionScript Dictionary
getApps()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getApps()
Parameters
None.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
array of strings containing the names of all the applications that are installed.
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.Failed
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
Description
Returns an array of strings that contains the names of all the applications that are installed.
See also
getActiveInstances()
,
getAppStats()
,
getInstanceStats()
getAppStats()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getAppStats(app_name)
Parameters
app_name
A string that contains the name of the application for which you want
performance data.
getAppStats() 23
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
object. The
data
object has the following properties:
Property Description
accepted
Number; total number of connection attempts accepted by this
application.
bytes_in
Number; total number of bytes read by this application.
bytes_out
Number; total number of bytes written by this application.
connected
Number; total number of connections currently active.
launch_time
ActionScript Date object; time the application started.
msg_dropped
Number; total number of messages dropped by this application.
msg_in
Number; total number of messages processed by this
application.
msg_out
Number; total number of messages sent by this application.
normal_connects
Number; total number of normal connections.
virtual_connects
Number; total number of connections through a remote edge.
group_connects
Number; total number of remote edges that are connected.
service_connects
Number; total number of service connections.
service_requests
Number; total number of services requested.
admin_connects
Number; total number of admin connections.
debug_connects
Number; total number of debug connections.
rejected
Number; total number of connection attempts rejected by this
application.
total_connects
Number; total number of socket connections to the application
since the application was started.
total_disconnects
Number; total number of disconnections from the application
since the application was started.
total_instances_loaded
Number; total number of instances that have been loaded since
the application started.
This property does not represent the total number of active
instances loaded. To get the number of active instances loaded,
subtract the value of
total_instances_unloaded
from
total_instances_loaded
.
24 Server Management ActionScript Dictionary
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.Failed
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
Description
Gets aggregate performance data for all instances of the specified application.
See also
getApps()
,
getInstanceStats()
getConfig()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getConfig(key [,scope])
Parameters
key
A string that specifies the configuration key for which information is retrieved.
A key is specified as a list of subkeys that are delimited by slashes (
/
). The first subkey specifies
the XML configuration file that contains the desired configuration key. Subsequent subkeys
correspond to tags that are relative to the XML configuration file; the hierarchy and names of
the subkeys match the tags in the XML file.
total_instances_unloaded
Number; total number of instances that have been unloaded
since the application started.
up_time
Number; time, in seconds, the application has been running.
Property Description
getConfig() 25
Flash Media Server has four server configuration files: Server.xml, Adaptor.xml, Vhost.xml,
and Application.xml. Depending on your permissions, you can get configuration keys for all
these files, as described in the following list:

For the Server.xml file, specify
Admin
or
Server
as the first subkey. All subsequent keys
correspond to tags that are relative to the
Admin
or
Server
tag in the Server.xml file.
You must be a server administrator to view configuration keys in the
Server
tag.
Virtual host administrators can view configuration keys in the
Admin
tag for their own
virtual host only. They might not be able to view certain kinds of sensitive information;
for example, they can view the names of other administrators for their own virtual host,
but they cannot view those administrators’ passwords or permission settings.

For the Adaptor.xml file, specify as the first subkey
Adaptor:adaptor_name
, where
adaptor_name
is the name of the adaptor. All subsequent keys correspond to tags that are
relative to the
Adaptor
tag in the Adaptor.xml file.

For the Vhost.xml file, specify as the first subkey
Adaptor:adaptor_name/
VirtualHost:vhost_name
, where
adaptor_name
is the name of the adaptor and
vhost_name
is the name of the virtual host. All subsequent keys correspond to tags that
are relative to the
VirtualHost
tag in the Vhost.xml file.

For the Application.xml file of an application that is running on the same virtual host to
which you connected when you logged on to the administration server, specify as the first
subkey
Application:app_name
, where
app_name
is the name of the application.
To get a key in the Application.xml file for an application that is running on a different
virtual host, specify the full key
Adaptor:adaptor_name/VirtualHost:vhost_name/
Application:app_name
. You must also specify the
scope
parameter.
To get the default Application.xml file, specify
Application
without the colon (
:
) and
the
app_name
attribute.
scope
String; to get a configuration key in the Server.xml file, Adaptor.xml file, or
Vhost.xml file, specify a slash (
/
).
To get a configuration key in the Application.xml file for an application that is running on the
same virtual host to which you connected when you logged on to Flash Media Server, omit
this parameter.
TIP
To determine the adaptor or virtual host to which you’re connected, use the
getAdminContext
method.
26 Server Management ActionScript Dictionary
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
XML string for the specified tag.
If the call fails (that is, if the specified configuration key isn’t found), the server returns an
empty string.
Description
This API has been deprecated; use
getConfig2()
instead. Gets information for the specified
configuration key in a specified configuration file. Flash Media Server has four configuration
files: Server.xml, Adaptor.xml, Vhost.xml, and Application.xml.
Virtual host administrators can view configuration keys in the Vhost.xml file and
Application.xml files for their own virtual hosts.
You must be a server administrator to view most of the configuration keys for the Server.xml
and Adaptor.xml files.
For a description of the XML configuration files, see Managing Flash Media Server.
Examples
The following examples show how to get configuration keys in each of the four XML files:
// Establish connection to server.
nc = newNetConnection();
nc.connect("rtmp://localhost:1111/admin", "JLee", "xm1472dy");
// For a virtual host administrator, find key in Server.xml.
key = "Admin/Server/UserList/User:JLee/Password";
nc.call("getConfig", new onGetConfig(), key, "/");
// For a server administrator; find key in Server.xml.
key = "Server/LicenseInfo";
nc.call("getConfig", new onGetConfig(), key, "/");
// Find key in Adaptor.xml.
key = "Adaptor:_defaultRoot_/HostPortList/HostPort";
nc.call("getConfig", new onGetConfig(), key, "/");
TIP
It is possible to have more than one XML tag with the same name at the same level in the
XML tree. In the configuration file, you should distinguish such tags by using a name
attribute in the XML tag (for example, if you have more than one
VirtualHost
tag:
<VirtualHost name="www.redpin.com"></VirtualHost>)
. When you call the
getConfig

command and specify the configuration subkeys, you can indicate which tag you want
by specifying the tag name, followed by a colon and the correct
name
attribute, for
example,
Admin/Adaptor:_defaultRoot_/VirtualHost:www.redpin.com.
getConfig2() 27
// Find key in Vhost.xml.
key = "Adaptor:_defaultRoot_/VirtualHost:_defaultVhost_/RecordAccessLog";
nc.call("getConfig", new onGetConfig(), key, "/");
// Find key in Application.xml for an application on the virtual host you
// connected to when you logged on to the administration server.
// Note that the previous subkeys and the second parameter "/" are not
necessary.
key = "Application:FinanceApp/RecordAppLog";
nc.call("getConfig", new onGetConfig(), key);
// Find key in Application.xml for an application on a different virtual
host.
key = "Adaptor:_defaultRoot_/VirtualHost:www.redpin.com/
Application:ChatApp/ ¬ RecordAppLog";
nc.call("getConfig', new onGetConfig(), key, "/");
See also
getAdminContext()
,
setConfig()
getConfig2()
Availability

Flash Player 6.

Flash Media Server 2.
Usage
getConfig2(key ,scope)
Parameters
key
A string that specifies the configuration key for which information is retrieved.
A key is specified as a list of subkeys that are delimited by slashes (
/
). The first subkey specifies
the XML configuration file that contains the desired configuration key. Subsequent subkeys
correspond to tags that are relative to the XML configuration file; the hierarchy and names of
the subkeys match the tags in the XML file. If multiple tags exist with the same name and
same parent, they can be distinguished by specifying a "name" attribute and appending the
"name" attribute to the tag name separated by a colon in the
key
parameter. If the specified
tag is a leaf node, then its tag data is returned. If the specified tag is not a leaf node, the whole
tag is returned as an XML string.
scope
String; this parameter specifies which configuration file to search for the
configuration tag specified in the
key
parameter.
28 Server Management ActionScript Dictionary
Flash Media Server has six server configuration files: Server.xml, Users.xml, Logger.xml,
Adaptor.xml, Vhost.xml, and Application.xml. Depending on your permissions, you can get
configuration keys for all these files, as described in the following list:

"/" specifies Server.xml.

"Users" specifies Users.xml for server administrators.

"Logger" specifies Logger.xml.

"Adaptor:<adaptor_name>" specifies Adaptor.xml. The <adaptor_name> is the name of
the adaptor. You must have server administrator privileges to access this file. If
<adaptor_name> is not the name of the adaptor the caller is connected to, the call fails.

"Adaptor:<adaptor_name>/VHost:<vhost_name>" specifies VHost.xml. <vhost_name>
is the name of the vhost of interest. If <adaptor_name> is not the name of the adaptor the
caller is connected to, or <vhost_name> is not the name of the vhost that the caller is
connected to, the call fails.

"Adaptor:<adaptor_name>/VHost:<vhost_name>/Users.xml" specifies Users.xml for
vhost administrators.

"Adaptor:<adaptor_name>/VHost:<vhost_name>/App[:<app_name>]" specifies
Application.xml. If no <app_name> is specified, the default Application.xml file is
assumed. Otherwise, the application-specific Application.xml for the specified application
is used. If the specified application is not defined, or the application does not have an
application-specific Application.xml file, the call fails.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
XML string for the specified tag.
If the specified tag is a leaf node, returns the tag data. Otherwise, returns the tag itself. For
example, if the desired tag is
<foo>bar</foo>
, returns
"bar"
. However, if the desired tag
contains child tags such as
<foo><bar>foobar</bar></foo>
, returns
"
<foo><bar>foobar</bar></foo>"
.
If the call fails (that is, if the specified configuration key isn’t found), the server returns an
empty string.
TIP
To determine the adaptor or virtual host to which you’re connected, call the
getAdminContext()
method.
getConfig2() 29
Description
Gets information for the specified configuration key in a specified configuration file. Flash
Media Server has six server configuration files: Server.xml, Users.xml, Logger.xml,
Adaptor.xml, Vhost.xml, and Application.xml.
Virtual host administrators can view configuration keys in the Vhost.xml file and
Application.xml files for their own virtual hosts.
You must be a server administrator to view most of the configuration keys for the Server.xml
and Adaptor.xml files.
For a description of the XML configuration files, see Managing Flash Media Server.
Examples
The following examples get XML data from various configuration files:
tSocket = new NetConnection();
tSocket.connect("rtmp://localhost/admin", "user", "password");
// find key in Server.xml
key = "Server/LicenseInfo";
tSocket.call("getConfig2", new onGetConfig(), key, "/");
// find key in Adaptor.xml
key = "HostPortList/HostPort";
scope = "Adaptor:_defaultRoot_";
tSocket.call("getConfig2", new onGetConfig(), key, scope);
// find key in Vhost.xml
key = "AppsDir";
scope = "Adaptor:_defaultRoot_/VHost:_defaultVHost_";
tSocket.call("getConfig2", new onGetConfig(), key, scope);
// find key in Application.xml for app "foo"
key = "Process/Scope";
scope = "Adaptor:_defaultRoot_/VHost:_defaultVHost_/App:foo";
tSocket.call("getConfig2", new onGetConfig(), key, scope);
// find key in default Application.xml
key = "Process/Scope";
scope = "Adaptor:_defaultRoot_/VHost:_defaultVHost_/App";
TIP
It is possible to have more than one XML tag with the same name at the same level in the
XML tree. In the configuration file, you should distinguish such tags by using a name
attribute in the XML tag (for example, if you have more than one
VirtualHost
tag:
<VirtualHost name="www.redpin.com"></VirtualHost>)
. When you call the
getConfig

command and specify the configuration subkeys, you can indicate which tag you want
by specifying the tag name, followed by a colon and the correct
name
attribute, for
example,
Admin/Adaptor:_defaultRoot_/VirtualHost:www.redpin.com
.
30 Server Management ActionScript Dictionary
tSocket.call("getConfig2", new onGetConfig(), key, scope);
// return the whole Vhost.xml
key = "";
scope = "Adaptor:_defaultRoot_/VHost:_defaultVHost_";
tSocket.call("getConfig2", new onGetConfig(), key, scope);
See also
getAdminContext()
,
setConfig2()
getGroupMembers()
Availability

Flash Player 6.

Flash Media Server 2.
Usage
getGroupMembers(app_instance, groupNumber)
Parameters
app_instance
A string that contains the name of the instance of the application on which
the group resides, in the form
application_name/instance_name
. You must specify both
the application name and the instance name, separated by a slash (
/
), even if you want
performance statistics for the default instance of the application.
For example, to specify the default instance for an application named
ChatApp
, specify
ChatApp/_defInst_
.
groupNumber
A number that contains the group’s client ID.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
array containing the client IDs of all the individual clients connected through this group.
Description
Returns a list of the group members for a particular group. Groups are multiplexed
connections from a remote edge server to an origin server. Each group connection represents
at least one individual connection to another Flash Media Server that is acting as proxy for
this server.
See also
getGroups()
,
getGroupStats()
getGroupStats() 31
getGroupStats()
Availability

Flash Player 6.

Flash Media Server 2.
Usage
getGroupStats(app_instance, groupNumber)
Parameters
app_instance
A string that contains the name of the instance of the application on which
the group resides, in the form
application_name/instance_name
. You must specify both
the application name and the instance name, separated by a slash (
/
), even if you want
performance statistics for the default instance of the application.
For example, to specify the default instance for an application named
ChatApp
, specify
ChatApp/_defInst_
.
groupNumber
A number that contains the group’s client ID.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
object containing the client performance data. The
data
object has the following properties:
Property Description
connect_time
ActionScript Date object; time the application connected to the server.
protocol
String; protocol used by the client to connect to the server (rtmp or rtmpt).
msg_in
Number; total number of messages processed by this application.
msg_out
Number; total number of messages sent by this application.
msg_dropped
Number; total number of messages dropped by this application.
bytes_in
Number; total number of bytes read by this application.
bytes_out
Number; total number of bytes written by this application.
msg_queue
Object; client message queue statistics.
total_queues
Number; total number of queues for this client.
audio
Number; total number of audio messages in all audio queues.
video
Number; total number of video messages in all video queues.
other
Number; total number of cmd/data messages in the “other” queue.
32 Server Management ActionScript Dictionary
Description
Gets statistics for a particular group connection. This connection is special because it
multiplexes for more than one connection and contains a unique statistic called
members_count
. Group connections are established from one server to another as proxies.
See also
getGroups()
,
getGroupMembers()
getGroups()
Availability

Flash Player 6.

Flash Media Server 2.
Usage
getGroups(app_instance)
Parameters
app_instance
A string that contains the name of the instance of the application for which
you want performance statistics, in the form
application_name/instance_name
. You must
specify both the application name and the instance name, separated by a slash (
/
), even if you
want performance statistics for the default instance of the application.
For example, to specify the default instance for an application named
ChatApp
, specify
ChatApp/_defInst_
.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
and a
data
property that is an
array of the client IDs of all groups connected to this application.
stream_ids
Array; an array of numbers (stream IDs).
members_count
Number; the number of clients multiplexing on this group connection.
Property Description
getInstanceStats() 33
Description
Returns a list of the group connections for a particular application instance. Groups are
multiplexed connections from a remote edge server to an origin server. Each group
connection represents at least one individual connection to another Flash Media Server server
that is acting as proxy for this server.
See also
getGroupMembers()
,
getGroupStats()
getInstanceStats()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getInstanceStats(app_instance)
Parameters
app_instance
A string that contains the name of the instance of the application for which
you want performance statistics, in the form
application_name/instance_name
. You must
specify both the application name and the instance name, separated by a slash (
/
), even if you
want performance statistics for the default instance of the application.
For example, to specify the default instance for an application named
ChatApp
, specify
ChatApp/_defInst_
.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
object. The
data
object has the following properties:
Property Description
launch_time
ActionScript Date object; time the instance was launched.
up_time
Number; length of time, in seconds, the instance has been running.
msg_in
Number; total number of messages processed by this instance of
the application.
msg_out
Number; total number of messages sent by this instance of the
application.
34 Server Management ActionScript Dictionary
msg_dropped
Number; total number of messages dropped by this instance of the
application.
bytes_in
Number; total number of bytes read by this instance of the
application.
bytes_out
Number; total number of bytes written by this instance of the
application.
accepted
Number; total number of connection attempts accepted by this
application.
rejected
Number; total number of connection attempts rejected by this
application.
connected
Number; total number of connections currently active.
total_connects
Number; total number of socket connections to this instance of the
application since the instance was started.
total_disconnects
Number; total number of socket disconnections from this instance of
the application since the instance was started.
script
Object that contains script engine performance data. The following
are properties of the script object:
time_high_water_mark
: Number; maximum amount of time, in
seconds, that the script has taken to execute an event.
queue_size
: Number; total number of events currently in the script
engine queue.
total_processed
: Number; total number of events processed by the
script engine.
total_process_time
: Number; number of seconds taken to process
the number of events in
total_processed
.
queue_high_water_mark
: Number; maximum number of events in the
queue.
normal_connects
Number; total number of normal connections.
virtual_connects
Number; total number of connections through a remote edge.
group_connects
Number; total number of remote edges that are connected.
service_connects
Number; total number of service connections.
service_requests
Number; total number of services requested.
admin_connects
Number; total number of administrator connections.
debug_connects
Number; total number of debug connections.
Property Description
getIOStats() 35
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.Failed
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
Description
Gets the performance data for a specified instance of an application.
If you only need information about the performance of a specific script, use the
getScriptStats
method.
See also
getActiveInstances()
,
getAppStats()
,
getScriptStats()
getIOStats()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getIOStats()
Parameters
None.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
object. The
data
object has the following properties:
Property Description
msg_in
Number; total number of messages processed by the adaptor.
msg_out
Number; total number of messages sent by the adaptor.
bytes_in
Number; total number of bytes read by the adaptor.
bytes_out
Number; total number of bytes written by the adaptor.
reads
Number; total number of system read calls.
writes
Number; total number of system writes.
36 Server Management ActionScript Dictionary
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.Failed
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
Description
Returns detailed information about the network I/O characteristics of the connected adaptor.
You must be a server administrator to perform this operation.
connected
Number; number of currently active socket connections to the
adaptor.
total_connects
Number; total number of socket connections to the adaptor since
the adaptor was started.
total_disconnects
Number; total number of socket disconnections from the adaptor.
msg_dropped
Number; total number of messages dropped.
tunnel_bytes_in
Number; tunneling header bytes in (this is the overhead over and
above RTMP payload).
tunnel_bytes_out
Number; tunneling header bytes out (overhead in the other
direction).
tunnel_requests
Number; number of tunneling requests thus far.
tunnel_responses
Number; number of tunneling responses thus far.
tunnel_idle_requests
Number; number of tunneling requests that had no payload (network
chatter overhead).
tunnel_idle_responses
Number; number of tunneling responses that had no payload
(network chatter overhead).
normal_connects
Number; total number of normal connections.
virtual_connects
Number; total number of connections through a remote edge.
group_connects
Number; total number of remote edges that are connected.
service_connects
Number; total number of service connections.
service_requests
Number; total number of services requested.
admin_connects
Number; total number of admin connections.
debug_connects
Number; total number of debug connections.
Property Description
getLicenseInfo() 37
getLicenseInfo()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getLicenseInfo()
Parameters
None.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
object. The
data
object has the following properties:
Property Description
name
String; product name, for example, Flash Media Server.
version
String; version number, for example, 1.0.
build
String; build number.
copyright
String; copyright information.
key
String; license key that is set in the Server.xml file.
If you have more than one license key, this string is a concatenation of
all your valid license keys, delimited by semicolons (;).
type
Number; type of license. If you have multiple licenses, they must have
the same type number. Possible values are shown here:
0=Commercial
1=Educational
family
Number; license family, which determines the value of other properties.
If you have multiple licenses, they must have the same family number.
Possible values are shown here:
0=Personal
1=Professional
edition
Number; edition, for example, single, trial, beta, unlimited, and so on. If
you have multiple licenses, they must have the same edition number.
38 Server Management ActionScript Dictionary
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.Failed
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
max_connections
Number; maximum number of socket connections allowed, which is
determined by license family.
If you have more than one license, this number is the sum of the
max_connections
values of all your licenses.
max_adaptors
Number; maximum number of adaptors (network cards) that you can
configure for the server, which is determined by license family. If the
license family is Personal, the value of
max_adaptors
is 1.
max_vhosts
Number; maximum number of virtual hosts allowed, which is
determined by license family. If the license family is Personal, the value
of
max_vhosts
is 1.
max_cpu
Number; maximum number of CPUs allowed, which is determined by
license family.
If this number is greater than 1, you can run the server on multiprocessor
computers.
max_bandwidth
Number; maximum bandwidth, in megabits per second. If you have
multiple licenses, this number is the sum of the
max_bandwidth
values of
all your licenses.
key_details
Array; contains the information for each license key. If you have more
than one license key, there is one array element for each license key.
Each array element is an object that contains the following properties:
key
: String; license key as set in Server.xml.
type
: Number; 0=Commercial, 1=Educational.
family
: Number; 0=Personal, 1=Professional.
edition
: Number.
max_connections
: Number; maximum socket connections allowed for
this license.
max_adaptors
: Number; maximum adaptors (network cards) allowed for
this license. If the license family is Adaptor, this value is 1.
max_vhosts
: Number; maximum number of virtual hosts for each
adaptor, for this license. If the license family is Personal, this value is 1.
max_cpu
: Number; maximum number of CPUs allowed. If this number is
greater than 1, you can run the server on multiprocessor computers.
max_bandwidth
: Number; maximum bandwidth, in megabits per second.
product_code
: Number; determined by license family.
valid
: A Boolean value; 1=
true
, license is valid; 0=
false
, license is
invalid.
Property Description
getLiveStreams() 39
Description
Retrieves complete license information including information on the maximum bandwidth
and maximum number of connections, adaptors, virtual hosts, and CPUs that are allowed by
the license. License information for all your licenses is first summarized, followed by specific
information about each license.
getLiveStreams()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getLiveStreams(app_instance)
Parameters
app_instance
A string that contains the name of the instance of the application, in the
form
application_name/instance_name
.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
array of strings containing the names of all the live streams that are currently publishing to the
specified instance of an application.
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.Failed
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
Description
Gets an array of strings that contains the names of all the live streams that are currently
publishing to the specified instance of an application.
See also
getLiveStreamStats()
40 Server Management ActionScript Dictionary
getLiveStreamStats()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getLiveStreamStats(app_instance, stream_name)
Parameters
app_instance
A string that contains the name of the instance of the application, in the
form
application_name/instance_name
.
stream_name
A string that contains the name of the stream.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
object. The
data
object has the following properties:
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.Failed
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
Property Description
publisher
Object; publisher statistics. The object has the following properties:
name
: String; the name of the published live stream.
time
: Date object; time that the stream was published. This property is a
duplicate of
publish_time
and exists for backwards compatibility.
type
: String; the type of stream for the publisher. The value is
"publishing"
.
client
: Number; the client ID of the publisher.
stream_id
: Number; the stream ID of the publisher.
publish_time
: Date object; time that the stream was published.
client_type
: String; the string type of the publishing client.
publish_time
: Date object; time that the stream was published.
subscribers
Array of subscriber statistics. The array contains a
subscriber
property that is
an object containing the following properties:
client
: Number; user ID.
subscribe_time
: Date object; the time that the user subscribed to the stream.
getMsgCacheStats() 41
Description
Returns detailed information about a live stream.
See also
getLiveStreams()
getMsgCacheStats()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getMsgCacheStats()
Parameters
None.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
object. The
data
object has the following message cache statistics:
Description
Returns server TCMessage cache statistics. You must have server administrative privileges to
perform this operation.
Property Description
allocated
Number; total number of message objects allocated.
reused
Number; total number of objects used.
size
Number; current size.
42 Server Management ActionScript Dictionary
getNetStreams()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getNetStreams(app_instance)
Parameters
app_instance
A string that contains the name of the instance of the application, in the
form
application_name/instance_name
.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
array of numbers. The numbers represent the server-assigned IDs of all network streams that
are currently connected to the specified instance of the application.
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.Failed
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
Description
Returns an array of numbers that represent the server-assigned IDs of all the network streams
that are currently connected to the specified instance of the application.
See also
getNetStreamStats()
getNetStreamStats()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getNetStreamStats(app_instance, netstream_ID)
getNetStreamStats() 43
Parameters
app_instance
A string that contains the name of the instance of the application, in the
form
application_name/instance_name
.
netstream_ID
A number that represents the ID of the network stream or an array of
numbers that represents the network stream ID.
To get information for all the network streams that are currently connected, specify a value of
-1 for the
netstream_ID
parameter.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
array of statistics for the network stream. Each element in the array is an object that has the
following properties:
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.Failed
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
Description
Gets detailed information for one or more network streams that are connecting to the
specified instance of an application.
See also
getNetStreams()
Property Name
stream_id
Number; stream ID.
name
String; stream name or
empty
if the stream is idle.
type
String; stream type. Possible values are shown in the following list:
idle
publishing
playing live
play recorded
client
Number; user ID.
time
ActionScript Date object; possible values are shown in the following list:
If
type
=
idle
, value is 0.
If
type
=
publishing
, value is the time the stream was published.
If
type
=
playing live
, value is the time the playback of the stream started.
If
type
=
play recorded
, value is the time the playback of the stream started.
44 Server Management ActionScript Dictionary
getRecordedStreams()
Availability

Flash Player 6.

Flash Media Server 2.
Usage
getRecordedStreams(app_name)
Parameters
app_name
A string that contains the name of the application or instance of the application,
in the form
application_name[/instance_name]
.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a data property that is an
array of all the recorded stream names. The extended name of a recorded stream is used. The
name is encoded with
keyName*type:streamName
, where
keyName
is the virtual key,
type
is
the stream type (for example: flv, or mp3), and
streamName
is the text name of the stream.
The properties are defined in the following table:
Description
Returns an array containing the names of all the recorded streams currently playing from a
particular instance of an application.
See also
getRecordedStreamStats()
Property Name
streamName
String; name of the recorded stream.
type
String; type of the recorded stream.
keyName
String; virtual key of this recorded stream.
getRecordedStreamStats() 45
getRecordedStreamStats()
Availability

Flash Player 6.

Flash Media Server 2.
Usage
getRecordedStreamStats(app_instance, stream_name)
Parameters
app_instance
A string that contains the name of the instance of the application, in the
form
application_name/instance_name
.
stream_name
A string that contains the name of the stream. If the stream has a non-default
virtual key or type, these items should be encoded into the stream name. The following is an
example of how to encode key and type:
key?type:name
and
on2key?flv:myStream
.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
object that contains the following properties:
Description
Returns detailed information about a recorded stream.
See also
getRecordedStreams()
Property Name
cache_bytes
Number; total number of cached bytes of this recorded stream.
cache_segments
Number; number of segments cached for this recorded stream.
cache_hits
Number; number of hits on this stream within the cache.
cache_misses
Number; number of misses on the cache for this stream.
modified_time
ActionScript Date object; date when this file was last modified.
size
Number; number of bytes in this recorded file.
length
Number; length of this file in seconds.
46 Server Management ActionScript Dictionary
getScriptStats()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getScriptStats(app_instance)
Parameters
app_instance
A string that contains the name of the instance of the application, in the
form
application_name/instance_name
.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
object. The
data
object has the following properties:
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.Failed
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
Description
Gets the performance data for a script running on the specified instance of an application.
Property Description
time_high_water_mark
Number; maximum amount of time, in seconds, the script has
taken to execute an event.
queue_size
Number; total number of events currently in the script engine
queue.
total_processed
Number; total number of events processed by the script engine.
total_process_time
Number; number of seconds taken to process the number of
events in
total_processed
.
queue_high_water_mark
Number; maximum number of events in the queue.
getServerStats() 47
getServerStats()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getServerStats()
Parameters
None.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
object. The
data
object has the following properties:
Property Description
launchTime
ActionScript Date object; time the server was started.
up_time
Number; length of time, in seconds, that the server has been running.
io
I/O statistics, returned as an object with the following properties:
msg_in
: Number; total number of messages processed by the server.
msg_out
: Number; total number of messages sent by the server.
bytes_in
: Number; total number of bytes read by the server.
bytes_out
: Number; total number of bytes written by the server.
reads
: Number; total number of system read calls.
writes
: Number; total number of system writes.
connected
: Number; total number of active socket connections to the
server.
total_connects
: Number; total number of socket connections to the server.
total_disconnects
: Number; total number of socket disconnections from
the server.
msg_cache
Flash Media Server message packet cache statistics, returned as an object
with the following properties:
allocated
: Number; total number of message objects allocated.
reused
: Number; total number of objects reused.
size
: Number; size of the cache, in number of message packets.
48 Server Management ActionScript Dictionary
If the call fails, the server sends a reply information object with a
level
property of
error

and a
code
property of
NetConnection.Call.Failed
or a more specific value, if available.
Some objects might also have a
description
property that contains a string describing the
cause of the failure.
Description
Retrieves the server status and statistics about the operation of the server, including the length
of time the server has been running and I/O and message cache statistics.
You must be a server administrator to perform this operation.
If you only need information about the I/O characteristics of the server, use the
getIOStats

method instead.
See also
getIOStats()
getServices()
Availability

Flash Player 6.

Flash Media Server 2.
Usage
getServices()
Parameters
None.
Returns
If the call succeeds, the server sends a reply information object with a
level
property of
status
, a
code
property of
NetConnection.Call.Success
, and a
data
property that is an
array of strings containing the service names.
memory_Usage
Number. On Microsoft Windows NT 4.0, the approximate percentage of
the last 1000 pages of physical memory in use.
On Windows 2000 or Windows XP, the approximate percentage of total
physical memory in use.
cpu_Usage
Number; approximate percentage of CPU in use by the Flash Media Server
processes—not by the entire system.
Property Description
getSharedObjects() 49
Description
Returns an array containing the names of all the services currently connected to Flash Media
Server.
Special applications may connect and offer themselves as services to the Flash Media Server.
These connections can currently only come through the Java or C SDK for Flash Media
Server, as normal connections cannot register as a service. Each application may request the
use of these services, and the requested service will offer itself to the application.
getSharedObjects()
Availability

Flash Player 6.

Flash Communication Server MX 1.0.
Usage
getSharedObjects(app_instance)
Parameters
app_instance
A string that contains the name of the instance of the application, in the
form
application_name/instance_name
.
Returns