|
11 | 11 | # under the License. |
12 | 12 |
|
13 | 13 | from openstack.key_manager import key_manager_service |
14 | | -from openstack import resource |
| 14 | +from openstack.key_manager.v1 import _format |
| 15 | +from openstack import resource2 |
15 | 16 |
|
16 | 17 |
|
17 | | -class Order(resource.Resource): |
| 18 | +class Order(resource2.Resource): |
18 | 19 | resources_key = 'orders' |
19 | 20 | base_path = '/orders' |
20 | 21 | service = key_manager_service.KeyManagerService() |
21 | 22 |
|
22 | 23 | # capabilities |
23 | 24 | allow_create = True |
24 | | - allow_retrieve = True |
| 25 | + allow_get = True |
25 | 26 | allow_update = True |
26 | 27 | allow_delete = True |
27 | 28 | allow_list = True |
28 | 29 |
|
29 | | - # Properties |
30 | | - # TODO(briancurtin): not documented |
31 | | - error_reason = resource.prop('error_reason') |
32 | | - # TODO(briancurtin): not documented |
33 | | - error_status_code = resource.prop('error_status_code') |
34 | | - #: a dictionary containing key-value parameters which specify the |
| 30 | + #: Timestamp in ISO8601 format of when the order was created |
| 31 | + created_at = resource2.Body('created') |
| 32 | + #: Keystone Id of the user who created the order |
| 33 | + creator_id = resource2.Body('creator_id') |
| 34 | + #: A dictionary containing key-value parameters which specify the |
35 | 35 | #: details of an order request |
36 | | - meta = resource.prop('meta') |
| 36 | + meta = resource2.Body('meta', type=dict) |
37 | 37 | #: A URI for this order |
38 | | - order_ref = resource.prop('order_ref') |
39 | | - #: TODO(briancurtin): not documented |
40 | | - secret_ref = resource.prop('secret_ref') |
| 38 | + order_ref = resource2.Body('order_ref') |
| 39 | + #: The ID of this order |
| 40 | + order_id = resource2.Body('order_ref', alternate_id=True, |
| 41 | + type=_format.HREFToUUID) |
| 42 | + #: Secret href associated with the order |
| 43 | + secret_ref = resource2.Body('secret_ref') |
| 44 | + #: Secret ID associated with the order |
| 45 | + secret_id = resource2.Body('secret_ref', type=_format.HREFToUUID) |
41 | 46 | # The status of this order |
42 | | - status = resource.prop('status') |
| 47 | + status = resource2.Body('status') |
| 48 | + #: Metadata associated with the order |
| 49 | + sub_status = resource2.Body('sub_status') |
| 50 | + #: Metadata associated with the order |
| 51 | + sub_status_message = resource2.Body('sub_status_message') |
43 | 52 | # The type of order |
44 | | - type = resource.prop('type') |
| 53 | + type = resource2.Body('type') |
| 54 | + #: Timestamp in ISO8601 format of the last time the order was updated. |
| 55 | + updated_at = resource2.Body('updated') |
0 commit comments