background image

72

Server Management ActionScript Language Reference

Example

The following example stops the virtual host 

tree.oak.com

 and then stops the virtual host 

tree.oak.com

 on the default adaptor.

/* Stop the vhost named tree.oak.com */ 
nc.call("stopVHost", new onStopVHost(), "tree.oak.com"); 

/* Stop the vhost named tree.oak.com on the default adaptor */
nc.call("stopVHost", new onStopVHost(), "_defaultRoot_/tree.oak.com");

See also

restartVHost()

startVHost()

unloadApp()

Availability

Flash Player 6.

Flash Communication Server MX 1.0.

Usage

unloadApp(

app_instance

)

Parameters

app_instance

  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

 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.Command.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.

Содержание FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT...

Страница 1: ...Server Management ActionScript Language Reference...

Страница 2: ...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 So...

Страница 3: ...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...

Страница 4: ...haredObjectStats 50 getUsers 51 getUserStats 52 getVHosts 53 getVHostStats 54 ping 56 reloadApp 56 removeAdmin 57 removeApp 58 removeVHostAlias 59 restartVHost 60 setConfig 62 setConfig2 65 startServe...

Страница 5: ...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 Serve...

Страница 6: ...nect 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 firewal...

Страница 7: ...ace 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 admi...

Страница 8: ...aracters 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 connectin...

Страница 9: ...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 command...

Страница 10: ...o 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 arr...

Страница 11: ...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...

Страница 12: ...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 applicat...

Страница 13: ...st 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 NetConnect...

Страница 14: ...me 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...

Страница 15: ...lue 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...

Страница 16: ...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...

Страница 17: ...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 t...

Страница 18: ...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 re...

Страница 19: ...g 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...

Страница 20: ...ame 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 a...

Страница 21: ...ends 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 Descript...

Страница 22: ...erver 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...

Страница 23: ...cts 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_co...

Страница 24: ...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...

Страница 25: ...pecify 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 ta...

Страница 26: ...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 a...

Страница 27: ...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 su...

Страница 28: ...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...

Страница 29: ...st 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...

Страница 30: ...f 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 numbe...

Страница 31: ...l 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...

Страница 32: ...u 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 f...

Страница 33: ...me 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 t...

Страница 34: ...ject 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 a...

Страница 35: ...AppStats 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 obje...

Страница 36: ...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 d...

Страница 37: ...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 del...

Страница 38: ...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 yo...

Страница 39: ...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 t...

Страница 40: ...ilable 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 foll...

Страница 41: ...ply 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 De...

Страница 42: ...ned 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 an...

Страница 43: ...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 conta...

Страница 44: ...ata 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...

Страница 45: ...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 pro...

Страница 46: ...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...

Страница 47: ...al 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...

Страница 48: ...u 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...

Страница 49: ...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 pr...

Страница 50: ...bject 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 version Numb...

Страница 51: ...tion_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...

Страница 52: ...a object has the following properties Property Description connect_time ActionScript Date object time in seconds that the user has been connected to the specified instance of the application msg_in Nu...

Страница 53: ...the adaptor If not specified it is assumed to be _defaultRoot_ Returns If the call succeeds the server sends a reply information object with a level property of status a code property of NetConnectio...

Страница 54: ...property of status a code property of NetConnection Call Success and a data property that is an object containing the virtual host performance data The data object has the following properties Proper...

Страница 55: ...om total_instances_loaded total_instances_unloaded Number total number of instances that have been unloaded bw_in Number current bandwidth in in bytes per second bw_out Number current bandwidth out in...

Страница 56: ...ty 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 th...

Страница 57: ...reconnect to the application or instance of the application You can use this command to preload an instance of an application or reload it when application configuration changes are made or the script...

Страница 58: ...he call fails Description Removes an administrator from the system Depending on the parameters you specify you can remove server administrators or virtual host administrators You must be a server admi...

Страница 59: ...ied application or instance of an application from the virtual host First all instances of the specified application are unloaded Then the application directory is removed from the virtual host If you...

Страница 60: ...for vhosts that are used as targets by incoming Flash Media Server connections When you removing an alias that name is no longer available for incoming connections See also addVHostAlias restartVHost...

Страница 61: ...ver Users must reconnect each time you restart a virtual host Before using this command you might want to take steps to notify connected users Virtual host administrators can only restart the virtual...

Страница 62: ...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 adminis...

Страница 63: ...o Flash Media Server omit this parameter 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...

Страница 64: ...0 0 1 1938 key Adaptor _defaultRoot_ HostPortList HostPort val 128 0 0 1 1938 nc call setConfig new onSetConfig key val Change key in Vhost xml Set RecordAccessLog to true key Adaptor _defaultRoot_ Vi...

Страница 65: ...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 that XML configuration file the...

Страница 66: ...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 VHo...

Страница 67: ...nSetConfig key val set tag data in Adaptor xml key HostPortList HostPort val 1935 80 443 scope Adaptor _defaultRoot_ tSocket call setConfig2 new onSetConfig key val scope set tag data in Vhost xml key...

Страница 68: ...that specifies how you want to restart the server If the server is not running and you want to start it omit this parameter If the server is already running and you want to stop it and then restart i...

Страница 69: ...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 Command Failed or a...

Страница 70: ...ype String possible values are normal or abort If you use the value normal the server shuts down allowing running applications to end normally If you use the value abort the server immediately shuts d...

Страница 71: ...t_name You must be a server administrator to stop a virtual host other than the one to which you re connected Returns If the call succeeds the server sends a reply information object with a level prop...

Страница 72: ...Communication Server MX 1 0 Usage unloadApp app_instance Parameters app_instance A string that contains the name of the application or instance of the application in the form application_name instanc...

Страница 73: ...down and all the users who are connected to any instance of the application are immediately disconnected If an instance of an application is specified only that instance is shut down and all the users...

Страница 74: ...74 Server Management ActionScript Language Reference...

Отзывы: