« Back to Product

Documentation

IPS_GetConfigurationForParent

 string IPS_GetConfigurationForParent (int $InstanceID) 

Parameters

InstanceID

ID of the instance

Returns

JSON encoded object with the properties which the instance specifies for its parent instance. If the instance specifies nothing, "{}" is returned.

Description

The function returns the configuration which the instance with the ID InstanceID specifies for its parent instance. The result is a JSON encoded object whose keys are the names of the properties of the parent instance and whose values are the required values.

The management console uses this information to set the values when connecting or creating the parent instance. Properties specified this way can no longer be changed in the configuration form of the parent instance (see IPS_GetConfigurationsFromChildren).

For PHP modules, the result of the module's function GetConfigurationForParent is returned. If it is not implemented or returns an empty string, "{}" is returned. If the output does not start with "{" (e.g. on an error message from PHP), the function fails with this output as error. The specification may depend on the current configuration, e.g. on the type of the currently connected parent instance.

If the instance does not exist, the function fails with "Instance #... does not exist".

Example

// Determine the configuration which instance 12345 (e.g. an IRTrans Gateway connected to a Client Socket) specifies for its parent instance
echo IPS_GetConfigurationForParent(12345);

/* e.g. returns:
{"Port": 21000}
*/
Any questions?