Remove unused V2 schemas

Change-Id: I2f3e1a78faf42e3ca74c86d7f7770cd585ec7dce
This commit is contained in:
Kiall Mac Innes 2015-07-21 12:04:07 +01:00
parent 6e4b21ede2
commit 403d9b7bdc
34 changed files with 1 additions and 1448 deletions

View File

@ -25,7 +25,7 @@ LOG = logging.getLogger(__name__)
class QuotasController(rest.RestController):
_view = quotas_view.QuotasView()
_resource_schema = schema.Schema('v2', 'quota')
_resource_schema = schema.Schema('admin', 'quota')
@staticmethod
def get_path():

View File

@ -1,63 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "blacklist",
"title": "blacklist",
"description": "Blacklisted Zone",
"additionalProperties": false,
"required": ["blacklist"],
"properties": {
"blacklist": {
"type": "object",
"additionalProperties": false,
"required": ["pattern"],
"properties":{
"id": {
"type": "string",
"description": "Blacklisted Zone Identifier",
"format": "uuid",
"readOnly": true
},
"pattern": {
"type": "string",
"description": "Regex for blacklisted zone name",
"format": "regex",
"maxLength": 255,
"required": true
},
"created_at": {
"type": "string",
"description": "Date and time of blacklisted zone creation",
"format": "date-time",
"readOnly": true
},
"description": {
"type": ["string", "null"],
"description": "Description for the blacklisted zone",
"maxLength": 160
},
"updated_at": {
"type": ["string", "null"],
"description": "Date and time of last blacklisted zone update",
"format": "date-time",
"readOnly": true
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
}
}
}
}
}
}
}

View File

@ -1,38 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "blacklist",
"title": "blacklist",
"description": "Blacklisted Zone",
"additionalProperties": false,
"required": ["blacklists"],
"properties": {
"blacklists": {
"type": "array",
"description": "Blacklist",
"items": {"$ref": "blacklist#/properties/blacklist"}
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
},
"next": {
"type": ["string", "null"],
"format": "url"
},
"previous": {
"type": ["string", "null"],
"format": "url"
}
}
}
}
}

View File

@ -1,66 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "floatingip",
"title": "floatingip",
"description": "Floating IP PTR",
"additionalProperties": false,
"required": ["floatingip"],
"properties": {
"floatingip": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "Floating IP PTR identifier",
"pattern": "^[A-Za-z0-9\\.\\-_]{1,100}:([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$",
"readOnly": true
},
"ptrdname": {
"type": ["string", "null"],
"format": "hostname",
"required:": true
},
"description": {
"type": ["string", "null"],
"description": "Description for the PTR",
"maxLength": 160
},
"ttl": {
"type": "integer",
"description": "Default time to live",
"minimum": 0,
"maximum": 2147483647
},
"status": {
"type": ["null", "string"],
"description": "Floating IP PTR Status",
"enum": ["ACTIVE", "PENDING", "ERROR"],
"readOnly": true
},
"action": {
"type": ["null", "string"],
"description": "Floating IP PTR Action",
"enum": ["CREATE", "DELETE", "UPDATE", "NONE"],
"readOnly": true
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
}
}
}
}
}
}
}

View File

@ -1,38 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "floatingips",
"title": "floatingips",
"description": "Floating IP PTRs",
"additionalProperties": false,
"required": ["floatingips"],
"properties": {
"recordsets": {
"type": "array",
"description": "Floating IP",
"items": {"$ref": "floatingips#/properties/flaotingip"}
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
},
"next": {
"type": ["string", "null"],
"format": "url"
},
"previous": {
"type": ["string", "null"],
"format": "url"
}
}
}
}
}

View File

@ -1,29 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "limits",
"title": "limits",
"description": "Limits",
"additionalProperties": false,
"properties": {
"limits": {
"type": "object",
"description": "Limits",
"properties": {
"absolute": {
"type": "object",
"properties": {
"maxZones": {
"type": "integer"
},
"maxZoneRecords": {
"type": "integer"
}
}
}
}
}
}
}

View File

@ -1,107 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "pool",
"title": "pool",
"description": "Pool",
"additionalProperties": false,
"required": ["pool"],
"properties": {
"pool": {
"type": "object",
"additionalProperties": false,
"required": ["name", "attributes", "ns_records"],
"properties": {
"id": {
"type": "string",
"description": "Pool identifier",
"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$",
"readOnly": true
},
"project_id": {
"type": ["string", "null"],
"description": "Project identifier",
"maxLength": 36,
"immutable": true
},
"name": {
"type": "string",
"description": "Pool name",
"maxLength": 50,
"immutable": true
},
"description": {
"type": ["string", "null"],
"description": "Description for the pool",
"maxLength": 160
},
"attributes": {
"type": "object",
"description": "Pool attributes as name value pairs",
"additionalProperties": true,
"properties": {
"scope": {
"type": "string",
"enum": ["public", "private"]
}
}
},
"ns_records": {
"type": "array",
"description": "List of NS Records for Zones in this pool",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["priority", "hostname"],
"properties": {
"priority": {
"type": "integer",
"minimum": 0,
"maximum": 1000
},
"hostname": {
"type": "string",
"format": "hostname",
"maxLength": 255
}
}
}
},
"version": {
"type": "integer",
"description": "Pool version number",
"readOnly": true
},
"created_at": {
"type": "string",
"description": "Date and time of pool creation",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": ["string", "null"],
"description": "Date and time of last pool modification",
"format": "date-time",
"readOnly": true
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
}
}
}
}
}
}
}

View File

@ -1,39 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "pools",
"title": "pools",
"description": "Pools",
"additionalProperties": false,
"required": ["pools"],
"properties": {
"pools": {
"type": "array",
"description": "Pools",
"items": {"$ref": "pool#/properties/pool"}
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
},
"next": {
"type": ["string", "null"],
"format": "url"
},
"previous": {
"type": ["string", "null"],
"format": "url"
}
}
}
}
}

View File

@ -1,14 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"additionalProperties": false,
"required": ["address"],
"properties": {
"address": {
"type": "string",
"format": "ipv4"
}
}
}

View File

@ -1,14 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"additionalProperties": false,
"required": ["address"],
"properties": {
"address": {
"type": "string",
"format": "ipv6"
}
}
}

View File

@ -1,14 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"additionalProperties": false,
"required": ["cname"],
"properties": {
"cname": {
"type": "string",
"format": "hostname"
}
}
}

View File

@ -1,17 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"additionalProperties": false,
"required": ["preference", "exchange"],
"properties": {
"preference": {
"type": "integer"
},
"exchange": {
"type": "string",
"format": "hostname"
}
}
}

View File

@ -1,14 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"additionalProperties": false,
"required": ["nsdname"],
"properties": {
"nsdname": {
"type": "string",
"format": "hostname"
}
}
}

View File

@ -1,14 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"additionalProperties": false,
"required": ["ptrdname"],
"properties": {
"ptrdname": {
"type": "string",
"format": "hostname"
}
}
}

View File

@ -1,43 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"additionalProperties": false,
"required": ["mname", "rname", "serial", "refresh", "retry", "expire", "minimum"],
"properties": {
"mname": {
"type": "string",
"format": "hostname"
},
"rname": {
"type": "string",
"format": "hostname"
},
"serial": {
"type": "integer",
"minimum": 0,
"maximum": 214748364
},
"refresh": {
"type": "integer",
"minimum": 0,
"maximum": 214748364
},
"retry": {
"type": "integer",
"minimum": 0,
"maximum": 214748364
},
"expire": {
"type": "integer",
"minimum": 0,
"maximum": 214748364
},
"minimum": {
"type": "integer",
"minimum": 0,
"maximum": 214748364
}
}
}

View File

@ -1,13 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"additionalProperties": false,
"required": ["text"],
"properties": {
"text": {
"type": "string"
}
}
}

View File

@ -1,29 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"additionalProperties": false,
"required": ["priority", "weight", "port", "target"],
"properties": {
"priority": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"weight": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"port": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"target": {
"type": "string",
"format": "hostname"
}
}
}

View File

@ -1,24 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"additionalProperties": false,
"required": ["algorithm", "type", "fingerprint"],
"properties": {
"algorithm": {
"type": "integer",
"minimum": 1,
"maximum": 2
},
"type": {
"type": "integer",
"minimum": 1,
"maximum": 1
},
"fingerprint": {
"type": "string",
"pattern": "^[0-9A-Fa-f]{40}$"
}
}
}

View File

@ -1,13 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"additionalProperties": false,
"required": ["text"],
"properties": {
"text": {
"type": "string"
}
}
}

View File

