Server Management ActionScript Dictionary. Third-Party Information. Acknowledgments. Using the Server Management ActionScript API

Страницы работы

Фрагмент текста работы

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

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

3

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

4


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

CHAPTER 1

Server Management

ActionScript Dictionary

1

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.

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.

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.

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

Похожие материалы

Информация о работе