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'
type: 'object'
properties:
host_profile:
type: 'string'
interfaces:
type: 'object'
properties:
bond0:
type: 'object'
properties:
networks:
type: 'array'
items:
type: 'string'
addressing:
type: 'array'
items:
type: 'object'
properties:
network:
type: 'string'
address:
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:
type: 'object'
properties:
tags:
type: 'array'
items:
type: 'string'
owner_data:
type: 'object'
additionalProperties:
type: 'string'
rack:
type: 'string'
additionalProperties: false
boot_mac:
type: 'string'
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'
device_aliases:
type: 'object'
properties:
address:
type: 'string'
dev_type:
type: 'string'
bus_type:
type: 'string'
additionalProperties: true
additionalProperties: false

View File

@ -21,62 +21,44 @@ data:
type: 'string'
credetial:
type: 'string'
additionalProperties: true
storage:
type: 'object'
properties:
physical_devices:
type: 'object'
properties:
sda:
type: 'object'
properties:
labels:
additionalProperties:
type: 'object'
properties:
labels:
type: 'object'
additionalProperties:
type: 'string'
volume_group:
type: 'string'
partitions:
type: 'array'
items:
type: 'object'
properties:
role:
name:
type: 'string'
partitions:
type: 'array'
items:
type: 'object'
properties:
name:
size:
type: 'string'
part_uuid:
type: 'string'
volume_group:
type: 'string'
labels:
type: 'object'
additionalProperties:
type: 'string'
size:
type: 'string'
bootable:
type: 'boolean'
filesystem:
type: 'object'
properties:
mountpoint:
type: 'string'
fstype:
type: 'string'
mount_options:
type: 'string'
sdb:
type: 'object'
properties:
volume_group:
type: 'string'
volume_groups:
type: 'object'
properties:
log_vg:
type: 'object'
properties:
logical_volumes:
type: 'array'
items:
type: 'object'
properties:
name:
type: 'string'
size:
type: 'string'
filesystem:
type: 'object'
bootable:
type: 'boolean'
volume_group:
type: 'string'
filesystem:
type: 'object'
properties:
mountpoint:
type: 'string'
@ -84,6 +66,43 @@ data:
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:
@ -93,11 +112,8 @@ data:
type: 'string'
kernel_params:
type: 'object'
properties:
quiet:
type: 'boolean'
console:
type: 'string'
additionalProperties: true
additionalProperties: false
metadata:
type: 'object'
properties:
@ -107,9 +123,13 @@ data:
type: 'string'
owner_data:
type: 'object'
properties:
foo:
type: 'string'
additionalProperties:
type: 'string'
rack:
type: 'string'
boot_mac:
type: 'string'
additionalProperties: false
host_profile:
type: 'string'
hardware_profile:
@ -118,37 +138,18 @@ data:
type: 'string'
interfaces:
type: 'object'
properties:
pxe:
type: 'object'
properties:
device_link:
additionalProperties:
type: 'object'
properties:
device_link:
type: 'string'
slaves:
type: 'array'
items:
type: 'string'
labels:
type: 'object'
properties:
nonconfig:
type: 'boolean'
slaves:
type: 'array'
items:
type: 'string'
networks:
type: 'array'
items:
type: 'string'
bond0:
type: 'object'
properties:
device_link:
networks:
type: 'array'
items:
type: 'string'
slaves:
type: 'array'
items:
type: 'string'
networks:
type: 'array'
items:
type: 'string'
additionalProperties: false
additionalProperties: false
...

View File

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

View File

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

View File

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

View File

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

View File

