Augment document schemas

- Update schemas to add some missing allowed properties
- Use additionalProperties field to enforce structure of storage
  devices and network interfaces
- Remove duplicate unit tests

Change-Id: I8fb98205bc4a99208fc0e26a5724f6c0960a8278
This commit is contained in:
Scott Hussey 2017-11-09 11:23:04 -06:00
parent 455fa1fb79
commit 6d29229b09
16 changed files with 279 additions and 145 deletions

View File

@ -10,30 +10,155 @@ data:
id: 'http://att.com/att-comdev/drydock/baremetalNode.yaml' id: 'http://att.com/att-comdev/drydock/baremetalNode.yaml'
type: 'object' type: 'object'
properties: properties:
host_profile:
type: 'string'
interfaces:
type: 'object'
properties:
bond0:
type: 'object'
properties:
networks:
type: 'array'
items:
type: 'string'
addressing: addressing:
type: 'array' type: 'array'
items: items:
type: 'object' type: 'object'
properties: properties:
network:
type: 'string'
address: address:
type: 'string' type: 'string'
network:
type: 'string'
oob:
type: 'object'
properties:
type:
type: 'string'
network:
type: 'string'
account:
type: 'string'
credetial:
type: 'string'
additionalProperties: true
storage:
type: 'object'
properties:
physical_devices:
type: 'object'
additionalProperties:
type: 'object'
properties:
labels:
type: 'object'
additionalProperties:
type: 'string'
volume_group:
type: 'string'
partitions:
type: 'array'
items:
type: 'object'
properties:
name:
type: 'string'
size:
type: 'string'
part_uuid:
type: 'string'
volume_group:
type: 'string'
labels:
type: 'object'
additionalProperties:
type: 'string'
bootable:
type: 'boolean'
volume_group:
type: 'string'
filesystem:
type: 'object'
properties:
mountpoint:
type: 'string'
fstype:
type: 'string'
mount_options:
type: 'string'
fs_uuid:
type: 'string'
fs_label:
type: 'string'
additionalProperties: false
additionalProperties: false
volume_groups:
type: 'object'
additionalProperties:
type: 'object'
properties:
vg_uuid:
type: 'string'
logical_volumes:
type: 'array'
items:
type: 'object'
properties:
name:
type: 'string'
lv_uuid:
type: 'string'
size:
type: 'string'
filesystem:
type: 'object'
properties:
mountpoint:
type: 'string'
fstype:
type: 'string'
mount_options:
type: 'string'
fs_uuid:
type: 'string'
fs_label:
type: 'string'
platform:
type: 'object'
properties:
image:
type: 'string'
kernel:
type: 'string'
kernel_params:
type: 'object'
additionalProperties: true
additionalProperties: false
metadata: metadata:
type: 'object' type: 'object'
properties: properties:
tags:
type: 'array'
items:
type: 'string'
owner_data:
type: 'object'
additionalProperties:
type: 'string'
rack: rack:
type: 'string' type: 'string'
boot_mac:
type: 'string'
additionalProperties: false additionalProperties: false
host_profile:
type: 'string'
hardware_profile:
type: 'string'
primary_network:
type: 'string'
interfaces:
type: 'object'
additionalProperties:
type: 'object'
properties:
device_link:
type: 'string'
slaves:
type: 'array'
items:
type: 'string'
networks:
type: 'array'
items:
type: 'string'
additionalProperties: false
...

View File

@ -33,11 +33,5 @@ data:
type: 'number' type: 'number'
device_aliases: device_aliases:
type: 'object' type: 'object'
properties: additionalProperties: true
address:
type: 'string'
dev_type:
type: 'string'
bus_type:
type: 'string'
additionalProperties: false additionalProperties: false

View File

