Domain Name System (DNS) Server - Cisco

36 downloads 250 Views 194KB Size Report
The DNS server resource represents an individual DNS server configuration on the router. Resource URL: /api/v1/global/dns-servers/(dns-server-id). Retrieve a ...
4

CH A P T E R

Domain Name System (DNS) Server •

Resource Summary for DNS Servers



DNS Server Resource

Resource Summary for DNS Servers HTTP Method Resource

URL (BaseURL)

DNS servers /api/v1/global/dns-servers /api/v1/global/dns-servers/{dns-server-ip}

GET

POST

PUT

DELETE

Y

Y

N

N

Y

N

N

Y

DNS Server Resource The DNS server resource represents an individual DNS server configuration on the router.

History

Release

Modification

IOS XE 3.10

Introduced for the CSR1000V platform

IOS XE 3.14

Introduced for ASR1001-X and ASR1002-X platforms

Properties

Property

Type

Required for POST and PUT

kind

String

Not applicable Object type. Always “collection#dns-server”

items

array

Mandatory

Description Array of DNS server objects

Cisco IOS XE REST API Management Reference Guide

4-1

Chapter 4

Domain Name System (DNS) Server

DNS Server Resource

Property

Type

Required for POST and PUT

Description

ip-address

ipaddress

Mandatory

DNS server’s IP address in x.x.x.x format

primary

Boolean

Mandatory

“true” if the primary DNS server’s IP address is being configured, “false” otherwise.

Retrieve a DNS Server Resource URI

Verb

URI

GET

/api/v1/global/dns-servers/{dns-server-id}

Example JSON Request GET /api/v1/global/dns-server/172.25.25.25 Accept: application/json

JSON Response 200 Ok Content-Type: application/json { "kind" : "object#dns-server", "ip-address": "172.25.25.25", "primary" : true }

Retrieve All DNS Servers Resource URI

Verb

URI

GET

/api/v1/global/dns-servers

The first DNS server listed is the primary one.

Properties for Retrieve All

Property

Type

Description

kind

String

Object type. Always “collection#dns-server”

items

array

Array of DNS server objects

Cisco IOS XE REST API Management Reference Guide

4-2

Chapter 4

Domain Name System (DNS) Server DNS Server Resource

Property

Type

Description

ip-address

ipaddress

DNS server’s IP address in x.x.x.x format

primary

Boolean

“true” if the primary DNS server’s IP address is being configured, “false” otherwise.

Example JSON Request GET /api/v1/global/dns-servers Accept: application/json

JSON Response 200 ok Content-Type: application/json { "kind": "items": [

"collection#dns-server" { "kind": "object#dns-server", "ip-address": "173.25.25.25", "primary": true }, { "kind": "object#dns-server", "ip-address": "173.25.25.26", "primary": false },

] }

Delete a DNS Server Resource URI

Verb

URI

DELETE

/api/v1/global/dns-servers/{dns-server-id}

Example JSON Request DELETE /api/v1/global/dns-servers/172.25.25.25 Accept: application/json

JSON Response 204 No Content

Cisco IOS XE REST API Management Reference Guide

4-3

Chapter 4

Domain Name System (DNS) Server

DNS Server Resource

Create a DNS Server A POST on this resource is used to create individual DNS server resources.

Resource URI

Verb

URI

POST

/api/v1/global/dns-servers

Example JSON Request POST /api/v1/global/dns-servers Content-Type: application/json Accept: application/json { "ip-address": "173.25.25.25", "primary" : true }

JSON Response 201 Created Location: http://host/api/v1/global/dns-servers/172.25.25.25

Cisco IOS XE REST API Management Reference Guide

4-4