nova/nova/tests/functional/api_sample_tests
Matt Riedemann d727795d66 Add REST API support for get me a network
This adds the 2.37 microversion to the REST API for automatically
allocating a network, i.e. get me a network.

The majority of the changes to the REST API concern request
validation. 'networks' is now required in the server POST body
after this microversion. The 'auto' or 'none' special network
uuid values are used, but if specified, can not be specified
with any other requested network values.

The other special case that is checked is when the minimum
compute service version is not new enough to support this change,
i.e. a Mitaka compute will not have the network API code that
knows how to deal with the special auto/none network IDs. Because
the REST API is checking the service version, the service caches
the service version after the first check. Once all computes are
updated to Newton then a restart of the nova-api service(s) will
be required to flush the cache. A release note is provided for
this situation.

The api-ref docs are also updated for this microversion including
an example API sample request.

The matching Tempest change to test this is here:

I89b18709e0cfbbcbf9be96a91a13a1356cdf85b0

The matching python-novaclient change is here:

I6636ddcd3be7bf393d2d69cc6c1ba5c7d65ff674

Implements blueprint get-me-a-network

Change-Id: I89b18709e0cfbbcbf9be96a91a13a1356cdf85b0
2016-08-15 14:10:42 -04:00
..
api_samples Add REST API support for get me a network 2016-08-15 14:10:42 -04:00
__init__.py Move legacy v2 api smaple tests 2015-08-15 12:30:20 +10:00
api_sample_base.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
README.rst add api-samples tox target 2015-12-03 22:43:26 +00:00
test_admin_actions.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_admin_password.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_agents.py api-ref: Example verification for os-agents.inc 2016-06-27 21:29:26 +09:00
test_aggregates.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_assisted_volume_snapshots.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_attach_interfaces.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_availability_zone.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_baremetal_nodes.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_block_device_mapping_boot.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_cells.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_certificates.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_cloudpipe.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_console_auth_tokens.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_console_output.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_consoles.py remove use of _get_regexes in samples tests 2016-01-05 06:33:02 -05:00
test_create_backup.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_deferred_delete.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_evacuate.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_extension_info.py policy: clean-up 2016-06-30 19:56:14 +00:00
test_fixed_ips.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_flavor_access.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_flavor_extraspecs.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_flavor_manage.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_flavors.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_floating_ip_dns.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_floating_ip_pools.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_floating_ips_bulk.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_floating_ips.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_fping.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_hide_server_addresses.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_hosts.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_hypervisors.py Microversion 2.33 adds pagination support for hypervisors 2016-07-01 08:47:50 +08:00
test_images.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_instance_actions.py objects: you want'em 2016-06-20 21:36:05 -04:00
test_instance_usage_audit_log.py Fix invalid import order 2016-07-04 11:23:52 +05:30
test_keypairs.py Microversion 2.35 adds keypairs pagination support 2016-07-12 19:48:05 +03:00
test_limits.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_lock_server.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_migrate_server.py Add missing ComputeHostNotFound exception in live-migration 2016-07-29 10:17:26 +02:00
test_migrations.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_multinic.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_multiple_create.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_networks_associate.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_networks.py network: handle forbidden exception from neutron 2016-07-25 09:19:13 +08:00
test_pause_server.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_pci.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_preserve_ephemeral_rebuild.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_quota_classes.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_quota_sets.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_remote_consoles.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_rescue.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_security_group_default_rules.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_security_groups.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_server_diagnostics.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_server_external_events.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_server_groups.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_server_metadata.py Move config options from nova/api directory (5) 2016-05-17 13:07:47 +00:00
test_server_migrations.py Fix invalid import order 2016-07-04 11:23:52 +05:30
test_server_password.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_server_tags.py Fix PUT server tag 201 to return empty content 2016-07-13 18:45:12 +09:00
test_servers_ips.py Move config options from nova/api directory (5) 2016-05-17 13:07:47 +00:00
test_servers.py Add REST API support for get me a network 2016-08-15 14:10:42 -04:00
test_services.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_shelve.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_simple_tenant_usage.py api-ref: Example verification for os-simple-tenant-usage.inc 2016-08-09 23:52:42 +00:00
test_suspend_server.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_tenant_networks.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_versions.py parametrize max_api_version in tests 2016-02-05 18:54:58 -05:00
test_virtual_interfaces.py Enable all extension for all remaining sample tests 2016-06-10 06:03:02 +00:00
test_volumes.py objects: you want'em 2016-06-20 21:36:05 -04:00

Api Samples

This part of the tree contains templates for API samples. The documentation in doc/api_samples is completely autogenerated from the tests in this directory.

To add a new api sample, add tests for the common passing and failing cases in this directory for your extension, and modify test_samples.py for your tests.

Then run the following command:

tox -e api-samples

Which will create the files on doc/api_samples.

If new tests are added or the .tpl files are changed due to bug fixes, the samples must be regenerated so they are in sync with the templates, as there is an additional test which reloads the documentation and ensures that it's in sync.

Debugging sample generation

If a .tpl is changed, its matching .json must be removed else the samples won't be generated. If an entirely new extension is added, a directory for it must be created before its samples will be generated.