Fix version discovery for the Octavia API

This adds the required "links" part of the version discovery document.

Change-Id: I18e75116e1da47991d68b0842892f1036adec41a
Story: 2001796
Task: 12518
This commit is contained in:
Michael Johnson 2018-04-06 19:55:01 -07:00
parent 8f3eeb5b2e
commit 87fca27e37
82 changed files with 323 additions and 240 deletions

View File

@ -1,14 +1,27 @@
{ {
"versions": [ "versions": [{
{ "status": "DEPRECATED",
"id": "v2.0", "updated": "2014-12-11T00:00:00Z",
"status": "CURRENT", "id": "v1",
"updated": "2017-02-17T00:00:00Z" "links": [{
}, "href": "http://10.21.21.53/load-balancer/v1",
{ "rel": "self"
"id": "v1", }]
"status": "DEPRECATED", }, {
"updated": "2014-12-11T00:00:00Z" "status": "SUPPORTED",
} "updated": "2016-12-11T00:00:00Z",
] "id": "v2.0",
"links": [{
"href": "http://10.21.21.53/load-balancer/v2",
"rel": "self"
}]
}, {
"status": "CURRENT",
"updated": "2018-04-20T00:00:00Z",
"id": "v2.1",
"links": [{
"href": "http://10.21.21.53/load-balancer/v2",
"rel": "self"
}]
}]
} }

View File

@ -9,15 +9,15 @@ the Octavia project.
Current API version Current API version
:doc:`Octavia API v2.0<v2/index>` :doc:`Octavia API v2<v2/index>`
Supported API version Supported API version
:doc:`v1/octaviaapi` None
Deprecated API version Deprecated API version
None :doc:`v1/octaviaapi`
.. toctree:: .. toctree::
:hidden: :hidden:
@ -25,6 +25,11 @@ Deprecated API version
v2/index v2/index
v1/octaviaapi v1/octaviaapi
Octavia API minor releases are additive to the API major revision and share
the same URL path. Minor revision changes to the API are called out in the API
reference in the section the change occured in. Subsquent minor versions are a
superset of the previous versions of the same major revision.
The API status reflects the state of the endpoint on the service. The API status reflects the state of the endpoint on the service.
* Current indicates a stable version that is up-to-date, recent, and might * Current indicates a stable version that is up-to-date, recent, and might
@ -46,12 +51,12 @@ The API status reflects the state of the endpoint on the service.
API Discovery API Discovery
------------- -------------
List All Major Versions List All Versions
======================= =======================
.. rest_method:: GET / .. rest_method:: GET /
This fetches all the information about all known major API versions in the This fetches all the information about all known API versions in the
deployment. deployment.
Response codes Response codes
@ -71,6 +76,7 @@ Response
.. rest_parameters:: parameters.yaml .. rest_parameters:: parameters.yaml
- id: api_version_id - id: api_version_id
- links: links
- status: api_version_status - status: api_version_status
- updated_at: updated_at - updated_at: updated_at

View File

@ -644,6 +644,12 @@ lb-network-ip:
in: body in: body
required: true required: true
type: string type: string
links:
description: |
A list of relative links. Includes the self link for the API.
in: body
required: true
type: array
listener: listener:
description: | description: |
A listener object. A listener object.

View File

@ -1,5 +1,5 @@
Octavia API v1 (SUPPORTED) Octavia API v1 (DEPRECATED)
========================== ===========================
Authentication Authentication
-------------- --------------

View File

@ -3,7 +3,7 @@
List Amphora List Amphora
============ ============
.. rest_method:: GET /v2.0/octavia/amphorae .. rest_method:: GET /v2/octavia/amphorae
Lists all amphora for the project. Lists all amphora for the project.
@ -80,7 +80,7 @@ Response Example
Show Amphora details Show Amphora details
=========================== ===========================
.. rest_method:: GET /v2.0/octavia/amphorae/{amphora_id} .. rest_method:: GET /v2/octavia/amphorae/{amphora_id}
Shows the details of an amphora. Shows the details of an amphora.
@ -154,7 +154,7 @@ Response Example
Failover Amphora Failover Amphora
================ ================
.. rest_method:: PUT /v2.0/octavia/amphorae/{amphora_id}/failover .. rest_method:: PUT /v2/octavia/amphorae/{amphora_id}/failover
Force an amphora to failover. Force an amphora to failover.

View File

@ -1 +1 @@
curl -X PUT -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/octavia/amphorae/6bd55cd3-802e-447e-a518-1e74e23bb106/failover curl -X PUT -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/octavia/amphorae/6bd55cd3-802e-447e-a518-1e74e23bb106/failover

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/octavia/amphorae?loadbalancer_id=09eedfc6-2c55-41a8-a75c-2cd4e95212ca curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/octavia/amphorae?loadbalancer_id=09eedfc6-2c55-41a8-a75c-2cd4e95212ca

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/octavia/amphorae/6bd55cd3-802e-447e-a518-1e74e23bb106 curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/octavia/amphorae/6bd55cd3-802e-447e-a518-1e74e23bb106

View File

@ -1 +1 @@
curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"healthmonitor":{"name":"super-pool-health-monitor","admin_state_up":true,"pool_id":"4029d267-3983-4224-a3d0-afb3fe16a2cd","delay":"10","expected_codes":"200","max_retries":"1","http_method":"GET","timeout":"5","url_path":"/","type":"HTTP","max_retries_down":3}}' http://198.51.100.10:9876/v2.0/lbaas/healthmonitors curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"healthmonitor":{"name":"super-pool-health-monitor","admin_state_up":true,"pool_id":"4029d267-3983-4224-a3d0-afb3fe16a2cd","delay":"10","expected_codes":"200","max_retries":"1","http_method":"GET","timeout":"5","url_path":"/","type":"HTTP","max_retries_down":3}}' http://198.51.100.10:9876/v2/lbaas/healthmonitors

View File

@ -1 +1 @@
curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/healthmonitors/8ed3c5ac-6efa-420c-bedb-99ba14e58db5 curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/healthmonitors/8ed3c5ac-6efa-420c-bedb-99ba14e58db5

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/healthmonitors?project_id=e3cd678b11784734bc366148aa37580e curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/healthmonitors?project_id=e3cd678b11784734bc366148aa37580e

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/healthmonitors/8ed3c5ac-6efa-420c-bedb-99ba14e58db5 curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/healthmonitors/8ed3c5ac-6efa-420c-bedb-99ba14e58db5

View File

@ -1 +1 @@
curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"healthmonitor":{"name":"super-pool-health-monitor-updated","admin_state_up":true,"delay":5,"expected_codes":"200","http_method":"HEAD","timeout":2,"url_path":"/index.html","max_retries":2,"max_retries_down":2}}' http://198.51.100.10:9876/v2.0/lbaas/healthmonitors/8ed3c5ac-6efa-420c-bedb-99ba14e58db5 curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"healthmonitor":{"name":"super-pool-health-monitor-updated","admin_state_up":true,"delay":5,"expected_codes":"200","http_method":"HEAD","timeout":2,"url_path":"/index.html","max_retries":2,"max_retries_down":2}}' http://198.51.100.10:9876/v2/lbaas/healthmonitors/8ed3c5ac-6efa-420c-bedb-99ba14e58db5

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/l7policies?project_id=e3cd678b11784734bc366148aa37580e curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/l7policies?project_id=e3cd678b11784734bc366148aa37580e

View File

@ -1 +1 @@
curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"l7policy":{"description":"Redirect requests to example.com","admin_state_up":true,"listener_id":"023f2e34-7806-443b-bfae-16c324569a3d","redirect_url":"http://www.example.com","name":"redirect-example.com","action":"REDIRECT_TO_URL","position":1}}' http://198.51.100.10:9876/v2.0/lbaas/l7policies curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"l7policy":{"description":"Redirect requests to example.com","admin_state_up":true,"listener_id":"023f2e34-7806-443b-bfae-16c324569a3d","redirect_url":"http://www.example.com","name":"redirect-example.com","action":"REDIRECT_TO_URL","position":1}}' http://198.51.100.10:9876/v2/lbaas/l7policies

View File

@ -1 +1 @@
curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd

View File

@ -1 +1 @@
curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"l7policy":{"description":"Redirect requests to images.example.com","admin_state_up":true,"redirect_url":"http://images.example.com","name":"redirect-images.example.com","action":"REDIRECT_TO_URL","position":1}}' http://198.51.100.10:9876/v2.0/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"l7policy":{"description":"Redirect requests to images.example.com","admin_state_up":true,"redirect_url":"http://images.example.com","name":"redirect-images.example.com","action":"REDIRECT_TO_URL","position":1}}' http://198.51.100.10:9876/v2/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd

View File

@ -1 +1 @@
curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"rule":{"compare_type":"REGEX","invert":false,"type":"PATH","value":"/images*","admin_state_up":true}}' http://198.51.100.10:9876/v2.0/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd/rules curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"rule":{"compare_type":"REGEX","invert":false,"type":"PATH","value":"/images*","admin_state_up":true}}' http://198.51.100.10:9876/v2/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd/rules

View File

@ -1 +1 @@
curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd/rules/16621dbb-a736-4888-a57a-3ecd53df784c curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd/rules/16621dbb-a736-4888-a57a-3ecd53df784c

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd/rules/16621dbb-a736-4888-a57a-3ecd53df784c curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd/rules/16621dbb-a736-4888-a57a-3ecd53df784c

View File

@ -1 +1 @@
curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"rule":{"compare_type":"REGEX","invert":true,"type":"PATH","value":"/images/special*","admin_state_up":true}}' http://198.51.100.10:9876/v2.0/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd/rules/16621dbb-a736-4888-a57a-3ecd53df784c curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"rule":{"compare_type":"REGEX","invert":true,"type":"PATH","value":"/images/special*","admin_state_up":true}}' http://198.51.100.10:9876/v2/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd/rules/16621dbb-a736-4888-a57a-3ecd53df784c

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd/rules curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/l7policies/8a1412f0-4c32-4257-8b07-af4770b604fd/rules

View File

@ -1 +1 @@
curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"listener": {"protocol": "TERMINATED_HTTPS", "description": "A great TLS listener", "admin_state_up": true, "connection_limit": 200, "protocol_port": "443", "loadbalancer_id": "607226db-27ef-4d41-ae89-f2a800e9c2db", "name": "great_tls_listener", "insert_headers": {"X-Forwarded-For": "true", "X-Forwarded-Port": "true"}, "default_tls_container_ref": "http://198.51.100.10:9311/v1/containers/a570068c-d295-4780-91d4-3046a325db51", "sni_container_refs": ["http://198.51.100.10:9311/v1/containers/a570068c-d295-4780-91d4-3046a325db51", "http://198.51.100.10:9311/v1/containers/aaebb31e-7761-4826-8cb4-2b829caca3ee"], "timeout_client_data": 50000, "timeout_member_connect": 5000, "timeout_member_data": 50000, "timeout_tcp_inspect": 0}}' http://198.51.100.10:9876/v2.0/lbaas/listeners curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"listener": {"protocol": "TERMINATED_HTTPS", "description": "A great TLS listener", "admin_state_up": true, "connection_limit": 200, "protocol_port": "443", "loadbalancer_id": "607226db-27ef-4d41-ae89-f2a800e9c2db", "name": "great_tls_listener", "insert_headers": {"X-Forwarded-For": "true", "X-Forwarded-Port": "true"}, "default_tls_container_ref": "http://198.51.100.10:9311/v1/containers/a570068c-d295-4780-91d4-3046a325db51", "sni_container_refs": ["http://198.51.100.10:9311/v1/containers/a570068c-d295-4780-91d4-3046a325db51", "http://198.51.100.10:9311/v1/containers/aaebb31e-7761-4826-8cb4-2b829caca3ee"], "timeout_client_data": 50000, "timeout_member_connect": 5000, "timeout_member_data": 50000, "timeout_tcp_inspect": 0}}' http://198.51.100.10:9876/v2/lbaas/listeners

View File

@ -1 +1 @@
curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/listeners/023f2e34-7806-443b-bfae-16c324569a3d curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/listeners/023f2e34-7806-443b-bfae-16c324569a3d

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/listeners/023f2e34-7806-443b-bfae-16c324569a3d curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/listeners/023f2e34-7806-443b-bfae-16c324569a3d

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/listeners/023f2e34-7806-443b-bfae-16c324569a3d/stats curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/listeners/023f2e34-7806-443b-bfae-16c324569a3d/stats

View File

@ -1 +1 @@
curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"listener": {"description": "An updated great TLS listener", "admin_state_up": true, "connection_limit": 200, "name": "great_updated_tls_listener", "insert_headers": {"X-Forwarded-For": "false", "X-Forwarded-Port": "true"}, "default_tls_container_ref": "http://198.51.100.10:9311/v1/containers/a570068c-d295-4780-91d4-3046a325db51", "sni_container_refs": ["http://198.51.100.10:9311/v1/containers/a570068c-d295-4780-91d4-3046a325db51", "http://198.51.100.10:9311/v1/containers/aaebb31e-7761-4826-8cb4-2b829caca3ee"], "timeout_client_data": 100000, "timeout_member_connect": 1000, "timeout_member_data": 100000, "timeout_tcp_inspect": 5}}' http://198.51.100.10:9876/v2.0/lbaas/listeners/023f2e34-7806-443b-bfae-16c324569a3d curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"listener": {"description": "An updated great TLS listener", "admin_state_up": true, "connection_limit": 200, "name": "great_updated_tls_listener", "insert_headers": {"X-Forwarded-For": "false", "X-Forwarded-Port": "true"}, "default_tls_container_ref": "http://198.51.100.10:9311/v1/containers/a570068c-d295-4780-91d4-3046a325db51", "sni_container_refs": ["http://198.51.100.10:9311/v1/containers/a570068c-d295-4780-91d4-3046a325db51", "http://198.51.100.10:9311/v1/containers/aaebb31e-7761-4826-8cb4-2b829caca3ee"], "timeout_client_data": 100000, "timeout_member_connect": 1000, "timeout_member_data": 100000, "timeout_tcp_inspect": 5}}' http://198.51.100.10:9876/v2/lbaas/listeners/023f2e34-7806-443b-bfae-16c324569a3d

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/listeners?project_id=e3cd678b11784734bc366148aa37580e curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/listeners?project_id=e3cd678b11784734bc366148aa37580e

View File

@ -1 +1 @@
curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"loadbalancer": {"description": "My favorite load balancer", "admin_state_up": true, "project_id": "e3cd678b11784734bc366148aa37580e", "flavor_id": "a7ae5d5a-d855-4f9a-b187-af66b53f4d04", "vip_subnet_id": "d4af86e1-0051-488c-b7a0-527f97490c9a", "vip_address": "203.0.113.50", "provider": "octavia", "name": "best_load_balancer", "vip_qos_policy_id": "ec4f78ca-8da8-4e99-8a1a-e3b94595a7a3"}}' http://198.51.100.10:9876/v2.0/lbaas/loadbalancers curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"loadbalancer": {"description": "My favorite load balancer", "admin_state_up": true, "project_id": "e3cd678b11784734bc366148aa37580e", "flavor_id": "a7ae5d5a-d855-4f9a-b187-af66b53f4d04", "vip_subnet_id": "d4af86e1-0051-488c-b7a0-527f97490c9a", "vip_address": "203.0.113.50", "provider": "octavia", "name": "best_load_balancer", "vip_qos_policy_id": "ec4f78ca-8da8-4e99-8a1a-e3b94595a7a3"}}' http://198.51.100.10:9876/v2/lbaas/loadbalancers

View File

@ -1 +1 @@
curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/loadbalancers/4b9b652c-537a-44bf-bbe8-85a690625597 curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/loadbalancers/4b9b652c-537a-44bf-bbe8-85a690625597

View File

@ -1 +1 @@
curl -X PUT -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/loadbalancers/4a13c573-623c-4d23-8a9c-581dc17ceb1f/failover curl -X PUT -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/loadbalancers/4a13c573-623c-4d23-8a9c-581dc17ceb1f/failover

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/loadbalancers/8a562351-f0fb-424c-a0af-513461424ea5 curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/loadbalancers/8a562351-f0fb-424c-a0af-513461424ea5

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/loadbalancers/4a13c573-623c-4d23-8a9c-581dc17ceb1f/stats curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/loadbalancers/4a13c573-623c-4d23-8a9c-581dc17ceb1f/stats

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/loadbalancers/bda6f032-80d3-414a-b395-e79c374e3929/status curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/loadbalancers/bda6f032-80d3-414a-b395-e79c374e3929/status

View File

@ -1 +1 @@
curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"loadbalancer": {"description": "Temporarily disabled load balancer", "admin_state_up": false, "name": "disabled_load_balancer", "vip_qos_policy_id": "ec4f78ca-8da8-4e99-8a1a-e3b94595a7a3"}}' http://198.51.100.10:9876/v2.0/lbaas/loadbalancers/8b6fc468-07d5-4d8b-a0b9-695060e72c31 curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"loadbalancer": {"description": "Temporarily disabled load balancer", "admin_state_up": false, "name": "disabled_load_balancer", "vip_qos_policy_id": "ec4f78ca-8da8-4e99-8a1a-e3b94595a7a3"}}' http://198.51.100.10:9876/v2/lbaas/loadbalancers/8b6fc468-07d5-4d8b-a0b9-695060e72c31

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/loadbalancers?project_id=e3cd678b11784734bc366148aa37580e curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/loadbalancers?project_id=e3cd678b11784734bc366148aa37580e

View File

@ -1 +1 @@
curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"members":[{"name":"web-server-1","weight":"20","admin_state_up":true,"subnet_id":"bbb35f84-35cc-4b2f-84c2-a6a29bba68aa","address":"192.0.2.16","protocol_port":"80","monitor_port":8080},{"name":"web-server-2","weight":"10","admin_state_up":true,"subnet_id":"bbb35f84-35cc-4b2f-84c2-a6a29bba68aa","address":"192.0.2.17","protocol_port":"80","monitor_port":8080}]}' http://198.51.100.10:9876/v2.0/lbaas/pools/4029d267-3983-4224-a3d0-afb3fe16a2cd/members curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"members":[{"name":"web-server-1","weight":"20","admin_state_up":true,"subnet_id":"bbb35f84-35cc-4b2f-84c2-a6a29bba68aa","address":"192.0.2.16","protocol_port":"80","monitor_port":8080},{"name":"web-server-2","weight":"10","admin_state_up":true,"subnet_id":"bbb35f84-35cc-4b2f-84c2-a6a29bba68aa","address":"192.0.2.17","protocol_port":"80","monitor_port":8080}]}' http://198.51.100.10:9876/v2/lbaas/pools/4029d267-3983-4224-a3d0-afb3fe16a2cd/members

View File

@ -1 +1 @@
curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"member":{"name":"web-server-1","weight":"20","admin_state_up":true,"subnet_id":"bbb35f84-35cc-4b2f-84c2-a6a29bba68aa","address":"192.0.2.16","protocol_port":"80","monitor_port":8080,"backup":false}}' http://198.51.100.10:9876/v2.0/lbaas/pools/4029d267-3983-4224-a3d0-afb3fe16a2cd/members curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"member":{"name":"web-server-1","weight":"20","admin_state_up":true,"subnet_id":"bbb35f84-35cc-4b2f-84c2-a6a29bba68aa","address":"192.0.2.16","protocol_port":"80","monitor_port":8080,"backup":false}}' http://198.51.100.10:9876/v2/lbaas/pools/4029d267-3983-4224-a3d0-afb3fe16a2cd/members

View File

@ -1 +1 @@
curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/pools/4029d267-3983-4224-a3d0-afb3fe16a2cd/members/957a1ace-1bd2-449b-8455-820b6e4b63f3 curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/pools/4029d267-3983-4224-a3d0-afb3fe16a2cd/members/957a1ace-1bd2-449b-8455-820b6e4b63f3

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/pools/24a43e68-36de-45f6-89cf-c03df583131d/members/957a1ace-1bd2-449b-8455-820b6e4b63f3 curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/pools/24a43e68-36de-45f6-89cf-c03df583131d/members/957a1ace-1bd2-449b-8455-820b6e4b63f3

View File

@ -1 +1 @@
curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"member":{"name":"web-server-1-2","weight":"0","admin_state_up":"true","monitor_address":"192.0.2.40","monitor_port":8888,"backup":false}}' http://198.51.100.10:9876/v2.0/lbaas/pools/4029d267-3983-4224-a3d0-afb3fe16a2cd/members/957a1ace-1bd2-449b-8455-820b6e4b63f3 curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"member":{"name":"web-server-1-2","weight":"0","admin_state_up":"true","monitor_address":"192.0.2.40","monitor_port":8888,"backup":false}}' http://198.51.100.10:9876/v2/lbaas/pools/4029d267-3983-4224-a3d0-afb3fe16a2cd/members/957a1ace-1bd2-449b-8455-820b6e4b63f3

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/pools/24a43e68-36de-45f6-89cf-c03df583131d/members?project_id=e3cd678b11784734bc366148aa37580e curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/pools/24a43e68-36de-45f6-89cf-c03df583131d/members?project_id=e3cd678b11784734bc366148aa37580e

View File

@ -1 +1 @@
curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"pool":{"lb_algorithm":"ROUND_ROBIN","protocol":"HTTP","description":"Super Round Robin Pool","admin_state_up":true,"session_persistence":{"cookie_name":"ChocolateChip","type":"APP_COOKIE"},"listener_id":"023f2e34-7806-443b-bfae-16c324569a3d","name":"super-pool"}}' http://198.51.100.10:9876/v2.0/lbaas/pools curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"pool":{"lb_algorithm":"ROUND_ROBIN","protocol":"HTTP","description":"Super Round Robin Pool","admin_state_up":true,"session_persistence":{"cookie_name":"ChocolateChip","type":"APP_COOKIE"},"listener_id":"023f2e34-7806-443b-bfae-16c324569a3d","name":"super-pool"}}' http://198.51.100.10:9876/v2/lbaas/pools

View File

@ -1 +1 @@
curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/pools/4029d267-3983-4224-a3d0-afb3fe16a2cd curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/pools/4029d267-3983-4224-a3d0-afb3fe16a2cd

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/pools/24a43e68-36de-45f6-89cf-c03df583131d curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/pools/24a43e68-36de-45f6-89cf-c03df583131d

View File

@ -1 +1 @@
curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"pool":{"lb_algorithm":"LEAST_CONNECTIONS","session_persistence":{"type":"SOURCE_IP"},"description":"second description","name":"second_name"}}' http://198.51.100.10:9876/v2.0/lbaas/pools/4029d267-3983-4224-a3d0-afb3fe16a2cd curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"pool":{"lb_algorithm":"LEAST_CONNECTIONS","session_persistence":{"type":"SOURCE_IP"},"description":"second description","name":"second_name"}}' http://198.51.100.10:9876/v2/lbaas/pools/4029d267-3983-4224-a3d0-afb3fe16a2cd

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/pools?project_id=e3cd678b11784734bc366148aa37580e curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/pools?project_id=e3cd678b11784734bc366148aa37580e

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/providers curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/providers

View File

@ -1 +1 @@
curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/quotas/e3cd678b11784734bc366148aa37580e curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/quotas/e3cd678b11784734bc366148aa37580e

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/quotas/e3cd678b11784734bc366148aa37580e curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/quotas/e3cd678b11784734bc366148aa37580e

View File

@ -1 +1 @@
curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"quota":{"load_balancer":10,"listener":-1,"member":50,"pool":-1,"health_monitor":-1}}' http://198.51.100.10:9876/v2.0/lbaas/quotas/e3cd678b11784734bc366148aa37580e curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"quota":{"load_balancer":10,"listener":-1,"member":50,"pool":-1,"health_monitor":-1}}' http://198.51.100.10:9876/v2/lbaas/quotas/e3cd678b11784734bc366148aa37580e

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/quotas/defaults curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/quotas/defaults

View File

@ -1 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/quotas?project_id=e3cd678b11784734bc366148aa37580e curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2/lbaas/quotas?project_id=e3cd678b11784734bc366148aa37580e

View File

@ -1,8 +1,14 @@
.. -*- rst -*- .. -*- rst -*-
This section introduces readers to OpenStack Octavia v2.0 ReSTful HTTP API and This section introduces readers to OpenStack Octavia v2 ReSTful HTTP API and
provides guidelines on how to use it. provides guidelines on how to use it.
.. note::
To clarify the Octavia API versioning we have updated the endpoint to
support both the previously documented /v2.0 and the new path of /v2.
They are exactly the same API and /v2.0 will be a supported alias for the
life of the v2 API.
Service Endpoints Service Endpoints
================= =================
@ -40,8 +46,8 @@ returned with the identity token.
For instance, if the ``endpoint URL`` is ``http://198.51.100.10:9876/`` then For instance, if the ``endpoint URL`` is ``http://198.51.100.10:9876/`` then
the full API call for ``/v2.0/lbaas/loadbalancers`` is the full API call for ``/v2/lbaas/loadbalancers`` is
``http://198.51.100.10:9876/v2.0/lbaas/loadbalancers``. ``http://198.51.100.10:9876/v2/lbaas/loadbalancers``.
Depending on the deployment, the ``load-balancer`` ``endpoint URL`` might be Depending on the deployment, the ``load-balancer`` ``endpoint URL`` might be
http or https, a custom port, a custom path, and include your project id. The http or https, a custom port, a custom path, and include your project id. The
@ -51,8 +57,8 @@ applications, even if they are only expected to work at a single site. It
should always be discovered from the Identity token. should always be discovered from the Identity token.
As such, for the rest of this document we will be using short hand where ``GET As such, for the rest of this document we will be using short hand where ``GET
/v2.0/lbaas/loadbalancers`` really means ``GET /v2/lbaas/loadbalancers`` really means ``GET
{your_load-balancer_endpoint_URL}/v2.0/lbaas/loadbalancers``. {your_load-balancer_endpoint_URL}/v2/lbaas/loadbalancers``.
Neutron-lbaas and Octavia v2 APIs Neutron-lbaas and Octavia v2 APIs
================================= =================================
@ -78,7 +84,7 @@ applications to access load balancing via the Octavia v2 API.
Authentication and authorization Authentication and authorization
================================ ================================
The Octavia API v2.0 uses the `OpenStack Identity service The Octavia API v2 uses the `OpenStack Identity service
<https://docs.openstack.org/keystone/latest/>`_ as the default authentication <https://docs.openstack.org/keystone/latest/>`_ as the default authentication
service. When Keystone is enabled, users that submit requests to the Octavia service. When Keystone is enabled, users that submit requests to the Octavia
service must provide an authentication token in **X-Auth-Token** request service must provide an authentication token in **X-Auth-Token** request
@ -106,19 +112,19 @@ deployment to deployment.
Request and response formats Request and response formats
============================ ============================
The Octavia API v2.0 supports JSON data serialization request and response The Octavia API v2 supports JSON data serialization request and response
formats only. formats only.
Request format Request format
-------------- --------------
The Octavia API v2.0 only accepts requests with the JSON data serialization The Octavia API v2 only accepts requests with the JSON data serialization
format. The ``Content-Type`` header is ignored. format. The ``Content-Type`` header is ignored.
Response format Response format
--------------- ---------------
The Octavia API v2.0 always responds with the JSON data serialization The Octavia API v2 always responds with the JSON data serialization
format. The ``Accept`` header is ignored. format. The ``Accept`` header is ignored.
Query extension Query extension
@ -134,16 +140,16 @@ Query extension
Filtering and column selection Filtering and column selection
============================== ==============================
The Octavia API v2.0 supports filtering based on all top level attributes of The Octavia API v2 supports filtering based on all top level attributes of
a resource. Filters are applicable to all list requests. a resource. Filters are applicable to all list requests.
For example, the following request returns all loadbalancers named ``foobar``: For example, the following request returns all loadbalancers named ``foobar``:
.. code:: .. code::
GET /v2.0/lbaas/loadbalancers?name=foobar GET /v2/lbaas/loadbalancers?name=foobar
When you specify multiple filters, the Octavia API v2.0 returns only objects When you specify multiple filters, the Octavia API v2 returns only objects
that meet all filtering criteria. The operation applies an AND condition among that meet all filtering criteria. The operation applies an AND condition among
the filters. the filters.
@ -156,23 +162,23 @@ Alternatively, you can issue a distinct request for each filter and build a
response set from the received responses on the client-side. response set from the received responses on the client-side.
By default, Octavia returns all attributes for any show or list call. The By default, Octavia returns all attributes for any show or list call. The
Octavia API v2.0 has a mechanism to limit the set of attributes returned. Octavia API v2 has a mechanism to limit the set of attributes returned.
For example, return ``id``. For example, return ``id``.
You can use the ``fields`` query parameter to control the attributes returned You can use the ``fields`` query parameter to control the attributes returned
from the Octavia API v2.0. from the Octavia API v2.
For example, the following request returns only ``id`` and ``name`` for each For example, the following request returns only ``id`` and ``name`` for each
load balancer: load balancer:
.. code:: .. code::
GET /v2.0/lbaas/loadbalancers.json?fields=id&fields=name GET /v2/lbaas/loadbalancers.json?fields=id&fields=name
Synchronous versus asynchronous plug-in behavior Synchronous versus asynchronous plug-in behavior
================================================ ================================================
The Octavia API v2.0 presents a logical model of load balancers consisting The Octavia API v2 presents a logical model of load balancers consisting
of listeners, pools, and members. It is up to the OpenStack Octavia plug-in of listeners, pools, and members. It is up to the OpenStack Octavia plug-in
to communicate with the underlying infrastructure to ensure load balancing to communicate with the underlying infrastructure to ensure load balancing
is consistent with the logical model. A plug-in might perform these is consistent with the logical model. A plug-in might perform these
@ -194,10 +200,10 @@ Octavia plug-in has successfully completed the configuration of the resource.
Bulk-create Bulk-create
=========== ===========
The Octavia v2.0 API does not support bulk create. You cannot create more than The Octavia v2 API does not support bulk create. You cannot create more than
one load balancer per API call. one load balancer per API call.
The Octavia v2.0 API does support single call create which allows you to The Octavia v2 API does support single call create which allows you to
create a fully populated load balancer in one API call. This is discussed create a fully populated load balancer in one API call. This is discussed
in the load balancer create section of this reference. in the load balancer create section of this reference.
@ -226,17 +232,17 @@ with three items. The first page was retrieved through:
.. code:: .. code::
GET http://198.51.100.10:9876/v2.0/lbaas/loadbalancers.json?limit=2 GET http://198.51.100.10:9876/v2/lbaas/loadbalancers.json?limit=2
If a particular plug-in does not support pagination operations the Octavia API If a particular plug-in does not support pagination operations the Octavia API
v2.0 will emulate the pagination behavior so that users can expect the same v2 will emulate the pagination behavior so that users can expect the same
behavior regardless of the particular plug-in running in the background. behavior regardless of the particular plug-in running in the background.
**Example load balancer list, first page: JSON request** **Example load balancer list, first page: JSON request**
.. code:: .. code::
GET /v2.0/lbaas/loadbalancers.json?limit=2 HTTP/1.1 GET /v2/lbaas/loadbalancers.json?limit=2 HTTP/1.1
Host: 198.51.100.10:9876 Host: 198.51.100.10:9876
Content-Type: application/json Content-Type: application/json
Accept: application/json Accept: application/json
@ -281,11 +287,11 @@ behavior regardless of the particular plug-in running in the background.
], ],
"loadbalancers_links": [ "loadbalancers_links": [
{ {
"href": "http://198.51.100.10:9876/v2.0/lbaas/loadbalancers.json?limit=2&marker=0fdb0ca7-0a38-4aea-891c-daaed40bcafe", "href": "http://198.51.100.10:9876/v2/lbaas/loadbalancers.json?limit=2&marker=0fdb0ca7-0a38-4aea-891c-daaed40bcafe",
"rel": "next" "rel": "next"
}, },
{ {
"href": "http://198.51.100.10:9876/v2.0/lbaas/loadbalancers.json?limit=2&marker=34d5f4a5-cbbc-43a0-878f-b8a26370e6e7&page_reverse=True", "href": "http://198.51.100.10:9876/v2/lbaas/loadbalancers.json?limit=2&marker=34d5f4a5-cbbc-43a0-878f-b8a26370e6e7&page_reverse=True",
"rel": "previous" "rel": "previous"
} }
] ]
@ -298,7 +304,7 @@ The last page won't show the "next" links
.. code:: .. code::
GET /v2.0/lbaas/loadbalancers.json?limit=2&marker=4ef465f3-0233-44af-b93d-9d3eae4daf85 HTTP/1.1 GET /v2/lbaas/loadbalancers.json?limit=2&marker=4ef465f3-0233-44af-b93d-9d3eae4daf85 HTTP/1.1
Host: 198.51.100.10:9876 Host: 198.51.100.10:9876
Content-Type: application/json Content-Type: application/json
Accept: application/json Accept: application/json
@ -329,7 +335,7 @@ The last page won't show the "next" links
], ],
"loadbalancers_links": [ "loadbalancers_links": [
{ {
"href": "http://198.51.100.10:9876/v2.0/lbaas/loadbalancers.json?limit=2&marker=4ef465f3-0233-44af-b93d-9d3eae4daf85&page_reverse=True", "href": "http://198.51.100.10:9876/v2/lbaas/loadbalancers.json?limit=2&marker=4ef465f3-0233-44af-b93d-9d3eae4daf85&page_reverse=True",
"rel": "previous" "rel": "previous"
} }
] ]
@ -380,14 +386,14 @@ and the number of ``sort_key`` and ``sort_dir`` provided must be same. The
values are ``asc`` (ascending) and ``desc`` (descending). values are ``asc`` (ascending) and ``desc`` (descending).
If a particular plug-in does not support sorting operations the Octavia API If a particular plug-in does not support sorting operations the Octavia API
v2.0 emulates the sorting behavior so that users can expect the same behavior v2 emulates the sorting behavior so that users can expect the same behavior
regardless of the particular plug-in that runs in the background. regardless of the particular plug-in that runs in the background.
Response Codes Response Codes
============== ==============
The following HTTP response status codes are used by the Octavia v2.0 API. The following HTTP response status codes are used by the Octavia v2 API.
Success Success
------- -------
@ -406,7 +412,7 @@ Success
Faults Faults
------ ------
The Octavia API v2.0 returns an error response if a failure occurs while The Octavia API v2 returns an error response if a failure occurs while
processing a request. Octavia uses only standard HTTP error codes. processing a request. Octavia uses only standard HTTP error codes.
4\ *nn* errors indicate problems in the particular request being sent from 4\ *nn* errors indicate problems in the particular request being sent from
the client. the client.
@ -445,7 +451,7 @@ the client.
Status Codes Status Codes
============ ============
Octavia API v2.0 entities have two status codes present in the response body. Octavia API v2 entities have two status codes present in the response body.
The ``provisioning_status`` describes the lifecycle status of the entity while The ``provisioning_status`` describes the lifecycle status of the entity while
the ``operating_status`` provides the observed status of the entity. the ``operating_status`` provides the observed status of the entity.

View File

@ -3,7 +3,7 @@
List Health Monitors List Health Monitors
==================== ====================
.. rest_method:: GET /v2.0/lbaas/healthmonitors .. rest_method:: GET /v2/lbaas/healthmonitors
Lists all health monitors for the project. Lists all health monitors for the project.
@ -72,7 +72,7 @@ Response Example
Create Health Monitor Create Health Monitor
===================== =====================
.. rest_method:: POST /v2.0/lbaas/healthmonitors .. rest_method:: POST /v2/lbaas/healthmonitors
Creates a health monitor on a pool. Creates a health monitor on a pool.
@ -88,7 +88,7 @@ In the response, the health monitor :ref:`provisioning status<prov_status>` is
``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``. ``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``.
If the status is ``PENDING_CREATE``, issue GET If the status is ``PENDING_CREATE``, issue GET
``/v2.0/lbaas/healthmonitors/{healthmonitor_id}`` to view the progress of ``/v2/lbaas/healthmonitors/{healthmonitor_id}`` to view the progress of
the provisioning operation. When the health monitor status changes the provisioning operation. When the health monitor status changes
to ``ACTIVE``, the health monitor is successfully provisioned and to ``ACTIVE``, the health monitor is successfully provisioned and
is ready for further configuration. is ready for further configuration.
@ -209,7 +209,7 @@ Response Example
Show Health Monitor details Show Health Monitor details
=========================== ===========================
.. rest_method:: GET /v2.0/lbaas/healthmonitors/{healthmonitor_id} .. rest_method:: GET /v2/lbaas/healthmonitors/{healthmonitor_id}
Shows the details of a health monitor. Shows the details of a health monitor.
@ -276,7 +276,7 @@ Response Example
Update a Health Monitor Update a Health Monitor
======================= =======================
.. rest_method:: PUT /v2.0/lbaas/healthmonitors/{healthmonitor_id} .. rest_method:: PUT /v2/lbaas/healthmonitors/{healthmonitor_id}
Update an existing health monitor. Update an existing health monitor.
@ -361,7 +361,7 @@ Response Example
Remove a Health Monitor Remove a Health Monitor
======================= =======================
.. rest_method:: DELETE /v2.0/lbaas/healthmonitors/{healthmonitor_id} .. rest_method:: DELETE /v2/lbaas/healthmonitors/{healthmonitor_id}
Removes a health monitor and its associated configuration from the project. Removes a health monitor and its associated configuration from the project.

View File

@ -1,8 +1,8 @@
:tocdepth: 3 :tocdepth: 3
========================== ========================
Octavia API v2.0 (Current) Octavia API v2 (Current)
========================== ========================
.. rest_expand_all:: .. rest_expand_all::

View File

@ -3,7 +3,7 @@
List L7 Policies List L7 Policies
================ ================
.. rest_method:: GET /v2.0/lbaas/l7policies .. rest_method:: GET /v2/lbaas/l7policies
Lists all L7 policies for the project. Lists all L7 policies for the project.
@ -70,7 +70,7 @@ Response Example
Create an L7 Policy Create an L7 Policy
=================== ===================
.. rest_method:: POST /v2.0/lbaas/l7policies .. rest_method:: POST /v2/lbaas/l7policies
Creates a L7 policy. Creates a L7 policy.
@ -84,7 +84,7 @@ In the response, the L7 policy :ref:`provisioning status<prov_status>` is
``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``. ``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``.
If the status is ``PENDING_CREATE``, issue GET If the status is ``PENDING_CREATE``, issue GET
``/v2.0/lbaas/l7policies/{l7policy_id}`` to view the progress of ``/v2/lbaas/l7policies/{l7policy_id}`` to view the progress of
the provisioning operation. When the L7 policy status changes the provisioning operation. When the L7 policy status changes
to ``ACTIVE``, the L7 policy is successfully provisioned and to ``ACTIVE``, the L7 policy is successfully provisioned and
is ready for further configuration. is ready for further configuration.
@ -181,7 +181,7 @@ Response Example
Show L7 Policy details Show L7 Policy details
========================== ==========================
.. rest_method:: GET /v2.0/lbaas/l7policies/{l7policy_id} .. rest_method:: GET /v2/lbaas/l7policies/{l7policy_id}
Shows the details of a L7 policy. Shows the details of a L7 policy.
@ -247,7 +247,7 @@ Response Example
Update a L7 Policy Update a L7 Policy
================== ==================
.. rest_method:: PUT /v2.0/lbaas/l7policies/{l7policy_id} .. rest_method:: PUT /v2/lbaas/l7policies/{l7policy_id}
Updates a L7 policy. Updates a L7 policy.
@ -332,7 +332,7 @@ Response Example
Remove a L7 Policy Remove a L7 Policy
================== ==================
.. rest_method:: DELETE /v2.0/lbaas/l7policies/{l7policy_id} .. rest_method:: DELETE /v2/lbaas/l7policies/{l7policy_id}
Removes a L7 policy and its associated configuration from the project. Removes a L7 policy and its associated configuration from the project.

View File

@ -3,7 +3,7 @@
List L7 Rules List L7 Rules
============= =============
.. rest_method:: GET /v2.0/lbaas/l7policies/{l7policy_id}/rules .. rest_method:: GET /v2/lbaas/l7policies/{l7policy_id}/rules
Lists all L7 rules for the project. Lists all L7 rules for the project.
@ -68,7 +68,7 @@ Response Example
Create an L7 Rule Create an L7 Rule
================= =================
.. rest_method:: POST /v2.0/lbaas/l7policies/{l7policy_id}/rules .. rest_method:: POST /v2/lbaas/l7policies/{l7policy_id}/rules
Creates a L7 rule. Creates a L7 rule.
@ -82,7 +82,7 @@ In the response, the L7 rule :ref:`provisioning status<prov_status>` is
``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``. ``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``.
If the status is ``PENDING_CREATE``, issue GET If the status is ``PENDING_CREATE``, issue GET
``/v2.0/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id}`` to view the ``/v2/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id}`` to view the
progress of the provisioning operation. When the L7 rule status changes progress of the provisioning operation. When the L7 rule status changes
to ``ACTIVE``, the L7 rule is successfully provisioned and to ``ACTIVE``, the L7 rule is successfully provisioned and
is ready for further configuration. is ready for further configuration.
@ -166,7 +166,7 @@ Response Example
Show L7 Rule details Show L7 Rule details
========================== ==========================
.. rest_method:: GET /v2.0/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id} .. rest_method:: GET /v2/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id}
Shows the details of a L7 rule. Shows the details of a L7 rule.
@ -229,7 +229,7 @@ Response Example
Update a L7 Rule Update a L7 Rule
================ ================
.. rest_method:: PUT /v2.0/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id} .. rest_method:: PUT /v2/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id}
Updates a L7 rule. Updates a L7 rule.
@ -308,7 +308,7 @@ Response Example
Remove a L7 Rule Remove a L7 Rule
================ ================
.. rest_method:: DELETE /v2.0/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id} .. rest_method:: DELETE /v2/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id}
Removes a L7 rule and its associated configuration from the project. Removes a L7 rule and its associated configuration from the project.

View File

@ -3,7 +3,7 @@
List Listeners List Listeners
============== ==============
.. rest_method:: GET /v2.0/lbaas/listeners .. rest_method:: GET /v2/lbaas/listeners
Lists all listeners for the project. Lists all listeners for the project.
@ -78,7 +78,7 @@ Response Example
Create Listener Create Listener
=============== ===============
.. rest_method:: POST /v2.0/lbaas/listeners .. rest_method:: POST /v2/lbaas/listeners
Creates a listener for a load balancer. Creates a listener for a load balancer.
@ -95,7 +95,7 @@ In the response, the listener :ref:`provisioning status<prov_status>` is
``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``. ``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``.
If the status is ``PENDING_CREATE``, issue GET If the status is ``PENDING_CREATE``, issue GET
``/v2.0/lbaas/listeners/{listener_id}`` to view the progress of ``/v2/lbaas/listeners/{listener_id}`` to view the progress of
the provisioning operation. When the listener status changes the provisioning operation. When the listener status changes
to ``ACTIVE``, the listener is successfully provisioned and to ``ACTIVE``, the listener is successfully provisioned and
is ready for further configuration. is ready for further configuration.
@ -227,7 +227,7 @@ Response Example
Show Listener details Show Listener details
===================== =====================
.. rest_method:: GET /v2.0/lbaas/listeners/{listener_id} .. rest_method:: GET /v2/lbaas/listeners/{listener_id}
Shows the details of a listener. Shows the details of a listener.
@ -300,7 +300,7 @@ Response Example
Update a Listener Update a Listener
================= =================
.. rest_method:: PUT /v2.0/lbaas/listeners/{listener_id} .. rest_method:: PUT /v2/lbaas/listeners/{listener_id}
Update an existing listener. Update an existing listener.
@ -394,7 +394,7 @@ Response Example
Remove a Listener Remove a Listener
================= =================
.. rest_method:: DELETE /v2.0/lbaas/listeners/{listener_id} .. rest_method:: DELETE /v2/lbaas/listeners/{listener_id}
Removes a listener and its associated configuration from the project. Removes a listener and its associated configuration from the project.
@ -435,7 +435,7 @@ There is no body content for the response of a successful DELETE request.
Get Listener statistics Get Listener statistics
======================= =======================
.. rest_method:: GET /v2.0/lbaas/listeners/{listener_id}/stats .. rest_method:: GET /v2/lbaas/listeners/{listener_id}/stats
Shows the current statistics for a listener. Shows the current statistics for a listener.

View File

@ -3,7 +3,7 @@
List Load Balancers List Load Balancers
=================== ===================
.. rest_method:: GET /v2.0/lbaas/loadbalancers .. rest_method:: GET /v2/lbaas/loadbalancers
Lists all load balancers for the project. Lists all load balancers for the project.
@ -74,7 +74,7 @@ Response Example
Create a Load Balancer Create a Load Balancer
====================== ======================
.. rest_method:: POST /v2.0/lbaas/loadbalancers .. rest_method:: POST /v2/lbaas/loadbalancers
Creates a load balancer. Creates a load balancer.
@ -88,7 +88,7 @@ In the response, the load balancer :ref:`provisioning status<prov_status>` is
``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``. ``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``.
If the status is ``PENDING_CREATE``, issue GET If the status is ``PENDING_CREATE``, issue GET
``/v2.0/lbaas/loadbalancers/{loadbalancer_id}`` to view the progress of ``/v2/lbaas/loadbalancers/{loadbalancer_id}`` to view the progress of
the provisioning operation. When the load balancer status changes the provisioning operation. When the load balancer status changes
to ``ACTIVE``, the load balancer is successfully provisioned and to ``ACTIVE``, the load balancer is successfully provisioned and
is ready for further configuration. is ready for further configuration.
@ -243,7 +243,7 @@ Response Example
Show Load Balancer details Show Load Balancer details
========================== ==========================
.. rest_method:: GET /v2.0/lbaas/loadbalancers/{loadbalancer_id} .. rest_method:: GET /v2/lbaas/loadbalancers/{loadbalancer_id}
Shows the details of a load balancer. Shows the details of a load balancer.
@ -312,7 +312,7 @@ Response Example
Update a Load Balancer Update a Load Balancer
====================== ======================
.. rest_method:: PUT /v2.0/lbaas/loadbalancers/{loadbalancer_id} .. rest_method:: PUT /v2/lbaas/loadbalancers/{loadbalancer_id}
Updates a load balancer. Updates a load balancer.
@ -396,7 +396,7 @@ Response Example
Remove a Load Balancer Remove a Load Balancer
====================== ======================
.. rest_method:: DELETE /v2.0/lbaas/loadbalancers/{loadbalancer_id} .. rest_method:: DELETE /v2/lbaas/loadbalancers/{loadbalancer_id}
Removes a load balancer and its associated configuration from the project. Removes a load balancer and its associated configuration from the project.
@ -441,7 +441,7 @@ There is no body content for the response of a successful DELETE request.
Get Load Balancer statistics Get Load Balancer statistics
============================ ============================
.. rest_method:: GET /v2.0/lbaas/loadbalancers/{loadbalancer_id}/stats .. rest_method:: GET /v2/lbaas/loadbalancers/{loadbalancer_id}/stats
Shows the current statistics for a load balancer. Shows the current statistics for a load balancer.
@ -499,7 +499,7 @@ Response Example
Get the Load Balancer status tree Get the Load Balancer status tree
================================= =================================
.. rest_method:: GET /v2.0/lbaas/loadbalancers/{loadbalancer_id}/status .. rest_method:: GET /v2/lbaas/loadbalancers/{loadbalancer_id}/status
Shows the status tree for a load balancer. Shows the status tree for a load balancer.
@ -574,7 +574,7 @@ Response Example
Failover a load balancer Failover a load balancer
======================== ========================
.. rest_method:: PUT /v2.0/lbaas/loadbalancers/{loadbalancer_id}/failover .. rest_method:: PUT /v2/lbaas/loadbalancers/{loadbalancer_id}/failover
Performs a failover of a load balancer. Performs a failover of a load balancer.

View File

@ -3,7 +3,7 @@
List Members List Members
============ ============
.. rest_method:: GET /v2.0/lbaas/pools/{pool_id}/members .. rest_method:: GET /v2/lbaas/pools/{pool_id}/members
Lists all members for the project. Lists all members for the project.
@ -71,7 +71,7 @@ Response Example
Create Member Create Member
============= =============
.. rest_method:: POST /v2.0/lbaas/pools/{pool_id}/members .. rest_method:: POST /v2/lbaas/pools/{pool_id}/members
This operation provisions a member and adds it to a pool by using This operation provisions a member and adds it to a pool by using
the configuration that you define in the request object. After the the configuration that you define in the request object. After the
@ -82,7 +82,7 @@ In the response, the member :ref:`provisioning status<prov_status>` is
``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``. ``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``.
If the status is ``PENDING_CREATE``, issue GET If the status is ``PENDING_CREATE``, issue GET
``/v2.0/lbaas/pools/{pool_id}/members/{member_id}`` to view the progress of ``/v2/lbaas/pools/{pool_id}/members/{member_id}`` to view the progress of
the provisioning operation. When the member status changes the provisioning operation. When the member status changes
to ``ACTIVE``, the member is successfully provisioned and to ``ACTIVE``, the member is successfully provisioned and
is ready for further configuration. is ready for further configuration.
@ -200,7 +200,7 @@ Response Example
Show Member details Show Member details
=================== ===================
.. rest_method:: GET /v2.0/lbaas/pools/{pool_id}/members/{member-id} .. rest_method:: GET /v2/lbaas/pools/{pool_id}/members/{member-id}
Shows the details of a pool member. Shows the details of a pool member.
@ -266,7 +266,7 @@ Response Example
Update a Member Update a Member
=============== ===============
.. rest_method:: PUT /v2.0/lbaas/pools/{pool_id}/members/{member_id} .. rest_method:: PUT /v2/lbaas/pools/{pool_id}/members/{member_id}
Update an existing member. Update an existing member.
@ -351,7 +351,7 @@ Response Example
Batch Update Members Batch Update Members
==================== ====================
.. rest_method:: PUT /v2.0/lbaas/pools/{pool_id}/members .. rest_method:: PUT /v2/lbaas/pools/{pool_id}/members
Set the state of members for a pool in one API call. This may include Set the state of members for a pool in one API call. This may include
creating new members, deleting old members, and updating existing members. creating new members, deleting old members, and updating existing members.
@ -423,7 +423,7 @@ There is no body content for the response of a successful PUT request.
Remove a Member Remove a Member
=============== ===============
.. rest_method:: DELETE /v2.0/lbaas/pools/{pool_id}/members/{member_id} .. rest_method:: DELETE /v2/lbaas/pools/{pool_id}/members/{member_id}
Removes a member and its associated configuration from the pool. Removes a member and its associated configuration from the pool.

View File

@ -3,7 +3,7 @@
List Pools List Pools
========== ==========
.. rest_method:: GET /v2.0/lbaas/pools .. rest_method:: GET /v2/lbaas/pools
Lists all pools for the project. Lists all pools for the project.
@ -71,7 +71,7 @@ Response Example
Create Pool Create Pool
=========== ===========
.. rest_method:: POST /v2.0/lbaas/pools .. rest_method:: POST /v2/lbaas/pools
Creates a pool for a load balancer. Creates a pool for a load balancer.
@ -87,7 +87,7 @@ In the response, the pool :ref:`provisioning status<prov_status>` is
``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``. ``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``.
If the status is ``PENDING_CREATE``, issue GET If the status is ``PENDING_CREATE``, issue GET
``/v2.0/lbaas/pools/{pool_id}`` to view the progress of ``/v2/lbaas/pools/{pool_id}`` to view the progress of
the provisioning operation. When the pool status changes the provisioning operation. When the pool status changes
to ``ACTIVE``, the pool is successfully provisioned and to ``ACTIVE``, the pool is successfully provisioned and
is ready for further configuration. is ready for further configuration.
@ -252,7 +252,7 @@ Response Example
Show Pool details Show Pool details
================= =================
.. rest_method:: GET /v2.0/lbaas/pools/{pool_id} .. rest_method:: GET /v2/lbaas/pools/{pool_id}
Shows the details of a pool. Shows the details of a pool.
@ -318,7 +318,7 @@ Response Example
Update a Pool Update a Pool
============= =============
.. rest_method:: PUT /v2.0/lbaas/pools/{pool_id} .. rest_method:: PUT /v2/lbaas/pools/{pool_id}
Update an existing pool. Update an existing pool.
@ -398,7 +398,7 @@ Response Example
Remove a Pool Remove a Pool
============= =============
.. rest_method:: DELETE /v2.0/lbaas/pools/{pool_id} .. rest_method:: DELETE /v2/lbaas/pools/{pool_id}
Removes a pool and its associated configuration from the load balancer. Removes a pool and its associated configuration from the load balancer.

View File

@ -3,7 +3,7 @@
List Providers List Providers
============== ==============
.. rest_method:: GET /v2.0/lbaas/providers .. rest_method:: GET /v2/lbaas/providers
Lists all enabled provider drivers. Lists all enabled provider drivers.

View File

@ -3,7 +3,7 @@
List Quota List Quota
========== ==========
.. rest_method:: GET /v2.0/lbaas/quotas .. rest_method:: GET /v2/lbaas/quotas
Lists all quotas for the project. Lists all quotas for the project.
@ -66,7 +66,7 @@ Response Example
Show Quota Defaults Show Quota Defaults
=================== ===================
.. rest_method:: GET /v2.0/lbaas/quotas/defaults .. rest_method:: GET /v2/lbaas/quotas/defaults
Show the quota defaults configured for the deployment. Show the quota defaults configured for the deployment.
@ -113,7 +113,7 @@ Response Example
Show Project Quota Show Project Quota
================== ==================
.. rest_method:: GET /v2.0/lbaas/quotas/{project_id} .. rest_method:: GET /v2/lbaas/quotas/{project_id}
Show the quota for the project. Show the quota for the project.
@ -170,7 +170,7 @@ Response Example
Update a Quota Update a Quota
============== ==============
.. rest_method:: PUT /v2.0/lbaas/quotas/{project_id} .. rest_method:: PUT /v2/lbaas/quotas/{project_id}
Updates a quota for a project. Updates a quota for a project.
@ -244,7 +244,7 @@ Response Example
Reset a Quota Reset a Quota
============= =============
.. rest_method:: DELETE /v2.0/lbaas/quotas/{project_id} .. rest_method:: DELETE /v2/lbaas/quotas/{project_id}
Resets a project quota to use the deployment default quota. Resets a project quota to use the deployment default quota.

View File

@ -14,6 +14,7 @@
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from pecan import request as pecan_request
from pecan import rest from pecan import rest
from wsme import types as wtypes from wsme import types as wtypes
from wsmeext import pecan as wsme_pecan from wsmeext import pecan as wsme_pecan
@ -28,37 +29,50 @@ LOG = logging.getLogger(__name__)
class RootController(rest.RestController): class RootController(rest.RestController):
"""The controller with which the pecan wsgi app should be created.""" """The controller with which the pecan wsgi app should be created."""
_versions = None
def __init__(self): def __init__(self):
super(RootController, self).__init__() super(RootController, self).__init__()
self._versions = []
v1_enabled = CONF.api_settings.api_v1_enabled v1_enabled = CONF.api_settings.api_v1_enabled
v2_enabled = CONF.api_settings.api_v2_enabled v2_enabled = CONF.api_settings.api_v2_enabled
if v1_enabled: if v1_enabled:
self.v1 = v1_controller.V1Controller() self.v1 = v1_controller.V1Controller()
self._versions.append(
{
'status': 'SUPPORTED',
'updated': '2014-12-11T00:00:00Z',
'id': 'v1'
})
if v2_enabled: if v2_enabled:
setattr(self, 'v2.0', v2_controller.V2Controller()) setattr(self, 'v2.0', v2_controller.V2Controller())
self._versions.append( setattr(self, 'v2', v2_controller.V2Controller())
{
'status': 'CURRENT',
'updated': '2018-04-20T00:00:00Z',
'id': 'v2.1'
})
if not (v1_enabled or v2_enabled): if not (v1_enabled or v2_enabled):
LOG.warning("Both v1 and v2.0 API endpoints are disabled -- is " LOG.warning("Both v1 and v2 API endpoints are disabled -- is "
"this intentional?") "this intentional?")
elif v1_enabled and v2_enabled: elif v1_enabled and v2_enabled:
LOG.warning("Both v1 and v2.0 API endpoints are enabled -- it is " LOG.warning("Both v1 and v2 API endpoints are enabled -- it is "
"a security risk to expose the v1 endpoint publicly," "a security risk to expose the v1 endpoint publicly,"
"so please make sure access to it is secured.") "so please make sure access to it is secured.")
def _add_a_version(self, versions, version, url_version, status,
timestamp, base_url):
versions.append({
'id': version,
'status': status,
'updated': timestamp,
'links': [{
'href': base_url + url_version,
'rel': 'self'
}]
})
@wsme_pecan.wsexpose(wtypes.text) @wsme_pecan.wsexpose(wtypes.text)
def get(self): def get(self):
return {'versions': self._versions} host_url = pecan_request.path_url
if not host_url.endswith('/'):
host_url = '{}/'.format(host_url)
versions = []
if CONF.api_settings.api_v1_enabled:
self._add_a_version(versions, 'v1', 'v1', 'DEPRECATED',
'2014-12-11T00:00:00Z', host_url)
if CONF.api_settings.api_v2_enabled:
self._add_a_version(versions, 'v2.0', 'v2', 'SUPPORTED',
'2016-12-11T00:00:00Z', host_url)
self._add_a_version(versions, 'v2.1', 'v2', 'CURRENT',
'2018-04-20T00:00:00Z', host_url)
return {'versions': versions}

View File

@ -46,7 +46,7 @@ class BaseV2Controller(base.BaseController):
@wsme_pecan.wsexpose(wtypes.text) @wsme_pecan.wsexpose(wtypes.text)
def get(self): def get(self):
return "v2.0" return "v2"
class OctaviaV2Controller(base.BaseController): class OctaviaV2Controller(base.BaseController):
@ -58,7 +58,7 @@ class OctaviaV2Controller(base.BaseController):
@wsme_pecan.wsexpose(wtypes.text) @wsme_pecan.wsexpose(wtypes.text)
def get(self): def get(self):
return "v2.0" return "v2"
class V2Controller(BaseV2Controller): class V2Controller(BaseV2Controller):

View File

@ -21,14 +21,14 @@ rules = [
action=constants.RBAC_GET_ALL), action=constants.RBAC_GET_ALL),
constants.RULE_API_ADMIN, constants.RULE_API_ADMIN,
"List Amphorae", "List Amphorae",
[{'method': 'GET', 'path': '/v2.0/octavia/amphorae'}] [{'method': 'GET', 'path': '/v2/octavia/amphorae'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_AMPHORA, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_AMPHORA,
action=constants.RBAC_GET_ONE), action=constants.RBAC_GET_ONE),
constants.RULE_API_ADMIN, constants.RULE_API_ADMIN,
"Show Amphora details", "Show Amphora details",
[{'method': 'GET', 'path': '/v2.0/octavia/amphorae/{amphora_id}'}] [{'method': 'GET', 'path': '/v2/octavia/amphorae/{amphora_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_AMPHORA, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_AMPHORA,
@ -36,7 +36,7 @@ rules = [
constants.RULE_API_ADMIN, constants.RULE_API_ADMIN,
"Failover Amphora", "Failover Amphora",
[{'method': 'PUT', [{'method': 'PUT',
'path': '/v2.0/octavia/amphorae/{amphora_id}/failover'}] 'path': '/v2/octavia/amphorae/{amphora_id}/failover'}]
), ),
] ]

View File

@ -21,21 +21,21 @@ rules = [
action=constants.RBAC_GET_ALL), action=constants.RBAC_GET_ALL),
constants.RULE_API_READ, constants.RULE_API_READ,
"List Health Monitors of a Pool", "List Health Monitors of a Pool",
[{'method': 'GET', 'path': '/v2.0/lbaas/healthmonitors'}] [{'method': 'GET', 'path': '/v2/lbaas/healthmonitors'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_HEALTHMONITOR, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_HEALTHMONITOR,
action=constants.RBAC_GET_ALL_GLOBAL), action=constants.RBAC_GET_ALL_GLOBAL),
constants.RULE_API_READ_GLOBAL, constants.RULE_API_READ_GLOBAL,
"List Health Monitors including resources owned by others", "List Health Monitors including resources owned by others",
[{'method': 'GET', 'path': '/v2.0/lbaas/healthmonitors'}] [{'method': 'GET', 'path': '/v2/lbaas/healthmonitors'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_HEALTHMONITOR, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_HEALTHMONITOR,
action=constants.RBAC_POST), action=constants.RBAC_POST),
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Create a Health Monitor", "Create a Health Monitor",
[{'method': 'POST', 'path': '/v2.0/lbaas/healthmonitors'}] [{'method': 'POST', 'path': '/v2/lbaas/healthmonitors'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_HEALTHMONITOR, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_HEALTHMONITOR,
@ -43,7 +43,7 @@ rules = [
constants.RULE_API_READ, constants.RULE_API_READ,
"Show Health Monitor details", "Show Health Monitor details",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/healthmonitors/{healthmonitor_id}'}] 'path': '/v2/lbaas/healthmonitors/{healthmonitor_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_HEALTHMONITOR, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_HEALTHMONITOR,
@ -51,7 +51,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Update a Health Monitor", "Update a Health Monitor",
[{'method': 'PUT', [{'method': 'PUT',
'path': '/v2.0/lbaas/healthmonitors/{healthmonitor_id}'}] 'path': '/v2/lbaas/healthmonitors/{healthmonitor_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_HEALTHMONITOR, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_HEALTHMONITOR,
@ -59,7 +59,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Remove a Health Monitor", "Remove a Health Monitor",
[{'method': 'DELETE', [{'method': 'DELETE',
'path': '/v2.0/lbaas/healthmonitors/{healthmonitor_id}'}] 'path': '/v2/lbaas/healthmonitors/{healthmonitor_id}'}]
), ),
] ]

View File

@ -21,21 +21,21 @@ rules = [
action=constants.RBAC_GET_ALL), action=constants.RBAC_GET_ALL),
constants.RULE_API_READ, constants.RULE_API_READ,
"List L7 Policys", "List L7 Policys",
[{'method': 'GET', 'path': '/v2.0/lbaas/l7policies'}] [{'method': 'GET', 'path': '/v2/lbaas/l7policies'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7POLICY, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7POLICY,
action=constants.RBAC_GET_ALL_GLOBAL), action=constants.RBAC_GET_ALL_GLOBAL),
constants.RULE_API_READ_GLOBAL, constants.RULE_API_READ_GLOBAL,
"List L7 Policys including resources owned by others", "List L7 Policys including resources owned by others",
[{'method': 'GET', 'path': '/v2.0/lbaas/l7policies'}] [{'method': 'GET', 'path': '/v2/lbaas/l7policies'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7POLICY, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7POLICY,
action=constants.RBAC_POST), action=constants.RBAC_POST),
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Create a L7 Policy", "Create a L7 Policy",
[{'method': 'POST', 'path': '/v2.0/lbaas/l7policies'}] [{'method': 'POST', 'path': '/v2/lbaas/l7policies'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7POLICY, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7POLICY,
@ -43,7 +43,7 @@ rules = [
constants.RULE_API_READ, constants.RULE_API_READ,
"Show L7 Policy details", "Show L7 Policy details",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/l7policies/{l7policy_id}'}] 'path': '/v2/lbaas/l7policies/{l7policy_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7POLICY, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7POLICY,
@ -51,7 +51,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Update a L7 Policy", "Update a L7 Policy",
[{'method': 'PUT', [{'method': 'PUT',
'path': '/v2.0/lbaas/l7policies/{l7policy_id}'}] 'path': '/v2/lbaas/l7policies/{l7policy_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7POLICY, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7POLICY,
@ -59,7 +59,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Remove a L7 Policy", "Remove a L7 Policy",
[{'method': 'DELETE', [{'method': 'DELETE',
'path': '/v2.0/lbaas/l7policies/{l7policy_id}'}] 'path': '/v2/lbaas/l7policies/{l7policy_id}'}]
), ),
] ]

View File

@ -22,7 +22,7 @@ rules = [
constants.RULE_API_READ, constants.RULE_API_READ,
"List L7 Rules", "List L7 Rules",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/l7policies/{l7policy_id}/rules'}] 'path': '/v2/lbaas/l7policies/{l7policy_id}/rules'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7RULE, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7RULE,
@ -30,7 +30,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Create a L7 Rule", "Create a L7 Rule",
[{'method': 'POST', [{'method': 'POST',
'path': '/v2.0/lbaas/l7policies/{l7policy_id}/rules'}] 'path': '/v2/lbaas/l7policies/{l7policy_id}/rules'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7RULE, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7RULE,
@ -38,7 +38,7 @@ rules = [
constants.RULE_API_READ, constants.RULE_API_READ,
"Show L7 Rule details", "Show L7 Rule details",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id}'}] 'path': '/v2/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7RULE, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7RULE,
@ -46,7 +46,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Update a L7 Rule", "Update a L7 Rule",
[{'method': 'PUT', [{'method': 'PUT',
'path': '/v2.0/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id}'}] 'path': '/v2/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7RULE, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_L7RULE,
@ -54,7 +54,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Remove a L7 Rule", "Remove a L7 Rule",
[{'method': 'DELETE', [{'method': 'DELETE',
'path': '/v2.0/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id}'}] 'path': '/v2/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id}'}]
), ),
] ]

View File

@ -21,21 +21,21 @@ rules = [
action=constants.RBAC_GET_ALL), action=constants.RBAC_GET_ALL),
constants.RULE_API_READ, constants.RULE_API_READ,
"List Listeners", "List Listeners",
[{'method': 'GET', 'path': '/v2.0/lbaas/listeners'}] [{'method': 'GET', 'path': '/v2/lbaas/listeners'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LISTENER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LISTENER,
action=constants.RBAC_GET_ALL_GLOBAL), action=constants.RBAC_GET_ALL_GLOBAL),
constants.RULE_API_READ_GLOBAL, constants.RULE_API_READ_GLOBAL,
"List Listeners including resources owned by others", "List Listeners including resources owned by others",
[{'method': 'GET', 'path': '/v2.0/lbaas/listeners'}] [{'method': 'GET', 'path': '/v2/lbaas/listeners'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LISTENER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LISTENER,
action=constants.RBAC_POST), action=constants.RBAC_POST),
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Create a Listener", "Create a Listener",
[{'method': 'POST', 'path': '/v2.0/lbaas/listeners'}] [{'method': 'POST', 'path': '/v2/lbaas/listeners'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LISTENER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LISTENER,
@ -43,7 +43,7 @@ rules = [
constants.RULE_API_READ, constants.RULE_API_READ,
"Show Listener details", "Show Listener details",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/listeners/{listener_id}'}] 'path': '/v2/lbaas/listeners/{listener_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LISTENER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LISTENER,
@ -51,7 +51,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Update a Listener", "Update a Listener",
[{'method': 'PUT', [{'method': 'PUT',
'path': '/v2.0/lbaas/listeners/{listener_id}'}] 'path': '/v2/lbaas/listeners/{listener_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LISTENER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LISTENER,
@ -59,7 +59,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Remove a Listener", "Remove a Listener",
[{'method': 'DELETE', [{'method': 'DELETE',
'path': '/v2.0/lbaas/listeners/{listener_id}'}] 'path': '/v2/lbaas/listeners/{listener_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LISTENER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LISTENER,
@ -67,7 +67,7 @@ rules = [
constants.RULE_API_READ, constants.RULE_API_READ,
"Show Listener statistics", "Show Listener statistics",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/listeners/{listener_id}/stats'}] 'path': '/v2/lbaas/listeners/{listener_id}/stats'}]
), ),
] ]

View File

@ -21,21 +21,21 @@ rules = [
action=constants.RBAC_GET_ALL), action=constants.RBAC_GET_ALL),
constants.RULE_API_READ, constants.RULE_API_READ,
"List Load Balancers", "List Load Balancers",
[{'method': 'GET', 'path': '/v2.0/lbaas/loadbalancers'}] [{'method': 'GET', 'path': '/v2/lbaas/loadbalancers'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER,
action=constants.RBAC_GET_ALL_GLOBAL), action=constants.RBAC_GET_ALL_GLOBAL),
constants.RULE_API_READ_GLOBAL, constants.RULE_API_READ_GLOBAL,
"List Load Balancers including resources owned by others", "List Load Balancers including resources owned by others",
[{'method': 'GET', 'path': '/v2.0/lbaas/loadbalancers'}] [{'method': 'GET', 'path': '/v2/lbaas/loadbalancers'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER,
action=constants.RBAC_POST), action=constants.RBAC_POST),
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Create a Load Balancer", "Create a Load Balancer",
[{'method': 'POST', 'path': '/v2.0/lbaas/loadbalancers'}] [{'method': 'POST', 'path': '/v2/lbaas/loadbalancers'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER,
@ -43,7 +43,7 @@ rules = [
constants.RULE_API_READ, constants.RULE_API_READ,
"Show Load Balancer details", "Show Load Balancer details",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/loadbalancers/{loadbalancer_id}'}] 'path': '/v2/lbaas/loadbalancers/{loadbalancer_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER,
@ -51,7 +51,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Update a Load Balancer", "Update a Load Balancer",
[{'method': 'PUT', [{'method': 'PUT',
'path': '/v2.0/lbaas/loadbalancers/{loadbalancer_id}'}] 'path': '/v2/lbaas/loadbalancers/{loadbalancer_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER,
@ -59,7 +59,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Remove a Load Balancer", "Remove a Load Balancer",
[{'method': 'DELETE', [{'method': 'DELETE',
'path': '/v2.0/lbaas/loadbalancers/{loadbalancer_id}'}] 'path': '/v2/lbaas/loadbalancers/{loadbalancer_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER,
@ -67,7 +67,7 @@ rules = [
constants.RULE_API_READ, constants.RULE_API_READ,
"Show Load Balancer statistics", "Show Load Balancer statistics",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/loadbalancers/{loadbalancer_id}/stats'}] 'path': '/v2/lbaas/loadbalancers/{loadbalancer_id}/stats'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER,
@ -75,7 +75,7 @@ rules = [
constants.RULE_API_READ, constants.RULE_API_READ,
"Show Load Balancer status", "Show Load Balancer status",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/loadbalancers/{loadbalancer_id}/status'}] 'path': '/v2/lbaas/loadbalancers/{loadbalancer_id}/status'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_LOADBALANCER,
@ -83,7 +83,7 @@ rules = [
constants.RULE_API_ADMIN, constants.RULE_API_ADMIN,
"Failover a Load Balancer", "Failover a Load Balancer",
[{'method': 'PUT', [{'method': 'PUT',
'path': '/v2.0/lbaas/loadbalancers/{loadbalancer_id}/failover'}] 'path': '/v2/lbaas/loadbalancers/{loadbalancer_id}/failover'}]
), ),
] ]

View File

@ -21,14 +21,14 @@ rules = [
action=constants.RBAC_GET_ALL), action=constants.RBAC_GET_ALL),
constants.RULE_API_READ, constants.RULE_API_READ,
"List Members of a Pool", "List Members of a Pool",
[{'method': 'GET', 'path': '/v2.0/lbaas/pools/{pool_id}/members'}] [{'method': 'GET', 'path': '/v2/lbaas/pools/{pool_id}/members'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_MEMBER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_MEMBER,
action=constants.RBAC_POST), action=constants.RBAC_POST),
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Create a Member", "Create a Member",
[{'method': 'POST', 'path': '/v2.0/lbaas/pools/{pool_id}/members'}] [{'method': 'POST', 'path': '/v2/lbaas/pools/{pool_id}/members'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_MEMBER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_MEMBER,
@ -36,7 +36,7 @@ rules = [
constants.RULE_API_READ, constants.RULE_API_READ,
"Show Member details", "Show Member details",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/pools/{pool_id}/members/{member_id}'}] 'path': '/v2/lbaas/pools/{pool_id}/members/{member_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_MEMBER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_MEMBER,
@ -44,7 +44,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Update a Member", "Update a Member",
[{'method': 'PUT', [{'method': 'PUT',
'path': '/v2.0/lbaas/pools/{pool_id}/members/{member_id}'}] 'path': '/v2/lbaas/pools/{pool_id}/members/{member_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_MEMBER, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_MEMBER,
@ -52,7 +52,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Remove a Member", "Remove a Member",
[{'method': 'DELETE', [{'method': 'DELETE',
'path': '/v2.0/lbaas/pools/{pool_id}/members/{member_id}'}] 'path': '/v2/lbaas/pools/{pool_id}/members/{member_id}'}]
), ),
] ]

View File

@ -21,21 +21,21 @@ rules = [
action=constants.RBAC_GET_ALL), action=constants.RBAC_GET_ALL),
constants.RULE_API_READ, constants.RULE_API_READ,
"List Pools", "List Pools",
[{'method': 'GET', 'path': '/v2.0/lbaas/pools'}] [{'method': 'GET', 'path': '/v2/lbaas/pools'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_POOL, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_POOL,
action=constants.RBAC_GET_ALL_GLOBAL), action=constants.RBAC_GET_ALL_GLOBAL),
constants.RULE_API_READ_GLOBAL, constants.RULE_API_READ_GLOBAL,
"List Pools including resources owned by others", "List Pools including resources owned by others",
[{'method': 'GET', 'path': '/v2.0/lbaas/pools'}] [{'method': 'GET', 'path': '/v2/lbaas/pools'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_POOL, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_POOL,
action=constants.RBAC_POST), action=constants.RBAC_POST),
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Create a Pool", "Create a Pool",
[{'method': 'POST', 'path': '/v2.0/lbaas/pools'}] [{'method': 'POST', 'path': '/v2/lbaas/pools'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_POOL, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_POOL,
@ -43,7 +43,7 @@ rules = [
constants.RULE_API_READ, constants.RULE_API_READ,
"Show Pool details", "Show Pool details",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/pools/{pool_id}'}] 'path': '/v2/lbaas/pools/{pool_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_POOL, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_POOL,
@ -51,7 +51,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Update a Pool", "Update a Pool",
[{'method': 'PUT', [{'method': 'PUT',
'path': '/v2.0/lbaas/pools/{pool_id}'}] 'path': '/v2/lbaas/pools/{pool_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_POOL, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_POOL,
@ -59,7 +59,7 @@ rules = [
constants.RULE_API_WRITE, constants.RULE_API_WRITE,
"Remove a Pool", "Remove a Pool",
[{'method': 'DELETE', [{'method': 'DELETE',
'path': '/v2.0/lbaas/pools/{pool_id}'}] 'path': '/v2/lbaas/pools/{pool_id}'}]
), ),
] ]

View File

@ -21,7 +21,7 @@ rules = [
action=constants.RBAC_GET_ALL), action=constants.RBAC_GET_ALL),
constants.RULE_API_READ, constants.RULE_API_READ,
"List enabled providers", "List enabled providers",
[{'method': 'GET', 'path': '/v2.0/lbaas/providers'}] [{'method': 'GET', 'path': '/v2/lbaas/providers'}]
), ),
] ]

View File

@ -21,14 +21,14 @@ rules = [
action=constants.RBAC_GET_ALL), action=constants.RBAC_GET_ALL),
constants.RULE_API_READ_QUOTA, constants.RULE_API_READ_QUOTA,
"List Quotas", "List Quotas",
[{'method': 'GET', 'path': '/v2.0/lbaas/quotas'}] [{'method': 'GET', 'path': '/v2/lbaas/quotas'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_QUOTA, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_QUOTA,
action=constants.RBAC_GET_ALL_GLOBAL), action=constants.RBAC_GET_ALL_GLOBAL),
constants.RULE_API_READ_QUOTA_GLOBAL, constants.RULE_API_READ_QUOTA_GLOBAL,
"List Quotas including resources owned by others", "List Quotas including resources owned by others",
[{'method': 'GET', 'path': '/v2.0/lbaas/quotas'}] [{'method': 'GET', 'path': '/v2/lbaas/quotas'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_QUOTA, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_QUOTA,
@ -36,7 +36,7 @@ rules = [
constants.RULE_API_READ_QUOTA, constants.RULE_API_READ_QUOTA,
"Show Quota details", "Show Quota details",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/quotas/{project_id}'}] 'path': '/v2/lbaas/quotas/{project_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_QUOTA, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_QUOTA,
@ -44,7 +44,7 @@ rules = [
constants.RULE_API_WRITE_QUOTA, constants.RULE_API_WRITE_QUOTA,
"Update a Quota", "Update a Quota",
[{'method': 'PUT', [{'method': 'PUT',
'path': '/v2.0/lbaas/quotas/{project_id}'}] 'path': '/v2/lbaas/quotas/{project_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_QUOTA, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_QUOTA,
@ -52,7 +52,7 @@ rules = [
constants.RULE_API_WRITE_QUOTA, constants.RULE_API_WRITE_QUOTA,
"Reset a Quota", "Reset a Quota",
[{'method': 'DELETE', [{'method': 'DELETE',
'path': '/v2.0/lbaas/quotas/{project_id}'}] 'path': '/v2/lbaas/quotas/{project_id}'}]
), ),
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_QUOTA, '{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_QUOTA,
@ -60,7 +60,7 @@ rules = [
constants.RULE_API_READ_QUOTA, constants.RULE_API_READ_QUOTA,
"Show Default Quota for a Project", "Show Default Quota for a Project",
[{'method': 'GET', [{'method': 'GET',
'path': '/v2.0/lbaas/quotas/{project_id}/default'}] 'path': '/v2/lbaas/quotas/{project_id}/default'}]
), ),
] ]

View File

@ -46,15 +46,32 @@ class TestRootController(base_db_test.OctaviaDBTestBase):
versions = self._get_versions_with_config( versions = self._get_versions_with_config(
api_v1_enabled=True, api_v2_enabled=True) api_v1_enabled=True, api_v2_enabled=True)
version_ids = tuple(v.get('id') for v in versions) version_ids = tuple(v.get('id') for v in versions)
self.assertEqual(2, len(version_ids)) self.assertEqual(3, len(version_ids))
self.assertIn('v1', version_ids) self.assertIn('v1', version_ids)
self.assertIn('v2.0', version_ids)
self.assertIn('v2.1', version_ids) self.assertIn('v2.1', version_ids)
# Each version should have a 'self' 'href' to the API version URL
# [{u'rel': u'self', u'href': u'http://localhost/v2'}]
# Validate that the URL exists in the response
for version in versions:
url_version = None
if version['id'].startswith('v2.'):
url_version = 'v2'
else:
url_version = version['id']
version_url = 'http://localhost/{}'.format(url_version)
links = version['links']
# Note, there may be other links present, this test is for 'self'
version_link = [link for link in links if link['rel'] == 'self']
self.assertEqual(version_url, version_link[0]['href'])
def test_api_v1_disabled(self): def test_api_v1_disabled(self):
versions = self._get_versions_with_config( versions = self._get_versions_with_config(
api_v1_enabled=False, api_v2_enabled=True) api_v1_enabled=False, api_v2_enabled=True)
self.assertEqual(1, len(versions)) self.assertEqual(2, len(versions))
self.assertEqual('v2.1', versions[0].get('id')) self.assertEqual('v2.0', versions[0].get('id'))
self.assertEqual('v2.1', versions[1].get('id'))
def test_api_v2_disabled(self): def test_api_v2_disabled(self):
versions = self._get_versions_with_config( versions = self._get_versions_with_config(

View File

@ -29,7 +29,8 @@ from octavia.tests.functional.db import base as base_db_test
class BaseAPITest(base_db_test.OctaviaDBTestBase): class BaseAPITest(base_db_test.OctaviaDBTestBase):
BASE_PATH = '/v2.0' BASE_PATH = '/v2'
BASE_PATH_v2_0 = '/v2.0'
# /lbaas/loadbalancers # /lbaas/loadbalancers
LBS_PATH = '/lbaas/loadbalancers' LBS_PATH = '/lbaas/loadbalancers'
@ -124,6 +125,9 @@ class BaseAPITest(base_db_test.OctaviaDBTestBase):
def _get_full_path(self, path): def _get_full_path(self, path):
return ''.join([self.BASE_PATH, path]) return ''.join([self.BASE_PATH, path])
def _get_full_path_v2_0(self, path):
return ''.join([self.BASE_PATH_v2_0, path])
def _build_body(self, json): def _build_body(self, json):
return {self.root_tag: json} return {self.root_tag: json}
@ -144,9 +148,13 @@ class BaseAPITest(base_db_test.OctaviaDBTestBase):
expect_errors=expect_errors) expect_errors=expect_errors)
return response return response
def post(self, path, body, headers=None, status=201, expect_errors=False): def post(self, path, body, headers=None, status=201, expect_errors=False,
use_v2_0=False):
headers = headers or {} headers = headers or {}
full_path = self._get_full_path(path) if use_v2_0:
full_path = self._get_full_path_v2_0(path)
else:
full_path = self._get_full_path(path)
response = self.app.post_json(full_path, response = self.app.post_json(full_path,
params=body, params=body,
headers=headers, headers=headers,

View File

@ -74,6 +74,19 @@ class TestLoadBalancer(base.BaseAPITest):
self._assert_request_matches_response(lb_json, api_lb) self._assert_request_matches_response(lb_json, api_lb)
return api_lb return api_lb
# Make sure the /v2.0 alias is maintained for the life of the v2 API
def test_create_v2_0(self, **optionals):
lb_json = {'name': 'test1',
'vip_subnet_id': uuidutils.generate_uuid(),
'project_id': self.project_id
}
lb_json.update(optionals)
body = self._build_body(lb_json)
response = self.post(self.LBS_PATH, body, use_v2_0=True)
api_lb = response.json.get(self.root_tag)
self._assert_request_matches_response(lb_json, api_lb)
return api_lb
def test_create_using_tenant_id(self): def test_create_using_tenant_id(self):
lb_json = {'name': 'test1', lb_json = {'name': 'test1',
'vip_subnet_id': uuidutils.generate_uuid(), 'vip_subnet_id': uuidutils.generate_uuid(),

View File

@ -20,11 +20,11 @@ from tempest.lib.common import rest_client
class QuotasClient(rest_client.RestClient): class QuotasClient(rest_client.RestClient):
"""Tests Quotas API.""" """Tests Quotas API."""
_QUOTAS_URL = "v2.0/lbaas/quotas/{project_id}" _QUOTAS_URL = "v2/lbaas/quotas/{project_id}"
def list_quotas(self, params=None): def list_quotas(self, params=None):
"""List all non-default quotas.""" """List all non-default quotas."""
url = "v2.0/lbaas/quotas" url = "v2/lbaas/quotas"
if params: if params:
url = '{0}?{1}'.format(url, parse.urlencode(params)) url = '{0}?{1}'.format(url, parse.urlencode(params))
resp, body = self.get(url) resp, body = self.get(url)

View File

@ -168,7 +168,7 @@ class TestPaginationHelper(base.TestCase):
@mock.patch('octavia.api.common.pagination.request') @mock.patch('octavia.api.common.pagination.request')
def test_make_links_next(self, request_mock): def test_make_links_next(self, request_mock):
request_mock.path = "/lbaas/v2.0/pools/1/members" request_mock.path = "/lbaas/v2/pools/1/members"
request_mock.path_url = "http://localhost" + request_mock.path request_mock.path_url = "http://localhost" + request_mock.path
member1 = models.Member() member1 = models.Member()
member1.id = uuidutils.generate_uuid() member1.id = uuidutils.generate_uuid()
@ -188,7 +188,7 @@ class TestPaginationHelper(base.TestCase):
@mock.patch('octavia.api.common.pagination.request') @mock.patch('octavia.api.common.pagination.request')
def test_make_links_prev(self, request_mock): def test_make_links_prev(self, request_mock):
request_mock.path = "/lbaas/v2.0/pools/1/members" request_mock.path = "/lbaas/v2/pools/1/members"
request_mock.path_url = "http://localhost" + request_mock.path request_mock.path_url = "http://localhost" + request_mock.path
member1 = models.Member() member1 = models.Member()
member1.id = uuidutils.generate_uuid() member1.id = uuidutils.generate_uuid()
@ -214,7 +214,7 @@ class TestPaginationHelper(base.TestCase):
@mock.patch('octavia.api.common.pagination.request') @mock.patch('octavia.api.common.pagination.request')
def test_make_links_with_configured_url(self, request_mock): def test_make_links_with_configured_url(self, request_mock):
request_mock.path = "/lbaas/v2.0/pools/1/members" request_mock.path = "/lbaas/v2/pools/1/members"
request_mock.path_url = "http://localhost" + request_mock.path request_mock.path_url = "http://localhost" + request_mock.path
api_base_uri = "https://127.0.0.1" api_base_uri = "https://127.0.0.1"
conf = self.useFixture(oslo_fixture.Config(cfg.CONF)) conf = self.useFixture(oslo_fixture.Config(cfg.CONF))