nova/doc/api_samples/os-rescue/server-get-resp-rescue.json
Matt Riedemann 211e9b1961 Implement power_off/power_on for the FakeDriver
When trying to recreate hundreds of instance action
events for scale testing with the FakeDriver, a nice
simple way to do that is by stopping those instances
and starting them again.

However, since power_off/on aren't implemented, once
you "stop" them the sync_instance_power_state periodic
task in the compute manager thinks they are still running
on the "hypervisor" and will stop them again via the API,
which records yet another instance action and set of
events.

This just toggles the power state bit on the fake instance
in the FakeDriver to make the periodic task do the right
thing.

As a result, we also have more realistic API and
notification samples.

Change-Id: Ie621686053ad774c4ae4f22bb2a455f98900b611
2017-11-02 11:34:42 -04:00

74 lines
2.5 KiB
JSON

{
"server": {
"accessIPv4": "1.2.3.4",
"accessIPv6": "80fe::",
"addresses": {
"private": [
{
"addr": "192.168.0.3",
"OS-EXT-IPS-MAC:mac_addr": "aa:bb:cc:dd:ee:ff",
"OS-EXT-IPS:type": "fixed",
"version": 4
}
]
},
"created": "2013-09-18T07:22:09Z",
"flavor": {
"id": "1",
"links": [
{
"href": "http://openstack.example.com/6f70656e737461636b20342065766572/flavors/1",
"rel": "bookmark"
}
]
},
"hostId": "f04994c5b4aac1cacbb83b09c2506e457d97dd54f620961624574690",
"id": "2fd0c66b-50af-41d2-9253-9fa41e7e8dd8",
"image": {
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
"links": [
{
"href": "http://openstack.example.com/6f70656e737461636b20342065766572/images/70a599e0-31e7-49b7-b260-868f441e862b",
"rel": "bookmark"
}
]
},
"key_name": null,
"links": [
{
"href": "http://openstack.example.com/v2/6f70656e737461636b20342065766572/servers/2fd0c66b-50af-41d2-9253-9fa41e7e8dd8",
"rel": "self"
},
{
"href": "http://openstack.example.com/6f70656e737461636b20342065766572/servers/2fd0c66b-50af-41d2-9253-9fa41e7e8dd8",
"rel": "bookmark"
}
],
"metadata": {
"My Server Name": "Apache1"
},
"name": "new-server-test",
"status": "RESCUE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-09-18T07:22:11Z",
"user_id": "fake",
"config_drive": "",
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "nova",
"OS-EXT-SRV-ATTR:host": "b8b357f7100d4391828f2177c922ef93",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "fake-mini",
"OS-EXT-SRV-ATTR:instance_name": "instance-00000001",
"OS-EXT-STS:power_state": 4,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "rescued",
"os-extended-volumes:volumes_attached": [],
"OS-SRV-USG:launched_at": "2013-09-23T13:37:00.880302",
"OS-SRV-USG:terminated_at": null,
"security_groups": [
{
"name": "default"
}
]
}
}