Add Primary Zone

Applies To:
Route

Creates a primary zone. A new zone can contain any of the following items:

Request

A request to create a zone is described below.

HTTP Method Request URI

POST

https://api.edgecast.com/v2/mcc/customers/AccountNumber/dns/routezone

Define the following variables when submitting the above request:

VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3).

Description

AccountNumber

Required

Replace this variable with a customer account number. This account number may be found in the upper right-hand corner of the MCC.

Request Headers

This endpointIdentifies a request's connection point to our REST API service. only takes advantage of common request headers.

This endpoint only supports JSON.

Request Body

Pass the following request body parameters:

Name Data Type Description

Comment

String

Assigns a comment to the zone.

DomainName

Required

String

Defines a zone's name.

FailoverGroups

Array

Define the zone's failover groups within this request parameter.

Group

Object

FailoverGroups array

Define a specific failover group within this request parameter.

[A|AAAA|CNAME]

Array

FailoverGroups array > Group object

The name of this request parameter should be set to the record typeA, AAAA, or CNAME that will be associated with the group.

Key information:

  • A failover group must contain exactly two records of the same type.
  • The supported configurations for a failover group are:
    • A records only
    • AAAA records only
    • A and AAAA records
    • CNAME records only

HealthCheck

Object

FailoverGroups array > Group object > A|AAAA|CNAME array

Define a record's health check configuration within this request parameter.

CheckInterval

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the number of seconds between health checks.

CheckTypeId

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the type of health check by its system-defined ID.

Use the Get Available Health Check Types endpoint to retrieve a list of health check types and their IDs.

ContentVerification

String

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the text that will be used to verify the success of the health check.

EmailNotificationAddress

String

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the e-mail address to which health check notifications will be sent.

FailedCheckThreshold

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the number of consecutive times that the same result must be returned before a health check agent will indicate a change in status.

HTTPMethodId

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines an HTTP method by its system-defined ID. An HTTP method is only used by HTTP/HTTPs health checks.

Use the Get Available HTTP Methods (Health Checks) endpoint to retrieve a list of HTTP methods and their IDs.

IPAddress

String

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the IP address (IPv4 or IPv6) to which TCP health checks will be directed.

IPVersion

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines an IP version by its system-defined ID. This IP version is only used by HTTP/HTTPs health checks.

Use the Get Available IP Versions (Health Checks) endpoint to retrieve a list of IP versions and their IDs.

PortNumber

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the port to which TCP health checks will be directed.

ReintegrationMethodId

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the endpoint through which an unhealthy server/hostname will be integrated back into a group.

Use the Get Available Health Check Reintegration Methods endpoint to retrieve a list of reintegration methods and their IDs.

Uri

String

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the URI to which HTTP/HTTPs health checks will be directed.

IsPrimary

Boolean

FailoverGroups array > Group object > A|AAAA|CNAME array

Defines whether the current record is the primary server/hostname to which traffic will be directed.

Record

Object

FailoverGroups array > Group object > A|AAAA|CNAME array

Define a record's properties within this request parameter.

Name

String

FailoverGroups array > Group object > A|AAAA|CNAME array > Record object

Defines the record's name.

Rdata

String

FailoverGroups array > Group object > A|AAAA|CNAME array > Record object

Defines the record's value.

TTL

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > Record object

Defines the record's TTL.

GroupTypeId

Integer

FailoverGroups array

Set this request parameter to "3."

Name

String

FailoverGroups array

Defines the name of the failover group.

LoadBalancingGroups

Array

Define the zone's load balancing groups within this response parameter.

Group

Object

LoadBalancingGroups array

Define a specific load balancing group within this request parameter.

[A|AAAA|CNAME]

Array

LoadBalancingGroups array > Group object

The name of this request parameter should be set to the record typeA, AAAA, or CNAME that will be associated with the group.

Key information:

  • A load balancing group must contain at least two records of the same type.
  • The supported configurations for a load balancing group are:
    • A records only
    • AAAA records only
    • A and AAAA records
    • CNAME records only