@ -1,103 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "recordset",
"title": "recordset",
"description": "RecordSet",
"additionalProperties": false,
"required": ["recordset"],
"properties": {
"recordset": {
"type": "object",
"additionalProperties": false,
"required": ["name", "type"],
"properties": {
"id": {
"type": "string",
"description": "RecordSet identifier",
"format": "uuid",
"readOnly": true
},
"zone_id": {
"type": "string",
"description": "Zone identifier",
"format": "uuid",
"immutable": true
},
"name": {
"type": "string",
"description": "RecordSet name",
"format": "hostname",
"maxLength": 255,
"immutable": true
},
"type": {
"type": "string",
"description": "RecordSet type (TODO: Make types extensible)",
"enum": ["A", "AAAA", "CNAME", "MX", "SRV", "TXT", "SPF", "NS", "PTR", "SSHFP", "SOA"]
},
"description": {
"type": ["string", "null"],
"description": "Description for the RecordSet",
"maxLength": 160
},
"ttl": {
"type": ["integer", "null"],
"description": "Default time to live",
"minimum": 0,
"maximum": 2147483647,
"default": null
},
"status": {
"type": "string",
"description": "Recordset Status",
"enum": ["ACTIVE", "PENDING", "ERROR"],
"readOnly": true
},
"action": {
"type": "string",
"description": "Recordset Action",
"enum": ["CREATE", "DELETE", "UPDATE", "NONE"],
"readOnly": true
},
"records": {
"type": ["array", "null"],
"description": "Records in the RecordSet",
"default": null
},
"version": {
"type": "integer",
"description": "RecordSet version number",
"readOnly": true
},
"created_at": {
"type": "string",
"description": "Date and time of RecordSet creation",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": ["string", "null"],
"description": "Date and time of last recordset modification",
"format": "date-time",
"readOnly": true
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
}
}
}
}
}
}
}

View File

@ -1,46 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "recordsets",
"title": "recordsets",
"description": "RecordSets",
"additionalProperties": false,
"required": ["recordsets"],
"properties": {
"recordsets": {
"type": "array",
"description": "RecordSets",
"items": {"$ref": "recordset#/properties/recordset"}
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
},
"next": {
"type": ["string", "null"],
"format": "url"
},
"previous": {
"type": ["string", "null"],
"format": "url"
}
}
},
"metadata": {
"total_count": {
"type": "integer",
"description": "Total number of entries",
"minimum": 0,
"maximum": 2147483647
}
}
}
}

View File

@ -1,63 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "tld",
"title": "tld",
"description": "Tld",
"additionalProperties": false,
"required": ["tld"],
"properties": {
"tld": {
"type": "object",
"additionalProperties": false,
"required": ["name"],
"properties": {
"id": {
"type": "string",
"description": "Tld identifier",
"format": "uuid",
"readOnly": true
},
"name": {
"type": "string",
"description": "Tld name",
"format": "tldname",
"maxLength": 255,
"immutable": true
},
"description": {
"type": ["string", "null"],
"description": "Description for the tld",
"maxLength": 160
},
"created_at": {
"type": "string",
"description": "Date and time of tld creation",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": ["string", "null"],
"description": "Date and time of last tld modification",
"format": "date-time",
"readOnly": true
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
}
}
}
}
}
}
}

View File

@ -1,38 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "tlds",
"title": "tlds",
"description": "Tlds",
"additionalProperties": false,
"required": ["tlds"],
"properties": {
"tlds": {
"type": "array",
"description": "Tlds",
"items": {"$ref": "tld#/properties/tld"}
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
},
"next": {
"type": ["string", "null"],
"format": "url"
},
"previous": {
"type": ["string", "null"],
"format": "url"
}
}
}
}
}

View File

@ -1,67 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "zone_transfer_accept",
"title": "zone_transfer_accept",
"description": "Zone Transfer Accept",
"additionalProperties": false,
"required": ["transfer_accept"],
"properties": {
"transfer_accept": {
"type": "object",
"additionalProperties": false,
"required": ["zone_transfer_request_id", "key"],
"properties": {
"id": {
"type": "string",
"description": "Zone Transfer Request identifier",
"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$",
"readOnly": true
},
"zone_transfer_request_id": {
"type": "string",
"description": "Request identifier",
"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$"
},
"key": {
"type": "string",
"description": "Password used to complete the transfer",
"maxLength": 160
},
"status": {
"type": "string",
"description": "Zone Status",
"enum": ["ACTIVE", "PENDING", "DELETED", "ERROR", "COMPLETE"],
"readOnly": true
},
"created_at": {
"type": "string",
"description": "Date and time of Request creation",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": ["string", "null"],
"description": "Date and time of last Request modification",
"format": "date-time",
"readOnly": true
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
}
}
}
}
}
}
}

