Skip to main content
Version: 8.3

system.config.rename

New in 8.3.8


This function is used in Python Scripting.

Description​

Renames the specified resource within its current collection. Use the move() function to transfer resources between collections.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.config.rename(*moduleId, typeId, [name], [collection], newName, [references], [actor])

tip

An asterisk indicates that all parameters following it are expecting keywords when the function is being called in your script. This means that, when using an asterisk-marked parameter, both the parameter and argument must be specified. For example, moduleId="ignition".

Parameters​

TypeParameterDescription
String*moduleIdThe module ID portion of the resource type identifier.
String*typeIdThe type ID portion of the resource type identifier.
String*nameThe name of the resource. Required for named resources, but must be omitted for singleton resources. [Optional]
String*collectionThe collection containing the resource. If omitted, uses the active definition. [Optional]
String*newNameThe new name for the resource.
String*referencesHow Ignition should handle references from other resources to the current value of the resource that is being renamed. Valid options are:
  • ABORT: Aborts the renaming operation.
  • UPDATE: Updates resources to use the new resource name.
  • IGNORE: Ignores any references to the old name and proceeds with the renaming operation.
[Optional]
String*actorA string identifying the actor performing the operation. If not specified, an identifier will be automatically generated. [Optional]

Returns​

PyResource - The resource that was renamed, as a PyResource that can also be read as plain Python properties.

Scope​

Gateway

Code Examples​

Code Snippet
# This example renames an existing database connection called "MySQL" to "coolSQL".
# Declare our parameter variables
moduleId = "ignition"
typeId = "database-connection"
name = "MySQL"
newName = "coolSQL"

# Call the rename() function
system.config.rename(moduleId=moduleId, typeId=typeId, name=name, newName=newName)