HealthCheck

Object

LoadBalancingGroups array > Group object > A|AAAA|CNAME array

Define a record's health check configuration within this request parameter.

CheckInterval

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the number of seconds between health checks.

CheckTypeId

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the type of health check by its system-defined ID.

Use the Get Available Health Check Types endpoint to retrieve a list of health check types and their IDs.

ContentVerification

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the text that will be used to verify the success of the health check.

EmailNotificationAddress

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the e-mail address to which health check notifications will be sent.

FailedCheckThreshold

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the number of consecutive times that the same result must be returned before a health check agent will indicate a change in status.

HTTPMethodId

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines an HTTP method by its system-defined ID. An HTTP method is only used by HTTP/HTTPs health checks.

Use the Get Available HTTP Methods (Health Checks) endpoint to retrieve a list of HTTP methods and their IDs.

IPAddress

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the IP address (IPv4 or IPv6) to which TCP health checks will be directed.

IPVersion

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines an IP version by its system-defined ID. This IP version is only used by HTTP/HTTPs health checks.

Use the Get Available IP Versions (Health Checks) endpoint to retrieve a list of IP versions and their IDs.

PortNumber

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the port to which TCP health checks will be directed.

ReintegrationMethodId

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the endpoint through which an unhealthy server/hostname will be integrated back into a group.

Use the Get Available Health Check Reintegration Methods endpoint to retrieve a list of reintegration methods and their IDs.

Uri

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Defines the URI to which HTTP/HTTPs health checks will be directed.

Record

Object

LoadBalancingGroups array > Group object > A|AAAA|CNAME array

Define a record's properties within this request parameter.

Name

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > Record object

Defines the record's name.

Rdata

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > Record object

Defines the record's value.

TTL

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > Record object

Defines the record's TTL.

Weight

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array

Defines the load balancing weight assigned to the record.

GroupTypeId

Integer

LoadBalancingGroups array

Set this request parameter to "3."

Name

String

LoadBalancingGroups array

Defines the name of the load balancing group.

Records

Object

Define the set of records that will be associated with the zone. This section should only describe records that do not belong to a load balancing or failover group.

RecordType

Array

Records object

Each type of record is defined in its own section. Create a section for each desired record type. The available record types are:

  • A
  • AAAA
  • CAA
  • CNAME
  • MX
  • NS
  • PTR
  • SPF
  • SRV
  • TXT

Name

String

Records object > RecordType array

Defines a record's name.

Rdata

String

Records object > RecordType array

Defines a record's value.

TTL

Integer

Records object > RecordType array

Defines a record's TTL.

Status

Required

Integer

Defines a zone's status by its system-defined ID.

Use the Get Available Zone Statuses endpoint to retrieve a list of statuses and their IDs.

ZoneType

Required

Integer

Indicates that a primary zone will be created. Set this request parameter to "1."

Response

The response to the above request includes an HTTP status code, response headers, and a response body.

Status Code

A status code indicates whether the request was successfully performed.

Response Headers

The response for this endpoint only includes standard HTTP response headers.

View common response headers.

Response Body

The response body for a successful request returns the properties of the newly created zone.

Name Data Type Description

Comment

String

Indicates the comment associated with the new zone.

DomainName

String

Indicates the new zone's name.

FailoverGroups

Array

This response parameter contains the set of failover groups associated with the new zone.

Group

Object

FailoverGroups array

This response parameter contains a failover group.

[A|AAAA|CNAME]

Array

FailoverGroups array > Group object

Each group contains a section for each record type. Records are returned in the following order.

  • A
  • AAAA
  • CNAME

This response parameter contains the following information about a record:

  • Health check configuration
  • Properties
  • Primary status

If the group does not contain a particular type of record, then that section will remain blank.

HealthCheck

Object

FailoverGroups array > Group object > A|AAAA|CNAME array

This response parameter describes the health check configuration associated with a record in the group.