View File

@ -1,38 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "zone_transfer_accept",
"title": "zone_transfer_accept",
"description": "Zone Transfer Accept",
"additionalProperties": false,
"required": ["transfer_accepts"],
"properties": {
"transfer_accepts": {
"type": "array",
"description": "Zone Transfer Requests",
"items": {"$ref": "transfer_accept#/properties/transfer_accept"}
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
},
"next": {
"type": ["string", "null"],
"format": "url"
},
"previous": {
"type": ["string", "null"],
"format": "url"
}
}
}
}
}

View File

@ -1,90 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "zone_transfer_request",
"title": "zone_transfer_request",
"description": "Zone Transfer Request",
"additionalProperties": false,
"required": ["transfer_request"],
"properties": {
"transfer_request": {
"type": "object",
"additionalProperties": false,
"required": ["zone_id"],
"properties": {
"id": {
"type": "string",
"description": "Zone Transfer Request identifier",
"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$",
"readOnly": true
},
"zone_id": {
"type": "string",
"description": "Zone identifier",
"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$",
"readOnly": true
},
"zone_name": {
"type": ["string","null"],
"description": "Zone Name for the Request",
"maxLength": 255,
"readOnly": true
},
"target_project_id": {
"type": ["string", "null"],
"description": "Tenant identifier",
"maxLength": 160
},
"project_id": {
"type": ["string", "null"],
"description": "Project identifier",
"maxLength": 36,
"immutable": true
},
"description": {
"type": ["string", "null"],
"description": "Description for the Request",
"maxLength": 160
},
"key": {
"type": "string",
"description": "Password used to complete the transfer",
"maxLength": 160
},
"status": {
"type": "string",
"description": "Zone Status",
"enum": ["ACTIVE", "PENDING", "DELETED", "ERROR", "COMPLETE"],
"readOnly": true
},
"created_at": {
"type": "string",
"description": "Date and time of Request creation",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": ["string", "null"],
"description": "Date and time of last Request modification",
"format": "date-time",
"readOnly": true
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
}
}
}
}
}
}
}

View File

@ -1,38 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "zone_transfer_request",
"title": "zone_transfer_request",
"description": "Zone Transfer Request",
"additionalProperties": false,
"required": ["transfer_requests"],
"properties": {
"transfer_request": {
"type": "array",
"description": "Zone Transfer Requests",
"items": {"$ref": "transfer_request#/properties/transfer_request"}
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
},
"next": {
"type": ["string", "null"],
"format": "url"
},
"previous": {
"type": ["string", "null"],
"format": "url"
}
}
}
}
}

View File

@ -1,76 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "tsigkey",
"title": "tsigkey",
"description": "TSIG Key",
"additionalProperties": false,
"required": ["tsigkey"],
"properties": {
"tsigkey": {
"type": "object",
"additionalProperties": false,
"required": ["name", "algorithm", "secret", "scope", "resource_id"],
"properties":{
"id": {
"type": "string",
"description": "TSIG Key Identifier",
"format": "uuid",
"readOnly": true
},
"name": {
"type": "string",
"description": "TSIG Key Name",
"maxLength": 255
},
"algorithm": {
"type": "string",
"description": "TSIG Algorithm",
"enum": ["hmac-md5", "hmac-sha1", "hmac-sha224", "hmac-sha256", "hmac-sha384", "hmac-sha512"]
},
"secret": {
"type": "string",
"description": "TSIG Secret",
"maxLength": 255
},
"scope": {
"type": "string",
"description": "TSIG Key Scope",
"enum": ["POOL", "ZONE"]
},
"resource_id": {
"type": "string",
"description": "TSIG Key Resource ID",
"format": "uuid"
},
"created_at": {
"type": "string",
"description": "Date and time of tsigkeyed zone creation",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": ["string", "null"],
"description": "Date and time of last tsigkeyed zone update",
"format": "date-time",
"readOnly": true
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
}
}
}
}
}
}
}

View File

@ -1,38 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "tsigkey",
"title": "tsigkey",
"description": "TSIG Key",
"additionalProperties": false,
"required": ["tsigkeys"],
"properties": {
"tsigkeys": {
"type": "array",
"description": "TSIG Key",
"items": {"$ref": "tsigkey#/properties/tsigkey"}
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
},
"next": {
"type": ["string", "null"],
"format": "url"
},
"previous": {
"type": ["string", "null"],
"format": "url"
}
}
}
}
}