@ -21,19 +21,20 @@ data:
type: 'string' type: 'string'
credetial: credetial:
type: 'string' type: 'string'
additionalProperties: true
storage: storage:
type: 'object' type: 'object'
properties: properties:
physical_devices: physical_devices:
type: 'object' type: 'object'
properties: additionalProperties:
sda:
type: 'object' type: 'object'
properties: properties:
labels: labels:
type: 'object' type: 'object'
properties: additionalProperties:
role: type: 'string'
volume_group:
type: 'string' type: 'string'
partitions: partitions:
type: 'array' type: 'array'
@ -44,8 +45,18 @@ data:
type: 'string' type: 'string'
size: size:
type: 'string' type: 'string'
part_uuid:
type: 'string'
volume_group:
type: 'string'
labels:
type: 'object'
additionalProperties:
type: 'string'
bootable: bootable:
type: 'boolean' type: 'boolean'
volume_group:
type: 'string'
filesystem: filesystem:
type: 'object' type: 'object'
properties: properties:
@ -55,17 +66,19 @@ data:
type: 'string' type: 'string'
mount_options: mount_options:
type: 'string' type: 'string'
sdb: fs_uuid:
type: 'object'
properties:
volume_group:
type: 'string' type: 'string'
fs_label:
type: 'string'
additionalProperties: false
additionalProperties: false
volume_groups: volume_groups:
type: 'object' type: 'object'
properties: additionalProperties:
log_vg:
type: 'object' type: 'object'
properties: properties:
vg_uuid:
type: 'string'
logical_volumes: logical_volumes:
type: 'array' type: 'array'
items: items:
@ -73,6 +86,8 @@ data:
properties: properties:
name: name:
type: 'string' type: 'string'
lv_uuid:
type: 'string'
size: size:
type: 'string' type: 'string'
filesystem: filesystem:
@ -84,6 +99,10 @@ data:
type: 'string' type: 'string'
mount_options: mount_options:
type: 'string' type: 'string'
fs_uuid:
type: 'string'
fs_label:
type: 'string'
platform: platform:
type: 'object' type: 'object'
properties: properties:
@ -93,11 +112,8 @@ data:
type: 'string' type: 'string'
kernel_params: kernel_params:
type: 'object' type: 'object'
properties: additionalProperties: true
quiet: additionalProperties: false
type: 'boolean'
console:
type: 'string'
metadata: metadata:
type: 'object' type: 'object'
properties: properties:
@ -107,9 +123,13 @@ data:
type: 'string' type: 'string'
owner_data: owner_data:
type: 'object' type: 'object'
properties: additionalProperties:
foo:
type: 'string' type: 'string'
rack:
type: 'string'
boot_mac:
type: 'string'
additionalProperties: false
host_profile: host_profile:
type: 'string' type: 'string'
hardware_profile: hardware_profile:
@ -118,27 +138,7 @@ data:
type: 'string' type: 'string'
interfaces: interfaces:
type: 'object' type: 'object'
properties: additionalProperties:
pxe:
type: 'object'
properties:
device_link:
type: 'string'
labels:
type: 'object'
properties:
nonconfig:
type: 'boolean'
slaves:
type: 'array'
items:
type: 'string'
networks:
type: 'array'
items:
type: 'string'
bond0:
type: 'object' type: 'object'
properties: properties:
device_link: device_link:
@ -152,3 +152,4 @@ data:
items: items:
type: 'string' type: 'string'
additionalProperties: false additionalProperties: false
...

View File

@ -10,11 +10,8 @@ data:
id: 'http://att.com/att-comdev/drydock/network.yaml' id: 'http://att.com/att-comdev/drydock/network.yaml'
type: 'object' type: 'object'
properties: properties:
allocation:
type: 'string'
cidr: cidr:
type: 'string' type: 'string'
format: 'ipv4'
ranges: ranges:
type: 'array' type: 'array'
items: items:
@ -28,6 +25,7 @@ data:
end: end:
type: 'string' type: 'string'
format: 'ipv4' format: 'ipv4'
additionalProperties: false
dns: dns:
type: 'object' type: 'object'
properties: properties:
@ -35,7 +33,7 @@ data:
type: 'string' type: 'string'
servers: servers:
type: 'string' type: 'string'
format: 'ipv4' additionalProperties: false
dhcp_relay: dhcp_relay:
type: 'object' type: 'object'
properties: properties:
@ -45,6 +43,7 @@ data:
upstream_target: upstream_target:
type: 'string' type: 'string'
format: 'ipv4' format: 'ipv4'
additionalProperties: false
mtu: mtu:
type: 'number' type: 'number'
vlan: vlan:
@ -56,10 +55,13 @@ data:
properties: properties:
subnet: subnet:
type: 'string' type: 'string'
format: 'ipv4'
gateway: gateway:
type: 'string' type: 'string'
format: 'ipv4' format: 'ipv4'
metric: metric:
type: 'number' type: 'number'
additionalProperties: false additionalProperties: false
labels:
type: 'object'
additionalProperties: true
additionalProperties: false

View File

