NSService_10
Overview
Methods
Types
Description
NameSurfer API v1.0 (7.4.2)

Notes on remote server related API methods

Servername and servertype parameters are not needed if clustername parameter is specified. These parameters are mutually exclusive.

Server types

Description Label
Managed BIND managed_named
FusionLayer DNS DNS
Managed DHCP managed_dhcpd
Managed NDS managed_nsd
Secure64 DNS Server managed_secure64
Secure64 DNS Server Signer managed_s64signer
Standalone DNS standalone_named
Legacy Bindconf legacy
Standalone DHCP standalone_dhcpd
FusionLayer DHCP FusionLayer DHCP
Managed Unbound managed_unbound
Secure64 DNS Cache managed_s64cache
Managed Unbound managed_unbound
Nominum ANSP NominumANSP
Nominum ANS NominumANS
Nominum DCS NominumDCS
Nominum Vantio NominumVantio
Microsoft DHCP MSDHCP

Calculating message digests

Each API call documents the parameters that are used to calculate the message digest. In addition to these parameters, key name and secret key value are ALWAYS used. Digest is calculated using HMAC_SHA256 from a '&'-concatenated string containing keyname, then call specific parameters and the secret key as the last value.

Example

While using key name 'examplekey' with secret value '0123456789ABCDEF', let's remove block 10.0.0.1/24 owned by 'tom':
Documentation for deleteBlock says about digest :
@param digest: Digest calculated from address and bitmask

We can build the string used to calculate message digest by joining keyname, address, bitmask and secret value with '&'. With that we get the following string : examplekey&10.0.0.1&24&0123456789ABCDEF. And calculating HMAC_SHA256 from that, taking the result as hex string we get 'e1e81722f41ee22fc52887e58e2a95bb899083f6b17ffa342d197d64279f3a92'

Python example code using suds library

from suds.client import Client
from hashlib import sha256
import hmac

endpoint='https://localhost:8443/API_10/NSService_10/soap/description'
client = Client(endpoint, cache=None)

keyname='examplekey'
keyvalue='0123456789ABCDEF'
address='10.0.0.1'
bitmask=24
owner='tom'
force=False
message='&'.join([keyname, address, str(bitmask), keyvalue])
digest = hmac.new(str(keyvalue), message, digestmod=sha256).hexdigest()
result = client.service.deleteBlock(keyname, digest, address, bitmask, owner, force)
print "Received",result
Interfaces
Methods
Types