OpnsenseApiCredentials
Reads the OPNsense API creds dropped by OpnsenseInstall on the Proxmox host at /etc/netsetup/opnsense-api.env and translates them to an OpnsenseConnection. Returns null when the file is missing (seed never ran / OPNsense not provisioned yet).
public static class OpnsenseApiCredentials
1. Fields
1.1. ApiEnvPath
Path on the Proxmox host where seed writes the API creds.
public const string ApiEnvPath
2. Methods
2.1. Parse(string)
Parses the env-style content. Pure helper — easy to unit-test.
public static OpnsenseConnection Parse(string envFileContent)
| Name | Type | Description |
|---|---|---|
envFileContent |
string |
Returns: OpnsenseConnection
2.2. TryLoad()
Loads creds from the well-known path on disk. Returns null when the file is absent.
public static OpnsenseConnection TryLoad()
Returns: OpnsenseConnection