Skip to main content
Version: 8.3

system.config.move

New in 8.3.8


This function is used in Python Scripting.

Description​

Moves a resource to a different collection. The move operation changes which collection a resource belongs to, but does not allow renaming. Use the rename() operation to change a resource's name.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.config.move(*moduleId, typeId, [name], [collection], newCollection, signature, [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*newCollectionThe new collection for the resource to move to.
String*signatureThe hex-encoded signature of the resource.
String*actorA string identifying the actor performing the operation. If not specified, an identifier will be automatically generated. [Optional]

Returns​

PyResource - The Gateway resource that was moved, which can also be read as plain Python properties.

Scope​

Gateway

Code Examples​

Code Snippet
# This example takes an existing database connection and moves to into a collection called "dev".
# Use the getResource() function to retrieve the resource signature
moduleId = "ignition"
typeId = "database-connection"
name = "MySQL"

myResource = system.config.getResource(moduleId=moduleId, typeId=typeId, name=name)

newCollection = "dev"
signature = myResource.signature

system.config.move(moduleId=moduleId, typeId=typeId, name=name, newCollection=newCollection, signature=signature)