A null value is returned if a health check configuration has not been defined.

CheckInterval

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the number of seconds between health checks.

CheckTypeId

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Identifies a type of health check by its system-defined ID.

Use the Get Available Health Check Types endpoint to retrieve a list of health check types and their IDs.

ContentVerification

String

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the text that will be used to verify the success of the health check.

EmailNotificationAddress

String

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Identifies the e-mail address to which health check notifications will be sent.

FailedCheckThreshold

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the number of consecutive times that the same result must be returned before a health check agent will indicate a change in status.

HTTPMethodId

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Identifies an HTTP method by its system-defined ID. An HTTP method is only used by HTTP/HTTPs health checks.

Use the Get Available HTTP Methods (Health Checks) endpoint to retrieve a list of HTTP methods and their IDs.

IPAddress

String

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the IP address (IPv4 or IPv6) to which TCP health checks will be directed.

IPVersion

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Identifies an IP version by its system-defined ID. This IP version is only used by HTTP/HTTPs health checks.

Use the Get Available IP Versions (Health Checks) endpoint to retrieve a list of IP versions and their IDs.

PortNumber

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the port to which TCP health checks will be directed.

ReintegrationMethodId

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the method through which an unhealthy server/hostname will be integrated back into a group.

Use the Get Available Health Check Reintegration Methods endpoint to retrieve a list of reintegration methods and their IDs.

Status

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the server/hostname's health check status by its system-defined ID.

StatusName

String

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the server/hostname's health check status.

Uri

String

FailoverGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the URI to which HTTP/HTTPs health checks will be directed.

IsPrimary

Boolean

FailoverGroups array > Group object > A|AAAA|CNAME array

Indicates whether the current record is the primary server/hostname to which traffic will be directed.

Record

Object

FailoverGroups array > Group object > A|AAAA|CNAME array

This response parameter contains the record's properties.

Name

String

FailoverGroups array > Group object > A|AAAA|CNAME array > Record object

Indicates the record's name.

Rdata

String

FailoverGroups array > Group object > A|AAAA|CNAME array > Record object

Indicates the record's value.

TTL

Integer

FailoverGroups array > Group object > A|AAAA|CNAME array > Record object

Indicates the record's TTL.

GroupTypeId

Integer

FailoverGroups array

Indicates the type of failover group by its system-defined ID. This response parameter will always report "3" which corresponds to zones.

Name

String

FailoverGroups array

Indicates the name of the failover group.

LoadBalancingGroups

Array

This response parameter contains the set of load balancing groups associated with the zone.

Group

Object

LoadBalancingGroups array

This request parameter contains a load balancing group.

[A|AAAA|CNAME]

Array

LoadBalancingGroups array > Group object

Each group contains a section for each record type.Records are returned in the following order.

  • A
  • AAAA
  • CNAME

This response parameter contains the following information about a record:

  • Health check configuration
  • Properties
  • Load balancing Weight

If the group does not contain a particular type of record, then that section will remain blank.

HealthCheck

Object

LoadBalancingGroups array > Group object > A|AAAA|CNAME array

This response parameter describes the health check configuration associated with a record in the group.

A null value is returned if a health check configuration has not been defined.

CheckInterval

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the number of seconds between health checks.

CheckTypeId

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Identifies the type of health check by its system-defined ID.

Use the Get Available Health Check Types endpoint to retrieve a list of health check types and their IDs.

ContentVerification

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the text that will be used to verify the success of the health check.

EmailNotificationAddress

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Identifies the e-mail address to which health check notifications will be sent.

FailedCheckThreshold

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the number of consecutive times that the same result must be returned before a health check agent will indicate a change in status.

HTTPMethodId

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Identifies an HTTP method by its system-defined ID. An HTTP method is only used by HTTP/HTTPs health checks.

Use the Get Available HTTP Methods (Health Checks) endpoint to retrieve a list of HTTP methods and their IDs.

IPAddress

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