View File

@ -1,167 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "zone",
"title": "zone",
"description": "Zone",
"additionalProperties": false,
"required": ["zone"],
"properties": {
"zone": {
"type": "object",
"additionalProperties": false,
"required": ["name"],
"properties": {
"id": {
"type": "string",
"description": "Zone identifier",
"format": "uuid",
"readOnly": true
},
"pool_id": {
"type": "string",
"description": "Pool identifier",
"format": "uuid",
"immutable": true
},
"project_id": {
"type": ["string", "null"],
"description": "Project identifier",
"maxLength": 36,
"immutable": true
},
"name": {
"type": "string",
"description": "Zone name",
"format": "domainname",
"maxLength": 255,
"immutable": true
},
"type": {
"type": "string",
"description": "Zone Type",
"enum": ["PRIMARY", "SECONDARY"]
},
"masters": {
"type": ["array", "null"],
"items": {
"type": "string"
},
"description": "Masters for this Zone",
"uniqueItems": true
},
"email": {
"type": "string",
"description": "Hostmaster email address",
"format": "email",
"maxLength": 255
},
"description": {
"type": ["string", "null"],
"description": "Description for the zone",
"maxLength": 160
},
"ttl": {
"type": "integer",
"description": "Default time to live",
"minimum": 0,
"maximum": 2147483647
},
"status": {
"type": "string",
"description": "Zone Status",
"enum": ["ACTIVE", "PENDING", "ERROR"],
"readOnly": true
},
"action": {
"type": "string",
"description": "Zone Action",
"enum": ["CREATE", "DELETE", "UPDATE", "NONE"],
"readOnly": true
},
"serial": {
"type": "integer",
"description": "Zone serial number",
"minimum": 0,
"maximum": 4294967295,
"readOnly": true
},
"version": {
"type": "integer",
"description": "Zone version number",
"readOnly": true
},
"created_at": {
"type": "string",
"description": "Date and time of Zone creation",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": ["string", "null"],
"description": "Date and time of last zone modification",
"format": "date-time",
"readOnly": true
},
"transferred_at": {
"type": ["string", "null"],
"description": "Date and time of last successful transfer",
"format": "date-time",
"readOnly": true
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
}
}
}
},
"oneOf": [
{
"description": "Primary zone",
"required": ["email"],
"properties": {
"type": {
"type": "string",
"enum": ["PRIMARY"]
},
"masters": {
"type": ["null", "array"],
"maxItems": 0
}
}
},
{
"description": "Secondary zone",
"required": ["type", "masters"],
"properties": {
"type": {
"type": "string",
"enum": ["SECONDARY"]
},
"masters": {
"type": "array",
"items": {
"type": "string",
"format": "ipandport"
},
"description": "Masters for this Zone",
"uniqueItems": true,
"minItems": 1
}
}
}
]
}
}
}

View File

@ -1,46 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "zones",
"title": "zones",
"description": "Zones",
"additionalProperties": false,
"required": ["zones"],
"properties": {
"zones": {
"type": "array",
"description": "Zones",
"items": {"$ref": "zone#/properties/zone"}
},
"links": {
"type": "object",
"additionalProperties": false,
"properties": {
"self": {
"type": "string",
"format": "url"
},
"next": {
"type": ["string", "null"],
"format": "url"
},
"previous": {
"type": ["string", "null"],
"format": "url"
}
}
},
"metadata": {
"total_count": {
"type": "integer",
"description": "Total number of entries",
"minimum": 0,
"maximum": 2147483647
}
}
}
}

View File

@ -1,48 +0,0 @@
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from oslo_log import log as logging
from designate import schema
from designate.tests import TestCase
LOG = logging.getLogger(__name__)
class SchemasV2Test(TestCase):
def test_recordset(self):
validator = schema.Schema('v2', 'recordset')
# Pass Expected
validator.validate({
'recordset': {
'id': 'b22d09e0-efa3-11e2-b778-0800200c9a66',
'zone_id': 'b22d09e0-efa3-11e2-b778-0800200c9a66',
'name': 'example.com.',
'type': 'A',
'records': ['192.1.2.3']
}
})
# Pass Expected
validator.validate({
'recordset': {
'id': 'b22d09e0-efa3-11e2-b778-0800200c9a66',
'zone_id': 'b22d09e0-efa3-11e2-b778-0800200c9a66',
'name': 'example.com.',
'type': 'MX',
'records': ['mail.example.org.']
}
})