Remove target_power_state
Maybe this is useful for tracking power transition, but seems we should expose task_state or something else to users instead of just using ironic's feild, this is the first step of refactoring. Change-Id: Ibe83f3bfd534e2600769f39045da4d2812ebf5e1
This commit is contained in:
parent
d383c22477
commit
ed9c19d02c
@ -296,8 +296,7 @@ Instance Management (instances)
|
|||||||
Instances can be managed through several sub-resources.
|
Instances can be managed through several sub-resources.
|
||||||
|
|
||||||
A Instance can be rebooted, turned on, or turned off by requesting a change to
|
A Instance can be rebooted, turned on, or turned off by requesting a change to
|
||||||
its power state. This is handled asynchronously and tracked in the
|
its power state. This is handled asynchronously.
|
||||||
``target_power_state`` field after the request is received.
|
|
||||||
|
|
||||||
|
|
||||||
Instance State Summary
|
Instance State Summary
|
||||||
@ -322,7 +321,6 @@ Response
|
|||||||
.. rest_parameters:: parameters.yaml
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
- power_state: power_state
|
- power_state: power_state
|
||||||
- target_power_state: target_power_state
|
|
||||||
|
|
||||||
**Example instance state:**
|
**Example instance state:**
|
||||||
|
|
||||||
|
@ -210,13 +210,6 @@ project_id_body:
|
|||||||
in: body
|
in: body
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
target_power_state:
|
|
||||||
description: |
|
|
||||||
If a power state transition has been requested, this field represents the
|
|
||||||
requested (ie, "target") state.
|
|
||||||
in: body
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
type_description:
|
type_description:
|
||||||
description: |
|
description: |
|
||||||
The description of the type.
|
The description of the type.
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
{
|
{
|
||||||
"power_state": "power off",
|
"power_state": "power off"
|
||||||
"target_power_state": null
|
|
||||||
}
|
}
|
||||||
|
@ -85,15 +85,11 @@ class InstanceStates(base.APIBase):
|
|||||||
# Just support power state at present.
|
# Just support power state at present.
|
||||||
# We can expend other fields for other type state.
|
# We can expend other fields for other type state.
|
||||||
power_state = wtypes.text
|
power_state = wtypes.text
|
||||||
"""Represent the current (not transition) power state of the instance"""
|
"""Represent the current power state of the instance"""
|
||||||
|
|
||||||
target_power_state = wtypes.text
|
|
||||||
"""The user modified desired power state of the instance."""
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def sample(cls):
|
def sample(cls):
|
||||||
sample = cls(target_power_state=ir_states.POWER_ON,
|
sample = cls(power_state=ir_states.POWER_ON)
|
||||||
power_state=ir_states.POWER_ON)
|
|
||||||
return sample
|
return sample
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user