MikrotikApiCredentials

Reads the MikroTik API creds dropped by flash-mikrotik onto the Proxmox host at /etc/netsetup/mikrotik-api.env and translates them to a MikrotikConnection. Returns null when the file is missing (flash never ran / device not provisioned yet). Throws NETSetupException when the file exists but is missing a required field.

public static class MikrotikApiCredentials

1. Fields

1.1. ApiEnvPath

Path on the Proxmox host where flash-mikrotik 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 MikrotikConnection Parse(string envFileContent)
Table 1. Parameters
Name Type Description

envFileContent

string

Returns: MikrotikConnection

2.2. TryLoad()

Loads creds from the well-known path on disk. Returns null when the file is absent.

public static MikrotikConnection TryLoad()

Returns: MikrotikConnection