getDns method

This operation gets the DNS settings from a device. The device shall return its DNS configurations through the GetDNS command.

Access Class: READ_SYSTEM

Implementation

Future<DnsInformation> getDns() async {
  loggy.debug('getDns');

  final responseEnvelope = await transport.securedRequest(
      uri,
      soap.Body(
        request: DeviceManagementRequest.getDns(),
      ));

  if (responseEnvelope.body.hasFault) {
    throw Exception(responseEnvelope.body.fault.toString());
  }

  return GetDnsResponse.fromJson(responseEnvelope.body.response!)
      .dnsInformation;
}