A string that indicates the IP address (IPv4 or IPv6) to which TCP health checks will be directed.

IPVersion

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Identifies an IP version by its system-defined ID. This IP version is only used by HTTP/HTTPs health checks.

Use the Get Available IP Versions (Health Checks) endpoint to retrieve a list of IP versions and their IDs.

PortNumber

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the port to which TCP health checks will be directed.

ReintegrationMethodId

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the method through which an unhealthy server/hostname will be integrated back into a group.

Use the Get Available Health Check Reintegration Methods endpoint to retrieve a list of reintegration methods and their IDs.

Status

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the server/hostname's health check status by its system-defined ID.

StatusName

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the server/hostname's health check status.

Uri

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > HealthCheck object

Indicates the URI to which HTTP/HTTPs health checks will be directed.

Record

Object

LoadBalancingGroups array > Group object > A|AAAA|CNAME array

This response parameter contains the record's properties.

Name

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > Record object

Indicates the record's name.

Rdata

String

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > Record object

Indicates the record's value.

TTL

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array > Record object

Indicates the record's TTL.

Weight

Integer

LoadBalancingGroups array > Group object > A|AAAA|CNAME array

Indicates the load balancing weight assigned to the record.

GroupTypeId

Integer

LoadBalancingGroups array

Indicates the type of load balancing group by its system-defined ID. This response parameter will always report "3" which corresponds to zones.

Name

String

LoadBalancingGroups array

Indicates the name of the load balancing group.

Records

Object

This response parameter describes the records associated with the new zone. This section only describes records that do not belong to a load balancing or failover group.

A null value is returned when the zone does not contain additional records.

RecordType

Array

Records object

Each type of record is listed in its own section. Records are returned in the following order.

  • A
  • AAAA
  • CAA
  • CNAME
  • MX
  • NS
  • PTR
  • SPF
  • SRV
  • TXT

This response parameter contains all of a zone's records for a given type.

Name

String

Records object > RecordType array

Indicates a record's name.

Rdata

String

Records object > RecordType array

Indicates a record's value.

TTL

Integer

Records object > RecordType array

Indicates a record's TTL.

Status

Integer

Indicates the new zone's status by its system-defined ID.

Use the Get Available Zone Statuses endpoint to retrieve a list of statuses and their IDs.

Version

Integer

Indicates the new zone's version. This version is incremented whenever a change is applied to the zone.

ZoneId

Integer

Identifies the new zone by its system-defined ID.

ZoneType

Integer

Indicates that a primary zone has been created. This response parameter will always be set to "1."

Errors

The response body for an unsuccessful request may contain an error parameter that provides additional information.

View common error messages.

Sample Request and Response (JSON)

A sample JSON request is shown below.

POST https://api.edgecast.com/v2/mcc/customers/0001/dns/routezone HTTP/1.1

Authorization: TOK:12345678-1234-1234-1234-1234567890ab

Accept: application/json

Content-Type: application/json

Host:api.edgecast.com

Content-Length: 1718

