API: get the status of a locked instance

Registered by jichenjc

Currently we only support locking/unlocking an instance but we are not able
to query whether the instance is locked or not.
This proposal is to add the lock status to the detailed view of an instance.

Add following output to the response body of
GET /v2/45210fba73d24dd681dc5c292c6b1e7f/
servers/a9dd1fd6-27fb-4128-92e6-93bcab085a98

Following lock info will be added in addition to
existing output info.

+---------------+---------------------+--------------------------------------+
| Parameter | Type | Description |
+===============+=====================+======================================+
| locked | boolean | whether the instance is locked |
+---------------+---------------------+--------------------------------------+
| locked_by | string | User locked the instance, current |
| | | valid value are 'admin' and 'owner' |
+---------------+---------------------+--------------------------------------+

If the locked is True, following info will be added into output:

+---------------+-----------------------------------------+
| Parameter | Data |
+===============+=========================================+
| locked | True |
+---------------+-----------------------------------------+
| locked_by | 'admin' |
+---------------+-----------------------------------------+

If the locked is false, this will return following info:

+---------------+-----------------------------------------+
| Parameter | Data |
+===============+=========================================+
| locked | False |
+---------------+-----------------------------------------+
| locked_by | None |
+---------------+-----------------------------------------+

Both v2 and v3 API will be affected.

* In v2 API, extension os-server-locked-status will be added to
  advertise the extra information.
  alias: os-server-locked-status
  name: ServerLockStatus
  namespace: http://docs.openstack.org/compute/ext/server_locked_status/api/v2
  When the new extension "os-server-locked-status" is loaded,
  2 new fields 'locked', 'locked_by' will be added to
  the os-hypervisor API.

Blueprint information

Status:
Started
Approver:
John Garbutt
Priority:
Low
Drafter:
jichenjc
Direction:
Needs approval
Assignee:
jichenjc
Definition:
Pending Approval
Series goal:
Accepted for trunk
Implementation:
Slow progress
Milestone target:
milestone icon next
Started by
Thierry Carrez

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:get-lock-status-of-instance,n,z

Addressed by: https://review.openstack.org/127139
    Add lock status into return of instance info

Approved as spec is approved. --johnthetubaguy 17th October 2014

Gerrit topic: https://review.openstack.org/#q,topic:bp/get-lock-status-of-instance,n,z

Addressed by: https://review.openstack.org/131094
    Add lock status into v2 API

Bumping to k-2 -- mikal 9 Dec 2014

only see v2 code, and not v2.1 code, so this is not all up for review. This has missed the Feature Freeze Proposal deadline, unapproving this blueprint. --johnthetubaguy 26th Jan 2015

No need to address v2.1 code since it's already there
so only v2 code is enough and all features are submitted , so please help to remove this unapproving, thanks

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.