Server Services Configuration APIs - Platform - BlueCat Gateway - 21.11.2

Gateway Administration Guide

Locale
English (United States)
Product name
BlueCat Gateway
Version
21.11.2

The Address Manager v9.3.0 API introduces new API methods that allow for the management and provisioning of BDDS services, such as NTP, syslog, SNMP, and DNS Activity. You can leverage the Address Manager API to retrieve a list of BDDS services configured on DNS/DHCP Servers, as well as post new configurations to BDDS services. This section includes the new Python API wrappers for these Server Services Configuration APIs in BlueCat Gateway.

configure_server_services(server_ids: list, configuration: dict) -> str

Return a token value of the services configuration task.

Parameter Description
server_ids (list, required) The object IDs of the servers to configure
configuration (dict, required) The configuration description of the services to be configured on the servers.

Returns: The token of the configuration indicating that the servers are configured with services based on the specified configuration.

Return type: str

Example:
from bluecat_libraries.address_manager.api import Client

server_ids = [2001, 2002, 2003]
configuration = {
    "version": "1.0.0",
    "services": {
        "ntp": {
            "configurations": [
                {
                    "ntpConfiguration": {
                        "enable": True,
                        "servers": [
                            {
                                "address": "192.0.2.10",
                                "stratum": "default"
                            }
                        ]
                    }
                }
            ]
        }
    }
}

with Client.from_url(<bam_host_url>) as client:
    client.login(<username>, <password>)
    token = client.configure_server_services(server_ids, configuration)
print(token)
New in version 21.5.1

get_server_services(server_id: int)

Return a description of the configured server services on the specified DNS/DHCP Server.

Parameter Description
server_id (int, required) The object ID of the DNS/DHCP Server

Returns: A description of the configured server services. The returned value is the Address Manager’s response as a Python dictionary.

Return type: dict

Example:
from bluecat_libraries.address_manager.api import Client

server_id = 123
with Client.from_url(<bam_host_url>) as client:
    client.login(<username>, <password>)
    data = client.get_server_services(server_id)
for name, value in data['services'].items():
    print(name, value['configurations'])
New in version 21.5.1

get_server_services_configuration_status(configuration_token str) -> dict

Return the status of the services configuration task created using the configure_server_services API method.

Parameter Description
configuration_token (str, required) The object type that the fields are defined for

Returns: The service configuration status based on the token.

Return type: dict

Example:
from bluecat_libraries.address_manager.api import Client

with Client.from_url(<bam_host_url>) as client:
    client.login(<username>, <password>)
    resp = client.get_server_services_configuration_status(<configuration_token>)
    for k, v in resp.items():
        print(f"{k}: {v}")
New in version 21.5.1