Allow non admin users to check their own deleted instances

Registered by Zhenyu Zheng

Currently, their are two ways to list deleted instances:

1. we can use "GET /v2.1/62bfb653eb0d4d5cabdf635dd8181313/servers/detail?status=deleted HTTP/1.1" (nova list --status deleted in CLI)
2. we can also use "GET http://10.229.45.17:8774/v2.1/62bfb653eb0d4d5cabdf635dd8181313/servers/detail?deleted=True" (nova list --deleted in CLI)

As for non-admin users, the above mentioned two ways performed differently:
1 will return ERROR (Forbidden): Only administrators may list deleted instances (HTTP 403) as we have a limitation here:
https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/servers.py#L350

2 will silently change deleted=True to deleted=False due to:
https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/servers.py#L1139-L1145

This blueprint propose a consistent behavior about the above mentioned APIs:
Allowing non-admin users to query their own deleted instances using both the above mentioned APIs, as it is reasonable to show their own instances no matter what the status those instances are. It can also be made more flexible by adding a related policy, as the current "all_tenant" parameter implementation:
https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/servers.py#L384-L389

The implementation will add a new microversion and the request earlier than this microversion will not be affected.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Zhenyu Zheng
Direction:
Needs approval
Assignee:
Zhenyu Zheng
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/non-admin-check-own-deleted-instances,n,z

Addressed by: https://review.openstack.org/292769
    Add support for non-admin users to query their own deleted instances

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.