{
	"Comment" : "",
	"DomainName" : "myzone.com.",
	"FailoverGroups" : [{
			"Group" : {
				"A" : [],
				"AAAA" : [],
				"CNAME" : [{
						"HealthCheck" : null,
						"IsPrimary" : false,
						"Record" : {
							"Name" : "web",
							"Rdata" : "web01.myzone.com.",
							"TTL" : 300
						}
					}, {
						"HealthCheck" : null,
						"IsPrimary" : true,
						"Record" : {
							"Name" : "web",
							"Rdata" : "web02.myzone.com.",
							"TTL" : 300
						}
					}
				]
			},
			"GroupTypeId" : 3,
			"Name" : "web"
		}
	],
	"LoadBalancingGroups" : [{
			"Group" : {
				"A" : [],
				"AAAA" : [],
				"CNAME" : [{
						"HealthCheck" : null,
						"Record" : {
							"Name" : "mycdn",
							"Rdata" : "www.myzone.com.",
							"TTL" : 300
						},
						"Weight" : 50
					}, {
						"HealthCheck" : null,
						"Record" : {
							"Name" : "mycdn",
							"Rdata" : "www2.myzone.com.",
							"TTL" : 300
						},
						"Weight" : 50
					}
				]
			},
			"GroupTypeId" : 3,
			"Name" : "mycdn"
		}
	],
	"Records" : {
		"A" : [{
				"Name" : "www",
				"Rdata" : "10.55.66.22",
				"TTL" : 3600
			}, {
				"Name" : "www",
				"Rdata" : "55.66.88.11",
				"TTL" : 3600
			}, {
				"Name" : "www",
				"Rdata" : "66.77.99.22",
				"TTL" : 3600
			}, {
				"Name" : "www",
				"Rdata" : "11.66.77.33",
				"TTL" : 3600
			}
		],
		"AAAA" : [{
				"Name" : "www",
				"Rdata" : "1:1:1:2:3:4:5:6",
				"TTL" : 3600
			}, {
				"Name" : "www",
				"Rdata" : "::2",
				"TTL" : 3600
			}
		],
		"CNAME" : [],
		"MX" : [],
		"NS" : [],
		"SPF" : [],
		"SRV" : [],
		"TXT" : []
	},
	"Status" : 2,
	"ZoneType" : 1
}

A sample JSON response is shown below.

HTTP/1.1 200 OK

Cache-Control: private

Content-Type: application/json; charset=utf-8

Date: Thu, 15 Apr 2021 12:00:00 GMT

Content-Length: 1380

{
	"Comment" : "",
	"DomainName" : "myzone.com.",
	"FailoverGroups" : [{
			"Group" : {
				"A" : [],
				"AAAA" : [],
				"CNAME" : [{
						"HealthCheck" : null,
						"IsPrimary" : false,
						"Record" : {
							"Name" : "web",
							"Rdata" : "web01.myzone.com.",
							"TTL" : 300
						}
					}, {
						"HealthCheck" : null,
						"IsPrimary" : true,
						"Record" : {
							"Name" : "web",
							"Rdata" : "web02.myzone.com.",
							"TTL" : 300
						}
					}
				]
			},
			"GroupTypeId" : 3,
			"Name" : "web"
		}
	],
	"LoadBalancingGroups" : [{
			"Group" : {
				"A" : [],
				"AAAA" : [],
				"CNAME" : [{
						"HealthCheck" : null,
						"Record" : {
							"Name" : "mycdn",
							"Rdata" : "www.myzone.com.",
							"TTL" : 300
						},
						"Weight" : 50
					}, {
						"HealthCheck" : null,
						"Record" : {
							"Name" : "mycdn",
							"Rdata" : "www2.myzone.com.",
							"TTL" : 300
						},
						"Weight" : 50
					}
				]
			},
			"GroupTypeId" : 3,
			"Name" : "mycdn"
		}
	],
	"Records" : {
		"A" : [{
				"Name" : "www",
				"Rdata" : "10.55.66.22",
				"TTL" : 3600
			}, {
				"Name" : "www",
				"Rdata" : "55.66.88.11",
				"TTL" : 3600
			}, {
				"Name" : "www",
				"Rdata" : "66.77.99.22",
				"TTL" : 3600
			}, {
				"Name" : "www",
				"Rdata" : "11.66.77.33",
				"TTL" : 3600
			}
		],
		"AAAA" : [{
				"Name" : "www",
				"Rdata" : "1:1:1:2:3:4:5:6",
				"TTL" : 3600
			}, {
				"Name" : "www",
				"Rdata" : "::2",
				"TTL" : 3600
			}
		],
		"CNAME" : [],
		"MX" : [],
		"NS" : [],
		"SPF" : [],
		"SRV" : [],
		"TXT" : []
	},
	"Status" : 2,
	"Version" : 1234567890,
	"ZoneId" : 1234,
	"ZoneType" : 1
}