Merge "Update regenerate-samples.sh api-ref script"
This commit is contained in:
commit
f2d4d76b7d
@ -18,7 +18,11 @@ export OS_AUTH_TOKEN IRONIC_URL
|
|||||||
DOC_CHASSIS_UUID="dff29d23-1ded-43b4-8ae1-5eebb3e30de1"
|
DOC_CHASSIS_UUID="dff29d23-1ded-43b4-8ae1-5eebb3e30de1"
|
||||||
DOC_NODE_UUID="6d85703a-565d-469a-96ce-30b6de53079d"
|
DOC_NODE_UUID="6d85703a-565d-469a-96ce-30b6de53079d"
|
||||||
DOC_PORT_UUID="d2b30520-907d-46c8-bfee-c5586e6fb3a1"
|
DOC_PORT_UUID="d2b30520-907d-46c8-bfee-c5586e6fb3a1"
|
||||||
DOC_PORTGROUP_UUID="e059deab-6e86-40d1-9e70-62d525f16728"
|
DOC_PORTGROUP_UUID="e43c722c-248e-4c6e-8ce8-0d8ff129387a"
|
||||||
|
DOC_PROVISION_UPDATED_AT="2016-08-18T22:28:49.946416+00:00"
|
||||||
|
DOC_CREATED_AT="2016-08-18T22:28:48.643434+11:11"
|
||||||
|
DOC_UPDATED_AT="2016-08-18T22:28:49.653974+00:00"
|
||||||
|
DOC_IRONIC_CONDUCTOR_HOSTNAME="897ab1dad809"
|
||||||
|
|
||||||
function GET {
|
function GET {
|
||||||
# GET $RESOURCE
|
# GET $RESOURCE
|
||||||
@ -54,6 +58,27 @@ function PUT {
|
|||||||
${IRONIC_URL}/$1
|
${IRONIC_URL}/$1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function wait_for_node_state {
|
||||||
|
local node="$1"
|
||||||
|
local field="$2"
|
||||||
|
local target_state="$3"
|
||||||
|
local attempt=10
|
||||||
|
|
||||||
|
while [[ $attempt -gt 0 ]]; do
|
||||||
|
res=$(openstack baremetal node show "$node" -f value -c "$field")
|
||||||
|
if [[ "$res" == "$target_state" ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
attempt=$((attempt - 1))
|
||||||
|
echo "Failed to get node $field == $target_state in $attempt attempts."
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ $attempt == 0 ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
pushd source/samples
|
pushd source/samples
|
||||||
|
|
||||||
###########
|
###########
|
||||||
@ -116,10 +141,14 @@ GET v1/nodes/$NID/vendor_passthru/methods > node-vendor-passthru-response.json
|
|||||||
PATCH v1/nodes/$NID node-update-driver.json
|
PATCH v1/nodes/$NID node-update-driver.json
|
||||||
PUT v1/nodes/$NID/states/provision node-set-manage-state.json
|
PUT v1/nodes/$NID/states/provision node-set-manage-state.json
|
||||||
PUT v1/nodes/$NID/states/provision node-set-available-state.json
|
PUT v1/nodes/$NID/states/provision node-set-available-state.json
|
||||||
|
# Wait node to become available
|
||||||
|
wait_for_node_state $NID provision_state available
|
||||||
|
|
||||||
GET v1/nodes/$NID/validate > node-validate-response.json
|
GET v1/nodes/$NID/validate > node-validate-response.json
|
||||||
|
|
||||||
PUT v1/nodes/$NID/states/power node-set-power-off.json
|
PUT v1/nodes/$NID/states/power node-set-power-off.json
|
||||||
|
# Wait node to reach power off state
|
||||||
|
wait_for_node_state $NID power_state "power off"
|
||||||
GET v1/nodes/$NID/states > node-get-state-response.json
|
GET v1/nodes/$NID/states > node-get-state-response.json
|
||||||
|
|
||||||
GET v1/nodes > nodes-list-response.json
|
GET v1/nodes > nodes-list-response.json
|
||||||
@ -216,3 +245,7 @@ sed -i "s/$CID/$DOC_CHASSIS_UUID/" *.json
|
|||||||
sed -i "s/$NID/$DOC_NODE_UUID/" *.json
|
sed -i "s/$NID/$DOC_NODE_UUID/" *.json
|
||||||
sed -i "s/$PID/$DOC_PORT_UUID/" *.json
|
sed -i "s/$PID/$DOC_PORT_UUID/" *.json
|
||||||
sed -i "s/$PGID/$DOC_PORTGROUP_UUID/" *.json
|
sed -i "s/$PGID/$DOC_PORTGROUP_UUID/" *.json
|
||||||
|
sed -i "s/$(hostname)/$DOC_IRONIC_CONDUCTOR_HOSTNAME/" *.json
|
||||||
|
sed -i "s/created_at\": \".*\"/created_at\": \"$DOC_CREATED_AT\"/" *.json
|
||||||
|
sed -i "s/updated_at\": \".*\"/updated_at\": \"$DOC_UPDATED_AT\"/" *.json
|
||||||
|
sed -i "s/provision_updated_at\": \".*\"/provision_updated_at\": \"$DOC_PROVISION_UPDATED_AT\"/" *.json
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"chassis": [
|
"chassis": [
|
||||||
{
|
{
|
||||||
"created_at": "2016-08-18T22:28:48.165105+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"description": "Sample chassis",
|
"description": "Sample chassis",
|
||||||
"extra": {},
|
"extra": {},
|
||||||
"links": [
|
"links": [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"created_at": "2016-08-18T22:28:48.165105+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"description": "Sample chassis",
|
"description": "Sample chassis",
|
||||||
"extra": {},
|
"extra": {},
|
||||||
"links": [
|
"links": [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"created_at": "2016-08-18T22:28:48.165105+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"description": "Updated Chassis",
|
"description": "Updated Chassis",
|
||||||
"extra": {},
|
"extra": {},
|
||||||
"links": [
|
"links": [
|
||||||
@ -22,6 +22,6 @@
|
|||||||
"rel": "bookmark"
|
"rel": "bookmark"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"updated_at": "2016-08-18T22:28:48.556556+00:00",
|
"updated_at": "2016-08-18T22:28:49.653974+00:00",
|
||||||
"uuid": "dff29d23-1ded-43b4-8ae1-5eebb3e30de1"
|
"uuid": "dff29d23-1ded-43b4-8ae1-5eebb3e30de1"
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"chassis_uuid": null,
|
||||||
"clean_step": {},
|
"clean_step": {},
|
||||||
"console_enabled": false,
|
"console_enabled": false,
|
||||||
"created_at": "2016-08-18T22:28:48.643434+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"driver": "agent_ipmitool",
|
"driver": "agent_ipmitool",
|
||||||
"driver_info": {
|
"driver_info": {
|
||||||
"ipmi_password": "******",
|
"ipmi_password": "******",
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"last_error": null,
|
"last_error": null,
|
||||||
"power_state": "power off",
|
"power_state": "power off",
|
||||||
"provision_state": "available",
|
"provision_state": "available",
|
||||||
"provision_updated_at": "2016-08-18T22:28:49.382814+00:00",
|
"provision_updated_at": "2016-08-18T22:28:49.946416+00:00",
|
||||||
"raid_config": {},
|
"raid_config": {},
|
||||||
"target_power_state": null,
|
"target_power_state": null,
|
||||||
"target_provision_state": null,
|
"target_provision_state": null,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"ports": [
|
"ports": [
|
||||||
{
|
{
|
||||||
"address": "22:22:22:22:22:22",
|
"address": "22:22:22:22:22:22",
|
||||||
"created_at": "2016-08-18T22:28:49.946416+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"extra": {},
|
"extra": {},
|
||||||
"internal_info": {},
|
"internal_info": {},
|
||||||
"links": [
|
"links": [
|
||||||
@ -23,7 +23,7 @@
|
|||||||
"node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d",
|
"node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d",
|
||||||
"portgroup_uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a",
|
"portgroup_uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a",
|
||||||
"pxe_enabled": true,
|
"pxe_enabled": true,
|
||||||
"updated_at": "2016-08-18T22:28:50.148137+00:00",
|
"updated_at": "2016-08-18T22:28:49.653974+00:00",
|
||||||
"uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1"
|
"uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"portgroups": [
|
"portgroups": [
|
||||||
{
|
{
|
||||||
"address": "22:22:22:22:22:22",
|
"address": "22:22:22:22:22:22",
|
||||||
"created_at": "2016-08-18T22:28:48.165105+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"extra": {},
|
"extra": {},
|
||||||
"internal_info": {},
|
"internal_info": {},
|
||||||
"links": [
|
"links": [
|
||||||
@ -30,7 +30,7 @@
|
|||||||
],
|
],
|
||||||
"properties": {},
|
"properties": {},
|
||||||
"standalone_ports_supported": true,
|
"standalone_ports_supported": true,
|
||||||
"updated_at": "2016-11-04T17:46:09+00:00",
|
"updated_at": "2016-08-18T22:28:49.653974+00:00",
|
||||||
"uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a"
|
"uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"target": "power on"
|
|
||||||
}
|
|
@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"chassis_uuid": null,
|
||||||
"clean_step": {},
|
"clean_step": {},
|
||||||
"console_enabled": false,
|
"console_enabled": false,
|
||||||
"created_at": "2016-08-18T22:28:48.643434+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"driver": "fake",
|
"driver": "fake",
|
||||||
"driver_info": {
|
"driver_info": {
|
||||||
"ipmi_password": "******",
|
"ipmi_password": "******",
|
||||||
@ -53,7 +54,7 @@
|
|||||||
"power_state": "power off",
|
"power_state": "power off",
|
||||||
"properties": {},
|
"properties": {},
|
||||||
"provision_state": "available",
|
"provision_state": "available",
|
||||||
"provision_updated_at": "2016-08-18T22:28:49.382814+00:00",
|
"provision_updated_at": "2016-08-18T22:28:49.946416+00:00",
|
||||||
"raid_config": {},
|
"raid_config": {},
|
||||||
"reservation": null,
|
"reservation": null,
|
||||||
"resource_class": null,
|
"resource_class": null,
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"console_enabled": false,
|
|
||||||
"last_error": null,
|
|
||||||
"power_state": "power on",
|
|
||||||
"provision_state": null,
|
|
||||||
"provision_updated_at": null,
|
|
||||||
"raid_config": null,
|
|
||||||
"target_power_state": "power on",
|
|
||||||
"target_provision_state": "active",
|
|
||||||
"target_raid_config": null
|
|
||||||
}
|
|
@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"chassis_uuid": null,
|
||||||
"clean_step": {},
|
"clean_step": {},
|
||||||
"console_enabled": false,
|
"console_enabled": false,
|
||||||
"created_at": "2016-08-18T22:28:48+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"driver": "fake",
|
"driver": "fake",
|
||||||
"driver_info": {
|
"driver_info": {
|
||||||
"deploy_kernel": "http://127.0.0.1/images/kernel",
|
"deploy_kernel": "http://127.0.0.1/images/kernel",
|
||||||
@ -55,7 +56,7 @@
|
|||||||
"power_state": "power off",
|
"power_state": "power off",
|
||||||
"properties": {},
|
"properties": {},
|
||||||
"provision_state": "available",
|
"provision_state": "available",
|
||||||
"provision_updated_at": "2016-08-18T22:28:49+00:00",
|
"provision_updated_at": "2016-08-18T22:28:49.946416+00:00",
|
||||||
"raid_config": {},
|
"raid_config": {},
|
||||||
"reservation": null,
|
"reservation": null,
|
||||||
"resource_class": null,
|
"resource_class": null,
|
||||||
@ -72,6 +73,6 @@
|
|||||||
"target_power_state": null,
|
"target_power_state": null,
|
||||||
"target_provision_state": null,
|
"target_provision_state": null,
|
||||||
"target_raid_config": {},
|
"target_raid_config": {},
|
||||||
"updated_at": "2016-08-18T22:28:50+00:00",
|
"updated_at": "2016-08-18T22:28:49.653974+00:00",
|
||||||
"uuid": "6d85703a-565d-469a-96ce-30b6de53079d"
|
"uuid": "6d85703a-565d-469a-96ce-30b6de53079d"
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
|
"chassis_uuid": null,
|
||||||
"clean_step": {},
|
"clean_step": {},
|
||||||
"console_enabled": false,
|
"console_enabled": false,
|
||||||
"created_at": "2016-08-18T22:28:48.643434+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"driver": "fake",
|
"driver": "fake",
|
||||||
"driver_info": {
|
"driver_info": {
|
||||||
"ipmi_password": "******",
|
"ipmi_password": "******",
|
||||||
@ -55,7 +56,7 @@
|
|||||||
"power_state": "power off",
|
"power_state": "power off",
|
||||||
"properties": {},
|
"properties": {},
|
||||||
"provision_state": "available",
|
"provision_state": "available",
|
||||||
"provision_updated_at": "2016-08-18T22:28:49.382814+00:00",
|
"provision_updated_at": "2016-08-18T22:28:49.946416+00:00",
|
||||||
"raid_config": {},
|
"raid_config": {},
|
||||||
"reservation": null,
|
"reservation": null,
|
||||||
"resource_class": null,
|
"resource_class": null,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"address": "11:11:11:11:11:11",
|
"address": "11:11:11:11:11:11",
|
||||||
"created_at": "2016-08-18T22:28:49.946416+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"extra": {},
|
"extra": {},
|
||||||
"internal_info": {},
|
"internal_info": {},
|
||||||
"links": [
|
"links": [
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"ports": [
|
"ports": [
|
||||||
{
|
{
|
||||||
"address": "11:11:11:11:11:11",
|
"address": "11:11:11:11:11:11",
|
||||||
"created_at": "2016-08-18T22:28:49.946416+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"extra": {},
|
"extra": {},
|
||||||
"internal_info": {},
|
"internal_info": {},
|
||||||
"links": [
|
"links": [
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"address": "22:22:22:22:22:22",
|
"address": "22:22:22:22:22:22",
|
||||||
"created_at": "2016-08-18T22:28:49+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"extra": {},
|
"extra": {},
|
||||||
"internal_info": {},
|
"internal_info": {},
|
||||||
"links": [
|
"links": [
|
||||||
@ -21,6 +21,6 @@
|
|||||||
"node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d",
|
"node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d",
|
||||||
"portgroup_uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a",
|
"portgroup_uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a",
|
||||||
"pxe_enabled": true,
|
"pxe_enabled": true,
|
||||||
"updated_at": "2016-08-18T22:28:50+00:00",
|
"updated_at": "2016-08-18T22:28:49.653974+00:00",
|
||||||
"uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1"
|
"uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"address": "11:11:11:11:11:11",
|
"address": "11:11:11:11:11:11",
|
||||||
"created_at": "2016-08-18T22:28:48.165105+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"extra": {},
|
"extra": {},
|
||||||
"internal_info": {},
|
"internal_info": {},
|
||||||
"links": [
|
"links": [
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"portgroups": [
|
"portgroups": [
|
||||||
{
|
{
|
||||||
"address": "11:11:11:11:11:11",
|
"address": "11:11:11:11:11:11",
|
||||||
"created_at": "2016-08-18T22:28:48.165105+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"extra": {},
|
"extra": {},
|
||||||
"internal_info": {},
|
"internal_info": {},
|
||||||
"links": [
|
"links": [
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"ports": [
|
"ports": [
|
||||||
{
|
{
|
||||||
"address": "22:22:22:22:22:22",
|
"address": "22:22:22:22:22:22",
|
||||||
"created_at": "2016-08-18T22:28:48.165105+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"extra": {},
|
"extra": {},
|
||||||
"internal_info": {},
|
"internal_info": {},
|
||||||
"links": [
|
"links": [
|
||||||
@ -23,7 +23,7 @@
|
|||||||
"node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d",
|
"node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d",
|
||||||
"portgroup_uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a",
|
"portgroup_uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a",
|
||||||
"pxe_enabled": true,
|
"pxe_enabled": true,
|
||||||
"updated_at": "2016-11-04T17:46:09+00:00",
|
"updated_at": "2016-08-18T22:28:49.653974+00:00",
|
||||||
"uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1"
|
"uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"address": "22:22:22:22:22:22",
|
"address": "22:22:22:22:22:22",
|
||||||
"created_at": "2016-08-18T22:28:48.165105+00:00",
|
"created_at": "2016-08-18T22:28:48.643434+11:11",
|
||||||
"extra": {},
|
"extra": {},
|
||||||
"internal_info": {},
|
"internal_info": {},
|
||||||
"links": [
|
"links": [
|
||||||
@ -28,6 +28,6 @@
|
|||||||
],
|
],
|
||||||
"properties": {},
|
"properties": {},
|
||||||
"standalone_ports_supported": true,
|
"standalone_ports_supported": true,
|
||||||
"updated_at": "2016-11-04T17:46:09+00:00",
|
"updated_at": "2016-08-18T22:28:49.653974+00:00",
|
||||||
"uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a"
|
"uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user