@ -74,7 +74,7 @@ spec:
# If this link is a bond of physical links, how is it configured
# 802.3ad
# active-backup
# balance-rr
# balance-rr
# Can add support for others down the road
bonding:
mode: 802.3ad
@ -98,7 +98,6 @@ metadata:
author: sh8121@att.com
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
spec:
allocation: static
cidr: 172.16.100.0/24
ranges:
- type: static
@ -115,18 +114,16 @@ metadata:
region: sitename
date: 17-FEB-2017
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:
# Layer 2 VLAN segment id, could support other segmentations. Optional
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: 1500
# Network address
cidr: 172.16.0.0/24
# Desribe IP address ranges
ranges:
ranges:
- type: dhcp
start: 172.16.0.5
end: 172.16.0.254
@ -148,13 +145,12 @@ metadata:
spec:
vlan_id: '100'
# How are addresses assigned?
allocation: static
# Allow MTU to be inherited from link the network rides on
mtu: 1500
# Network address
cidr: 172.16.1.0/24
# Desribe IP address ranges
ranges:
ranges:
- type: static
start: 172.16.1.15
end: 172.16.1.254
@ -182,11 +178,10 @@ metadata:
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
spec:
vlan_id: '101'
allocation: static
mtu: 9000
cidr: 172.16.2.0/24
# Desribe IP address ranges
ranges:
ranges:
# Type can be reserved (not used for baremetal), static (all explicit
# assignments should fall here), dhcp (will be used by a DHCP server on this network)
- type: static
@ -207,12 +202,11 @@ metadata:
spec:
vlan_id: '102'
# How are addresses assigned?
allocation: static
# MTU size for the VLAN interface
mtu: 1500
cidr: 172.16.3.0/24
# Desribe IP address ranges
ranges:
ranges:
- type: static
start: 172.16.3.15
end: 172.16.3.254

View File

@ -118,7 +118,7 @@ spec:
# host_profile inheritance allows for deduplication of common CIs
# Inheritance is additive for CIs that are lists of multiple items
# To remove an inherited list member, prefix the primary key value
# with '!'.
# with '!'.
host_profile: defaults
# Hardware profile will map hardware specific details to the abstract
# names uses in the host profile as well as specify hardware specific

View File

@ -1,5 +1,5 @@
---
apiVersion:
apiVersion:
: Network
metadata:
name: public
@ -11,12 +11,11 @@ metadata:
spec:
vlan_id: '102'
# How are addresses assigned?
allocation: static
# MTU size for the VLAN interface
mtu: 1500
cidr: 172.16.3.0/24
# Desribe IP address ranges
ranges:
ranges:
- type: static
start: 172.16.3.15
end: 172.16.3.254
@ -26,4 +25,4 @@ spec:
metric: 9
dns:
domain: sitename.example.com
servers: 8.8.8.8
servers: 8.8.8.8

View File

@ -8,5 +8,14 @@ metadata:
author: sh8121@att.com
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
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
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
spec:
allocation: static
cidr: 172.16.100.0/24
ranges:
- type: static
@ -17,4 +16,4 @@ spec:
dns:
domain: ilo.sitename.att.com
servers: 172.16.100.10
...
...

View File

@ -53,7 +53,6 @@ metadata:
author: sh8121@att.com
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
spec:
allocation: static
cidr: 172.16.100.0/24
ranges:
- type: static
@ -86,7 +85,7 @@ spec:
credential: admin
# Specify storage layout of base OS. Ceph out of scope
storage:
# How storage should be carved up: lvm (logical volumes), flat
# How storage should be carved up: lvm (logical volumes), flat
# (single partition)
layout: lvm
# Info specific to the boot and root disk/partitions
@ -134,7 +133,7 @@ spec:
# host_profile inheritance allows for deduplication of common CIs
# Inheritance is additive for CIs that are lists of multiple items
# To remove an inherited list member, prefix the primary key value
# with '!'.
# with '!'.
host_profile: defaults
# Hardware profile will map hardware specific details to the abstract
# names uses in the host profile as well as specify hardware specific

View File

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

View File

@ -23,7 +23,7 @@ spec:
credential: admin
# Specify storage layout of base OS. Ceph out of scope
storage:
# How storage should be carved up: lvm (logical volumes), flat
# How storage should be carved up: lvm (logical volumes), flat
# (single partition)
layout: lvm
# Info specific to the boot and root disk/partitions
@ -57,4 +57,4 @@ spec:
# Additional metadata to apply to a node
metadata:
# Base URL of the introspection service - may go in curtin data
introspection_url: http://172.16.1.10:9090
introspection_url: http://172.16.1.10:9090