Interface IKasClient
- Namespace
- KASserver
- Assembly
- KASserver.Client.dll
High-level client for the ALL-INKL.COM KAS API. Authentication, session handling and flood throttling are handled transparently.
public interface IKasClient
Methods
AddAccountAsync(AddAccount, CancellationToken)
Creates a subaccount (add_account). Requires a superuser login.
Task<string> AddAccountAsync(AddAccount account, CancellationToken cancellationToken = default)
Parameters
accountAddAccountThe subaccount to create.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or did not return an account login.
AddDnsRecordAsync(AddDnsRecord, CancellationToken)
Creates a DNS resource record (add_dns_settings).
Task<string> AddDnsRecordAsync(AddDnsRecord record, CancellationToken cancellationToken = default)
Parameters
recordAddDnsRecordThe record to create.
cancellationTokenCancellationTokenA cancellation token.
Returns
Remarks
Requires the account's DNS-settings permission; without it KAS faults with
dns_settings_not_allowed. The same applies to UpdateDnsRecordAsync(string, UpdateDnsRecord, CancellationToken),
DeleteDnsRecordAsync(string, CancellationToken) and ResetDnsSettingsAsync(string, string?, CancellationToken).
Exceptions
- KasApiException
The KAS API returned a fault or did not return a record id.
AddDynDnsUserAsync(AddDynDnsUser, CancellationToken)
Creates a DynDNS user (add_ddnsuser) that can update the A/AAAA record of
{Label}.{Zone} via DynDNS.
Task<string> AddDynDnsUserAsync(AddDynDnsUser user, CancellationToken cancellationToken = default)
Parameters
userAddDynDnsUserThe DynDNS user to create.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<string>
The technical DynDNS login generated by KAS, required for subsequent update/delete calls.
Exceptions
- KasApiException
The KAS API returned a fault or did not return a DynDNS login.
AddMailAccountAsync(AddMailAccount, CancellationToken)
Creates a mailbox (add_mailaccount).
Task<string> AddMailAccountAsync(AddMailAccount account, CancellationToken cancellationToken = default)
Parameters
accountAddMailAccountThe mailbox to create.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<string>
The technical mail login generated by KAS (e.g.
m07f821c), required for subsequent update/delete calls.
Exceptions
- KasApiException
The KAS API returned a fault or did not return a mail login.
AddMailForwardAsync(AddMailForward, CancellationToken)
Creates a mail forward (add_mailforward).
Task AddMailForwardAsync(AddMailForward forward, CancellationToken cancellationToken = default)
Parameters
forwardAddMailForwardThe forward to create.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
AddSubdomainAsync(AddSubdomain, CancellationToken)
Creates a subdomain (add_subdomain). The new host is {SubdomainName}.{DomainName}.
Task<string> AddSubdomainAsync(AddSubdomain subdomain, CancellationToken cancellationToken = default)
Parameters
subdomainAddSubdomainThe subdomain to create.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<string>
The full host name of the created subdomain (
{SubdomainName}.{DomainName}), used to address it in subsequent update/delete/get calls.
Remarks
KAS provisions the subdomain asynchronously: it reports in_progress = TRUE for a short
while after creation, and UpdateSubdomainAsync(string, UpdateSubdomain, CancellationToken) is rejected with an
in_progress fault until that clears.
Exceptions
- KasApiException
The KAS API returned a fault or did not return a subdomain name.
DeleteAccountAsync(string, CancellationToken)
Deletes a subaccount (delete_account). Requires a superuser login.
Irreversible: removes the subaccount including all of its resources.
Task DeleteAccountAsync(string accountLogin, CancellationToken cancellationToken = default)
Parameters
accountLoginstringThe subaccount login (e.g.
w01abcde).cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
DeleteDnsRecordAsync(string, CancellationToken)
Deletes a DNS resource record (delete_dns_settings). Identified by its record_id.
Task DeleteDnsRecordAsync(string recordId, CancellationToken cancellationToken = default)
Parameters
recordIdstringThe technical record id, as returned by AddDnsRecordAsync(AddDnsRecord, CancellationToken) or GetDnsRecordsAsync(string, CancellationToken).
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
DeleteDynDnsUserAsync(string, CancellationToken)
Deletes a DynDNS user (delete_ddnsuser). Identified by its dyndns_login.
Task DeleteDynDnsUserAsync(string dyndnsLogin, CancellationToken cancellationToken = default)
Parameters
dyndnsLoginstringThe DynDNS login.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
DeleteMailAccountAsync(string, CancellationToken)
Deletes a mailbox (delete_mailaccount). Identified by the mail_login, not the address.
Task DeleteMailAccountAsync(string mailLogin, CancellationToken cancellationToken = default)
Parameters
mailLoginstringThe technical mail login (e.g.
m07f821c).cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
DeleteMailForwardAsync(string, CancellationToken)
Deletes a mail forward (delete_mailforward). Identified by the full forwarding address.
Task DeleteMailForwardAsync(string mailForward, CancellationToken cancellationToken = default)
Parameters
mailForwardstringThe full forwarding address, e.g.
info@example.com.cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
DeleteSubdomainAsync(string, CancellationToken)
Deletes a subdomain (delete_subdomain). Identified by its host name.
Task DeleteSubdomainAsync(string subdomainName, CancellationToken cancellationToken = default)
Parameters
subdomainNamestringThe subdomain host name, e.g.
shop.example.com.cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetAccountAsync(string, CancellationToken)
Reads a single subaccount by its login (get_accounts with an account_login filter).
Requires a superuser login.
Task<SubAccount?> GetAccountAsync(string accountLogin, CancellationToken cancellationToken = default)
Parameters
accountLoginstringThe subaccount login (e.g.
w01abcde).cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<SubAccount>
The subaccount, or
nullwhen no account matches the login.
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetAccountResourcesAsync(CancellationToken)
Reads the account resource quotas (get_accountresources).
Task<IReadOnlyDictionary<string, object?>> GetAccountResourcesAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetAccountResourcesTypedAsync(CancellationToken)
Reads the account resource quotas as a typed model (get_accountresources).
Task<AccountResources> GetAccountResourcesTypedAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetAccountSettingsAsync(CancellationToken)
Reads the account settings (get_accountsettings).
Task<IReadOnlyDictionary<string, object?>> GetAccountSettingsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetAccountSettingsTypedAsync(CancellationToken)
Reads the account settings as a typed model (get_accountsettings).
Task<AccountSettings> GetAccountSettingsTypedAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetAccountsAsync(CancellationToken)
Lists the subaccounts (get_accounts). Requires a superuser login.
Task<IReadOnlyList<SubAccount>> GetAccountsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetDnsRecordAsync(string, string, CancellationToken)
Reads a single DNS resource record by its id (get_dns_settings with a record_id
filter). A missing trailing dot on zoneHost is added automatically.
Task<DnsRecord?> GetDnsRecordAsync(string zoneHost, string recordId, CancellationToken cancellationToken = default)
Parameters
zoneHoststringThe DNS zone the record belongs to, e.g.
example.com.recordIdstringThe technical record id to look up.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetDnsRecordsAsync(string, CancellationToken)
Lists the DNS resource records of a zone (get_dns_settings). A missing trailing dot on
zoneHost is added automatically.
Task<IReadOnlyList<DnsRecord>> GetDnsRecordsAsync(string zoneHost, CancellationToken cancellationToken = default)
Parameters
zoneHoststringThe DNS zone, e.g.
example.com(orexample.com.).cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<IReadOnlyList<DnsRecord>>
The resource records of the zone.
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetDomainsAsync(CancellationToken)
Lists the domains on the account (get_domains).
Task<IReadOnlyList<IReadOnlyDictionary<string, object?>>> GetDomainsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetDynDnsUserAsync(string, CancellationToken)
Reads a single DynDNS user by its login (get_ddnsusers with a ddns_login filter).
Task<DynDnsUser?> GetDynDnsUserAsync(string dyndnsLogin, CancellationToken cancellationToken = default)
Parameters
dyndnsLoginstringThe DynDNS login.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<DynDnsUser>
The DynDNS user, or
nullwhen no user matches the login.
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetDynDnsUsersAsync(CancellationToken)
Lists the DynDNS users on the account (get_ddnsusers).
Task<IReadOnlyList<DynDnsUser>> GetDynDnsUsersAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<IReadOnlyList<DynDnsUser>>
The DynDNS users on the account.
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetMailAccountsAsync(CancellationToken)
Lists the mailboxes on the account (get_mailaccounts).
Task<IReadOnlyList<MailAccount>> GetMailAccountsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetMailForwardsAsync(CancellationToken)
Lists the mail forwards on the account (get_mailforwards).
Task<IReadOnlyList<MailForward>> GetMailForwardsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetSubdomainAsync(string, CancellationToken)
Reads a single subdomain by its host name (get_subdomains with a subdomain_name filter).
Task<Subdomain?> GetSubdomainAsync(string subdomainName, CancellationToken cancellationToken = default)
Parameters
subdomainNamestringThe subdomain host name, e.g.
shop.example.com.cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
GetSubdomainsAsync(CancellationToken)
Lists the subdomains on the account (get_subdomains).
Task<IReadOnlyList<Subdomain>> GetSubdomainsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<IReadOnlyList<Subdomain>>
The subdomains on the account.
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
MoveSubdomainAsync(string, string, string, CancellationToken)
Moves a subdomain between accounts (move_subdomain). Identified by its host name.
Task MoveSubdomainAsync(string subdomainName, string sourceAccount, string targetAccount, CancellationToken cancellationToken = default)
Parameters
subdomainNamestringThe subdomain host name, e.g.
shop.example.com.sourceAccountstringThe source account the subdomain currently belongs to (
source_account).targetAccountstringThe target account the subdomain is moved to (
target_account).cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
RequestAsync(string, IReadOnlyDictionary<string, object?>?, CancellationToken)
Invokes any KAS action directly and returns the parsed response. Use this as an escape hatch for actions that do not yet have a typed wrapper.
Task<KasResponse> RequestAsync(string action, IReadOnlyDictionary<string, object?>? parameters = null, CancellationToken cancellationToken = default)
Parameters
actionstringThe KAS action name, e.g.
get_dns_settings.parametersIReadOnlyDictionary<string, object>The action parameters.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
ResetDnsSettingsAsync(string, string?, CancellationToken)
Resets the DNS settings of a whole zone to the KAS defaults (reset_dns_settings).
Destructive: discards all custom resource records of the zone. A missing trailing dot on
zoneHost is added automatically.
Task ResetDnsSettingsAsync(string zoneHost, string? nameserver = null, CancellationToken cancellationToken = default)
Parameters
zoneHoststringThe DNS zone to reset, e.g.
example.com.nameserverstringThe name server to apply (
nameserver); whennullthe KAS defaultns5.kasserver.comis used.cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
UpdateAccountAsync(string, UpdateAccount, CancellationToken)
Edits a subaccount (update_account). Identified by its account_login. Requires a superuser login.
Task UpdateAccountAsync(string accountLogin, UpdateAccount changes, CancellationToken cancellationToken = default)
Parameters
accountLoginstringThe subaccount login (e.g.
w01abcde).changesUpdateAccountThe fields to change; unset fields are left unchanged.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
UpdateAccountSettingsAsync(UpdateAccountSettings, CancellationToken)
Edits your own account settings (update_accountsettings).
Task UpdateAccountSettingsAsync(UpdateAccountSettings changes, CancellationToken cancellationToken = default)
Parameters
changesUpdateAccountSettingsThe fields to change; unset fields are left unchanged.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
UpdateChownAsync(UpdateChown, CancellationToken)
Changes ownership of a path (update_chown). Requires a superuser login.
Task UpdateChownAsync(UpdateChown chown, CancellationToken cancellationToken = default)
Parameters
chownUpdateChownThe path, new owner and recursion flag.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
UpdateDnsRecordAsync(string, UpdateDnsRecord, CancellationToken)
Edits a DNS resource record (update_dns_settings). Identified by its record_id.
The record type cannot be changed via this action.
Task UpdateDnsRecordAsync(string recordId, UpdateDnsRecord changes, CancellationToken cancellationToken = default)
Parameters
recordIdstringThe technical record id, as returned by AddDnsRecordAsync(AddDnsRecord, CancellationToken) or GetDnsRecordsAsync(string, CancellationToken).
changesUpdateDnsRecordThe fields to change; unset fields are left unchanged.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
UpdateDynDnsUserAsync(string, UpdateDynDnsUser, CancellationToken)
Edits a DynDNS user (update_ddnsuser). Identified by its dyndns_login.
Task UpdateDynDnsUserAsync(string dyndnsLogin, UpdateDynDnsUser changes, CancellationToken cancellationToken = default)
Parameters
dyndnsLoginstringThe DynDNS login, as returned by AddDynDnsUserAsync(AddDynDnsUser, CancellationToken) or GetDynDnsUsersAsync(CancellationToken).
changesUpdateDynDnsUserThe fields to change; unset fields are left unchanged.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
UpdateMailAccountAsync(string, UpdateMailAccount, CancellationToken)
Edits a mailbox (update_mailaccount). Identified by the technical mail_login.
Task UpdateMailAccountAsync(string mailLogin, UpdateMailAccount changes, CancellationToken cancellationToken = default)
Parameters
mailLoginstringThe technical mail login (e.g.
m07f821c), as returned by AddMailAccountAsync(AddMailAccount, CancellationToken).changesUpdateMailAccountThe fields to change; unset fields are left unchanged.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
UpdateMailAccountPasswordAsync(string, string, CancellationToken)
Changes a mailbox password (update_mailaccount) — a convenience wrapper over
UpdateMailAccountAsync(string, UpdateMailAccount, CancellationToken). Identified by the technical mail_login.
Task UpdateMailAccountPasswordAsync(string mailLogin, string newPassword, CancellationToken cancellationToken = default)
Parameters
mailLoginstringThe technical mail login (e.g.
m07f821c).newPasswordstringThe new mailbox password.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
UpdateSubdomainAsync(string, UpdateSubdomain, CancellationToken)
Edits a subdomain (update_subdomain). Identified by its host name.
Task UpdateSubdomainAsync(string subdomainName, UpdateSubdomain changes, CancellationToken cancellationToken = default)
Parameters
subdomainNamestringThe subdomain host name, e.g.
shop.example.com.changesUpdateSubdomainThe fields to change; unset fields are left unchanged.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.
UpdateSuperuserSettingsAsync(string, UpdateSuperuserSettings, CancellationToken)
Edits the superuser-controlled settings (SSH access/keys) of a subaccount
(update_superusersettings). May only be executed by the main account.
Task UpdateSuperuserSettingsAsync(string accountLogin, UpdateSuperuserSettings changes, CancellationToken cancellationToken = default)
Parameters
accountLoginstringThe subaccount login to edit (e.g.
w01abcde).changesUpdateSuperuserSettingsThe fields to change; unset fields are left unchanged.
cancellationTokenCancellationTokenA cancellation token.
Returns
Exceptions
- KasApiException
The KAS API returned a fault or an uninterpretable response.