RTMP/E

 getConfig(key:String [,scope:String]) : Object

HTTP

 http://www.example.com:1111/admin/getConfig?auser=username&apswd=password&key=configkey[&scope=scope]

This API has been deprecated; use getConfig2().

Gets the value of a configuration parameter in a configuration file.

Virtual host administrators can view configuration parameters 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 parameters for the Server.xml and Adaptor.xml files. For a description of the XML configuration files, see Adobe Media Server Configuration and Administration Guide.

Availability

Flash Communication Server 1.0.

Parameters

key

A String indicating the configuration parameter 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 parameter. 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.

Depending on your permissions, you can get configuration parameters for the following files:

  • 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 parameters in the Server tag.

    Virtual host administrators can view configuration parameters 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 parameters correspond to keys 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 parameter 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

A String. To get a configuration parameter in the Server.xml file, Adaptor.xml file, or Vhost.xml file, specify a slash (/).

To get a configuration parameter 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 Adobe Media Server, omit this parameter.

Note: To determine the adaptor or virtual host to which you’re connected, use the getAdminContext() method.

auser

A String indicating the user name of the administrator.

apswd

A String indicating the password of the administrator.

Returns

RTMP/E

If the call succeeds, the server sends a reply information object with a level property of status, a code property of NetConnection.Call.Success, and a data object whose properties contain the values of the specified tag.

If the call fails (that is, if the specified configuration parameter isn’t found), the server returns an empty string.

HTTP

If the call succeeds, it returns XML with the following structure:

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

Nested in the data element are elements for each property of the data object listed in the RTMP/E section.

If the call fails, it returns XML with the following structure:

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

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

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

Examples

The following examples show how to get configuration keys in each of the four XML files:

 // Establish connection to server. 
 nc_admin = new NetConnection(); 
 nc_admin.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_admin.call("getConfig", new onGetConfig(), key, "/"); 
  
 // For a server administrator; find key in Server.xml. 
 key = "Server/LicenseInfo"; 
 nc_admin.call("getConfig", new onGetConfig(), key, "/"); 
  
 // Find key in Adaptor.xml. 
 key = "Adaptor:_defaultRoot_/HostPortList/HostPort"; 
 nc_admin.call("getConfig", new onGetConfig(), key, "/"); 
  
 // Find key in Vhost.xml. 
 key = "Adaptor:_defaultRoot_/VirtualHost:_defaultVhost_/RecordAccessLog"; 
 nc_admin.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_admin.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_admin.call("getConfig', new onGetConfig(), key, "/");

See also

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy