Use v2.1 URLs instead of v3 ones in API unit tests

Now v2.1 API unit tests use fake.wsgi_app_v3() and they specify v3 URLs.
This patch adds wsgi_app_v21() for using v2 URLs in v2.1 API tests and
changes URLs in unit tests.

Partially implements blueprint v2-on-v3-api

Change-Id: I5cdd7dd1d435ab0e4e093168f01e96f8dac52e8c
Let update_available_resource hit slave

Deployments that have a slave_connection configured can offload
read queries generated by this periodic task there. For
deployments with no slave, behavior remains the same.

Change-Id: Ie663ccc4e3e4334af4bdf75a95689c41ecc959b9
Blueprint: juno-slaveification
Change v3 availability-zone API to v2.1

This patch changes v3 availability-zone API to v2.1 and makes v2
unit tests share between v2 and v2.1.

The differences between v2 and v3 are described on the wiki page
https://wiki.openstack.org/wiki/NovaAPIv2tov3.

Partially implements blueprint v2-on-v3-api

Change-Id: Ifbd152e431d182a5ccabac7fcc84fcc8a2fc6e5a
Adds nova-idmapshift cli utility

nova-idmapshift will be used by the libvirt-lxc driver to
correctly shift ownership of instance rootfs for use with
user namespaces.

Partially implements: bp libvirt-lxc-user-namespaces

Change-Id: I9aee622cca4578149201f02d02231a7bd0cbe912
Change v3 version API to v2.1

This patch changes v3 version API to v2.1 and makes v2 unit tests
share between v2 and v2.1.
v2.1 API does not support XML format. Unit tests related to XML
don't work against v2.1.

Partially implements blueprint v2-on-v3-api

Change-Id: I7abadb0c9082b9e90a98938967f0e27d1a2fa766
Convert multiple-create v3 plugin to v2.1

Changes required to have the multiple create v3 plugin natively
support the v2.1 API. The following Server creation parameters
are reverted:

os-multiple-create:min_count -> min_count
os-multiple-create:max_count -> max_count
os-multiple-create:return_reservation_id -> return_reservation_id

Removes min_count parameter for a test which should never have
been included but due to a gap in input validation was ignored.

Partially implements blueprint v2-on-v3-api

Change-Id: Ie435c357958066e9fde40eab54826261ee9d4226
InstanceNUMAToplogy object create remove uuid param

We can get this from the object attribute so no need to pass it in
explicitly.

We do not need to bump the version of the object as there is no code
calling it as of yet, so we do not have to support the broken method
interface until the next major version bump.

Change-Id: I96e1d958e907272d94d7ca6481592b79ea6b6397
Blueprint: virt-driver-numa-placement
Add API schema for v2.1 "create a server" API

By defining the API schema, it is possible to separate the validation
code from the API method. The API method can be more simple.
In addition, a response of API validation error can be consistent for
the whole Nova API.

Partially implements blueprint v3-api-schema

Change-Id: Ic17d2227909c9180ca86c9d578dad4c73ec57dfc
Convert migrate_server v3 plugin to v2.1

Changes required to have v3 plugin natively support
the v2 API.

The migrate_live action is reverted back to os-migrateLive

Partially implements blueprint v2-on-v3-api

Change-Id: Ib3332ecfbf47ed6cad6108399083f0c26b7eebfe
Port v2 images extension to work in v2.1(v3) framework

Ports v2 images extension and adapts it to the v2.1/v3 API
framework. API behaviour is identical with the exception
that there is no support for XML. Also

- unittest code modified to share testing with both v2/v2.1
  where appropriate
- Adds expected error decorators for API methods

Partially implements blueprint v2-on-v3-api

Change-Id: I7b15a56f41612e3bbf5d59c3ad44fd32386ff315
Port limits extension to work in v2.1/v3 framework

Ports v2 limits extension and adapts it to the v2.1/v3 API
framework. API behaviour is identical with the exception that
there is no support for rate limiting since no one uses that
seriously anyway.

- unittest code modified to share testing with both v2/v2.1
- Adds expected error decorators for API methods

Partially implements blueprint v2-on-v3-api

Change-Id: I072d364f4d2a92a02801862435f11417956d2dc0
Port volumes extension to work in v2.1/v3 framework

Ports v2 volumes extension and adapts it to the v2.1/v3 API
framework. API behaviour is identical with the exception
that there is no support for XML. Also

- unittest code modified to share testing with both v2/v2.1
  where appropriate
- Adds expected error decorators for API methods

Note that there will be further code cleanup in the future
but the code currently is mostly as-is from the v2 codebase.

Partially implements blueprint v2-on-v3-api

Change-Id: If2a9dd1f5233812a1177b54ded6f0ae115c54e97
Convert v3 servers return_reservation_id behaviour to v2.1

Changes return reservation id format on server create to
the v2.1 format.

Adds api sample tests for the os-multiple-create plugin

Partially implements blueprint v2-on-v3-api

Change-Id: I148cce80fb4b19a4240e00ca206fcb7bac20f357
Convert server_usage v3 plugin to v2.1 API

Changes required to have v3 plugin natively support the V2.1
API.

The parameters is changed from os-server-usage to OS-SRV-USG

Partially implements blueprint v2-on-v3-api
Co-Authored-By: Chris Yeoh <cyeoh@au1.ibm.com>

Change-Id: I4a4ebe533f8910a29b54d6ec9554cc151af492d1
Convert v3 hypervisor plugin to v2.1

This patch convert v3 hypervisor plugin to v2.1 and makes v2
unit tests share between v2 and v2.1.

Unit tests has been modified in optimized way.

The differences between v2 and v3 are described on the wiki page
https://wiki.openstack.org/wiki/NovaAPIv2tov3.

Partially implements blueprint v2-on-v3-api

Change-Id: I23ffc10d4c0170cb43ef8aeebf69ae2794a08827
Merge "Adds nova-idmapshift cli utility"
Merge "Let update_available_resource hit slave"
Merge "Change v3 availability-zone API to v2.1"
Merge "Convert migrate_server v3 plugin to v2.1"
Merge "Convert v3 hypervisor plugin to v2.1"