synutils is the unified entry point in every notebook — a Python attribute and a Scala REPL alias. Each section below lists user-callable methods with examples in both languages.
infrastructure — platform infra metadata
The full method surface, side by side. Use the canonical method in new code. Legacy aliases exist only for backward compatibility with pre-integration notebooks.
Properties (read-only attributes)
Returns | Python | Scala | Legacy (Python) |
|---|---|---|---|
Cloud provider — |
|
|
|
Cloud region |
|
| — |
GCP project ID (empty for AWS/Azure) |
|
| — |
Default storage bucket |
|
| — |
Filesystem prefix ( |
|
| — |
Full storage path ( |
|
| — |
SSH connection type |
|
| — |
Metastore type ( |
|
| — |
Metastore hostname |
|
| — |
Section getters
Returns | Python | Scala | Legacy (Python) |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full payload (all sections) |
|
|
|
Global init script ( |
|
|
|
Drop the cached payload |
|
| — |
Generic accessors (backward-compat with legacy InfrastructureClient)
Returns | Python | Scala | Legacy (Python) |
|---|---|---|---|
Any |
| (use |
|
Same — alias |
| — |
|
Full payload (legacy typo preserved) |
| — |
|
The token parameter is accepted on the legacy aliases but ignored — auth is handled by the underlying ApiClient at construction. Sensitive values under security / metastore come back as SecretString (redact on print, work as plain str with SDKs).
# Generic — fetch any section dynamically
synutils.infrastructure.get("storage") # plain dict
synutils.infrastructure.get("notebookConfig") # {"script": "..."}
synutils.infrastructure.get("security") # values redact when printed
# Legacy aliases
synutils.infrastructure.get_from_metadata("storage")
synutils.infrastructure.get_infrasturcture_json() # full nested payload
Python returns
dicteverywhere; Scala returnsMap[String, AnyRef]. Same shape, language-native types.
Secret fields (encrypted + sealed)
Encrypted fields are auto-decrypted by the platform and wrapped in SecretString so they redact in print / log output. Pull a value out of the dict and call .get() / .unseal() to reveal the decrypted plaintext.
Section | Secret field names |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If decryption fails (no key, malformed ciphertext) the original ciphertext is preserved and a warning is logged — print(meta["metastorePassword"]) still redacts to **********, but .get() returns the raw ciphertext rather than the plaintext.
The seven subsections above are not exposed as individual section getters; access them via getAll() / asDict() / get_infrasturcture_json() or via the existing getMetastore() / getSecurity() for those two.
Python
print(synutils.infrastructure.providerType, synutils.infrastructure.bucket)
print(synutils.infrastructure.getStorage()) # full storage dict
sec = synutils.infrastructure.getSecurity()
print(sec) # {'accessKey': '**********', 'secretKey': '**********', ...}
sec["secretKey"].get() # decrypted plaintext
meta = synutils.infrastructure.getMetastore()
meta["metastorePassword"].get() # decrypted plaintext
payload = synutils.infrastructure.getAll()
payload["infraProvider"]["security"]["secretKey"].get() # decrypted
payload["infraProvider"]["metastore"]["metastorePassword"].get() # decrypted
payload["infraProvider"]["bigQuery"]["keyFile"].get() # decrypted JSON
payload["infraProvider"]["redshift"]["password"].get() # decrypted
payload["infraProvider"]["kafka"]["sslKey"].get() # decrypted
payload["infraProvider"]["gitConfig"]["personalAccessToken"].get() # decryptedScala
SecretStringis available as a bare name in notebook Scala sessions.
println(s"${synutils.infrastructure.providerType} ${synutils.infrastructure.bucket}")
println(synutils.infrastructure.getStorage()) // full storage Map
val sec = synutils.infrastructure.getSecurity()
println(sec) // values render as **********
// Map[String, AnyRef] preserves the seal — values aren't auto-unsealed.
// Cast to SecretString to access .get() / .unseal().
val secretKey = sec("secretKey").asInstanceOf[SecretString]
println(secretKey) // **********
println(secretKey.get()) // decrypted plaintext
val pwd = synutils.infrastructure.getMetastore()("metastorePassword")
.asInstanceOf[SecretString]
val raw: String = pwd // implicit conversion reveals (decrypted)