Aliasing Interface

The following are the RPC requests and responses added by the RPC_XML_Interface class. These methods are used to manage alias definitions stored on the gateway. Aliasing is used to transform the XML of received RPC requests; see Alias Parameter Type for some example use cases.

add_alias

Add one or more alias definitions.

Note

It is legal to use an existing alias in the definition of another alias. However, the first alias will be expanded prior to storing the second alias. If the first alias is later changed, the second alias will not reflect this change.

Request Parameters

Each parameter of this command is treated as an alias to be added. The parameter name will be the name of the alias and the parameter value will be the contents of the alias. Parameters must have type “xml” (see Complex Parameter Types). Aliases which have been previously defined will be overridden, though a separate warning message will be generated in this case.

Response Parameters

The response has the same format as the request. Only aliases which were successfully added will have parameters.

Example

Adds two aliases, THERMOSTAT_ADDRESS_ALIAS and ATTRIBUTE_ALIAS, which can be used when making later RPC requests.

<add_alias>
    <THERMOSTAT_ADDRESS_ALIAS type="xml">
        <destination_address type="MAC">11:22:33:44:55:66:77:88</destination_address>
        <destination_endpoint_id>0x10</destination_endpoint_id>
    </THERMOSTAT_ADDRESS_ALIAS>
    <ATTRIBUTE_ALIAS type="xml">
        <cluster_id>0x1234</cluster_id>
        <record_list type="list">
            <item type="ReadAttributeRecord">
                <attribute_id>0</attribute_id>
            </item>
            <item type="ReadAttributeRecord">
                <attribute_id>1</attribute_id>
            </item>
            <item type="ReadAttributeRecord">
                <attribute_id>2</attribute_id>
            </item>
        </record_list>
    </ATTRIBUTE_ALIAS>
</add_alias>

<add_alias_response>
    <THERMOSTAT_ADDRESS_ALIAS type="xml">
        <destination_address type="MAC">11:22:33:44:55:66:77:88</destination_address>
        <destination_endpoint_id>0x10</destination_endpoint_id>
    </THERMOSTAT_ADDRESS_ALIAS>
    <ATTRIBUTE_ALIAS type="xml">
        <cluster_id>0x1234</cluster_id>
        <record_list type="list">
            <item type="ReadAttributeRecord">
                <attribute_id>0</attribute_id>
            </item>
            <item type="ReadAttributeRecord">
                <attribute_id>1</attribute_id>
            </item>
            <item type="ReadAttributeRecord">
                <attribute_id>2</attribute_id>
            </item>
        </record_list>
    </ATTRIBUTE_ALIAS>
</add_alias_response>

remove_alias

Removes one or more alias definitions.

Request Parameters

Each parameter of this command is treated as an alias to be removed. The parameter name will be the name of the alias to remove. Parameters do not have a value.

Response Parameters

The response has the same general format as the request. The value of each parameter will be of type “bool” and indicate whether the alias was successfully removed.

Example

Removes two aliases, THERMOSTAT_ADDRESS_ALIAS and ATTRIBUTE_ALIAS.

<remove_alias>
    <THERMOSTAT_ADDRESS_ALIAS/>
    <ATTRIBUTE_ALIAS/>
</remove_alias>

<remove_alias_response>
    <THERMOSTAT_ADDRESS_ALIAS type="bool">TRUE</THERMOSTAT_ADDRESS_ALIAS>
    <ATTRIBUTE_ALIAS type="bool">TRUE</ATTRIBUTE_ALIAS>
</remove_alias_response>

list_aliases

Lists all alias definitions.

Request Parameters

None

Response Parameters

Each parameter represents an alias definition. The parameter name is the name of the alias and the parameter value is the contents of the alias. Parameters are always of type “xml”.

Example

There are two aliases currently defined, THERMOSTAT_ADDRESS_ALIAS and ATTRIBUTE_ALIAS.

<list_aliases/>

<list_aliases>
    <THERMOSTAT_ADDRESS_ALIAS type="xml">
        <destination_address type="MAC">11:22:33:44:55:66:77:88</destination_address>
        <destination_endpoint_id>0x10</destination_endpoint_id>
    </THERMOSTAT_ADDRESS_ALIAS>
    <ATTRIBUTE_ALIAS type="xml">
        <cluster_id>0x1234</cluster_id>
        <record_list type="list">
            <item type="ReadAttributeRecord">
                <attribute_id>0</attribute_id>
            </item>
            <item type="ReadAttributeRecord">
                <attribute_id>1</attribute_id>
            </item>
            <item type="ReadAttributeRecord">
                <attribute_id>2</attribute_id>
            </item>
        </record_list>
    </ATTRIBUTE_ALIAS>
</list_aliases>