@ -19,6 +19,13 @@ data:
type: 'string' type: 'string'
peer_rate: peer_rate:
type: 'string' type: 'string'
mon_rate:
type: 'number'
up_delay:
type: 'number'
down_delay:
type: 'number'
additionalProperties: false
mtu: mtu:
type: 'number' type: 'number'
linkspeed: linkspeed:
@ -30,8 +37,12 @@ data:
type: 'string' type: 'string'
default_network: default_network:
type: 'string' type: 'string'
additionalProperties: false
allowed_networks: allowed_networks:
type: 'array' type: 'array'
items: items:
type: 'string' type: 'string'
labels:
type: 'object'
additionalProperties: true
additionalProperties: false additionalProperties: false

View File

@ -30,4 +30,7 @@ data:
type: 'array' type: 'array'
items: items:
type: 'string' type: 'string'
labels:
type: 'object'
additionalProperties: true
additionalProperties: false additionalProperties: false

View File

@ -151,7 +151,6 @@ metadata:
author: sh8121@att.com author: sh8121@att.com
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
spec: spec:
allocation: static
cidr: 172.16.100.0/24 cidr: 172.16.100.0/24
ranges: ranges:
- type: static - type: static

View File

@ -98,7 +98,6 @@ metadata:
author: sh8121@att.com author: sh8121@att.com
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
spec: spec:
allocation: static
cidr: 172.16.100.0/24 cidr: 172.16.100.0/24
ranges: ranges:
- type: static - type: static
@ -119,8 +118,6 @@ metadata:
spec: spec:
# Layer 2 VLAN segment id, could support other segmentations. Optional # Layer 2 VLAN segment id, could support other segmentations. Optional
vlan_id: '99' vlan_id: '99'
# How are addresses assigned?
allocation: dhcp
# MTU for this VLAN interface, if not specified it will be inherited from the link # MTU for this VLAN interface, if not specified it will be inherited from the link
mtu: 1500 mtu: 1500
# Network address # Network address
@ -148,7 +145,6 @@ metadata:
spec: spec:
vlan_id: '100' vlan_id: '100'
# How are addresses assigned? # How are addresses assigned?
allocation: static
# Allow MTU to be inherited from link the network rides on # Allow MTU to be inherited from link the network rides on
mtu: 1500 mtu: 1500
# Network address # Network address
@ -182,7 +178,6 @@ metadata:
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
spec: spec:
vlan_id: '101' vlan_id: '101'
allocation: static
mtu: 9000 mtu: 9000
cidr: 172.16.2.0/24 cidr: 172.16.2.0/24
# Desribe IP address ranges # Desribe IP address ranges
@ -207,7 +202,6 @@ metadata:
spec: spec:
vlan_id: '102' vlan_id: '102'
# How are addresses assigned? # How are addresses assigned?
allocation: static
# MTU size for the VLAN interface # MTU size for the VLAN interface
mtu: 1500 mtu: 1500
cidr: 172.16.3.0/24 cidr: 172.16.3.0/24

View File

@ -11,7 +11,6 @@ metadata:
spec: spec:
vlan_id: '102' vlan_id: '102'
# How are addresses assigned? # How are addresses assigned?
allocation: static
# MTU size for the VLAN interface # MTU size for the VLAN interface
mtu: 1500 mtu: 1500
cidr: 172.16.3.0/24 cidr: 172.16.3.0/24

View File

@ -8,5 +8,14 @@ metadata:
author: sh8121@att.com author: sh8121@att.com
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
spec: spec:
foo: bar storage:
physical_devices:
sda:
labels:
a: 'b'
volume_group: 'a'
partitions:
- name: 'test'
size: '100%'
sdb: 'invalid_device'
... ...

View File

@ -8,7 +8,6 @@ metadata:
author: sh8121@att.com author: sh8121@att.com
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
spec: spec:
allocation: static
cidr: 172.16.100.0/24 cidr: 172.16.100.0/24
ranges: ranges:
- type: static - type: static

View File

@ -53,7 +53,6 @@ metadata:
author: sh8121@att.com author: sh8121@att.com
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
spec: spec:
allocation: static
cidr: 172.16.100.0/24 cidr: 172.16.100.0/24
ranges: ranges:
- type: static - type: static

View File

@ -8,7 +8,6 @@ metadata:
author: sh8121@att.com author: sh8121@att.com
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
spec: spec:
allocation: static
cidr: 172.16.100.0/24 cidr: 172.16.100.0/24
ranges: ranges:
- type: static - type: static