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
}
)