Validate API sample JSON files

Change-Id: I0428e54c4eada67a967a5df36ce9d35a84335c97
This commit is contained in:
YAMAMOTO Takashi 2017-02-10 11:15:01 +09:00
parent 4ffdb4df38
commit 2ce2b2ccbb
10 changed files with 39 additions and 12 deletions

View File

@ -1,7 +1,7 @@
{
"firewall_group": {
"admin_state_up": false,
"egress_firewall_policy_id": "14c9d3c1-b472-44f9-8226-30dc4ffd454c"
"egress_firewall_policy_id": "14c9d3c1-b472-44f9-8226-30dc4ffd454c",
"ingress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c"
}
}

View File

@ -1,8 +1,8 @@
{
"firewall_policy": {
"name": "test-policy"
"name": "test-policy",
"firewall_rules": [
"8722e0e0-9cc9-4490-9660-8c9a5732fbb0"
],
]
}
}

View File

@ -5,8 +5,8 @@
"acbdfead-eca2-4456-838c-8b531e47b9c7"
],
"id": "c9e15d6e-b6ba-4ef4-8715-985d1f100467",
"name": "policy2"
"name": "policy2",
"public": false,
"project_id": "95573613ec554b4b8df9f2679c64557b",
"tenant_id": "95573613ec554b4b8df9f2679c64557b",
"tenant_id": "95573613ec554b4b8df9f2679c64557b"
}

View File

@ -3,8 +3,8 @@
"description": "",
"firewall_rules": [],
"id": "c9e15d6e-b6ba-4ef4-8715-985d1f100467",
"name": "policy2"
"name": "policy2",
"project_id": "95573613ec554b4b8df9f2679c64557b",
"public": false,
"tenant_id": "95573613ec554b4b8df9f2679c64557b",
"tenant_id": "95573613ec554b4b8df9f2679c64557b"
}

View File

@ -10,7 +10,7 @@
"project_id": "b7c1a69e88bf4b21a8148f787aef2081",
"tenant_id": "b7c1a69e88bf4b21a8148f787aef2081",
"vip_address": "10.0.0.4",
"vip_subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2"
"vip_subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2",
"flavor": "a7ae5d5a-d855-4f9a-b187-af66b53f4d04",
"provider": "sample_provider",
"pools": []

View File

@ -5,7 +5,7 @@
"lb_algorithm": "ROUND_ROBIN",
"name": "my-pool",
"protocol": "HTTP",
"subnet_id": "e301aed0-d9e7-498a-977c-1bbfaf14ed5d"
"listener_id": "39de4d56-d663-46e5-85a1-5b9d5fa17829",
"subnet_id": "e301aed0-d9e7-498a-977c-1bbfaf14ed5d",
"listener_id": "39de4d56-d663-46e5-85a1-5b9d5fa17829"
}
}

View File

@ -14,7 +14,7 @@
"project_id": "4fd44f30292945e481c7b8a0c8908869",
"provider:network_type": "vlan",
"provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453",
"provider:segmentation_id": 3
"provider:segmentation_id": 3,
"router:external": false,
"shared": false,
"status": "ACTIVE",

View File

@ -20,7 +20,7 @@
"type": "dscp_marking",
"id": "d9c021d5-5433-4d7c-8bfa-69cca486aac8",
"qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4"
},
}
]
}
]

26
tools/check_samples.sh Executable file
View File

@ -0,0 +1,26 @@
#! /bin/sh
# Copyright (C) 2017 Midokura SARL.
# All Rights Reserved.
#
# 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.
set -e
DIR=api-ref/source/v2/samples
find $DIR -name "*.json" | while read f; do
if ! python -m json.tool $f > /dev/null; then
echo "$f had errors."
exit 1
fi
done

View File

@ -19,6 +19,7 @@ commands =
[testenv:pep8]
commands =
flake8
{toxinidir}/tools/check_samples.sh
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html