system.secrets.createEmbeddedSecretConfig
New in 8.3.8
This function is used in Python Scripting.
Description​
Creates a new Embedded SecretConfig instance given the JSON representation of the encrypted data.
Syntax​
system.secrets.createEmbeddedSecretConfig(json)
Parameters​
| Type | Parameter | Description |
|---|---|---|
| PyObject | json | The JSON object containing the encrypted secret. |
Returns​
PyOjbect - A Dictionary containing the JSON representation of an Embedded SecretConfig instance containing the encrypted secret.
Raises​
ValueError - Throws a ValueError if there is no JSON.
Scope​
Gateway, Vision Client, Perspective Session
Code Examples​
Code Snippet
# This example will take a user-specified secret and use it as an embedded password
# in the creation of an S7-1200 device using the Siemens Enhanced driver.
# Set the embedded secret
cipher = system.secrets.encrypt('myPassword')
embeddedConfig = system.secrets.createEmbeddedSecretConfig(cipher)
# Create the Siemens device with our embedded password
system.device.addDevice(
deviceType='com.inductiveautomation.ignition.siemens',
deviceName='siemensEnhanced',
deviceProps={
'hostname': '0.0.0.0',
'deviceType': 'S7_1200',
'password': embeddedConfig
}
)