From 8d6ca1ed36c9af6e46d20ffd198f31adfc03e6d1 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Sun, 14 Apr 2019 20:14:57 +0000 Subject: [PATCH] Add 'finish_time' to container action Change-Id: I30cda2c12fa5c0df2d6835938bbc4fed820ee881 --- .zuul.yaml | 2 +- api-ref/source/samples/container-action-get-resp.json | 1 + api-ref/source/samples/container-actions-list-resp.json | 2 ++ zun/api/controllers/v1/views/actions_view.py | 1 + zun/api/controllers/versions.py | 3 ++- zun/api/rest_api_version_history.rst | 7 +++++++ zun/tests/unit/api/base.py | 2 +- zun/tests/unit/api/controllers/test_root.py | 4 ++-- 8 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index e254c0566..f1f796a93 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -26,7 +26,7 @@ test-config: $TEMPEST_CONFIG: container_service: - min_microversion: 1.32 + min_microversion: 1.33 devstack_services: tempest: true devstack_plugins: diff --git a/api-ref/source/samples/container-action-get-resp.json b/api-ref/source/samples/container-action-get-resp.json index 2077c1ea3..181ff9e9c 100644 --- a/api-ref/source/samples/container-action-get-resp.json +++ b/api-ref/source/samples/container-action-get-resp.json @@ -14,5 +14,6 @@ "project_id": "853719b303ef4858a195535eb520e58d", "request_id": "req-3293a3f1-b44c-4609-b8d2-d81b105636b8", "start_time": "2018-03-04T17:02:54.000000", + "finish_time": "2018-03-04T17:02:57.000000", "user_id": "22e81669093742b7a74b1d715a9a5813" } diff --git a/api-ref/source/samples/container-actions-list-resp.json b/api-ref/source/samples/container-actions-list-resp.json index 5a8f8f9b5..8874b17e6 100644 --- a/api-ref/source/samples/container-actions-list-resp.json +++ b/api-ref/source/samples/container-actions-list-resp.json @@ -7,6 +7,7 @@ "project_id": "853719b303ef4858a195535eb520e58d", "request_id": "req-25517360-b757-47d3-be45-0e8d2a01b36a", "start_time": "2018-03-04T19:48:49.000000", + "finish_time": "2018-03-04T19:48:55.000000", "user_id": "22e81669093742b7a74b1d715a9a5813" }, { @@ -16,6 +17,7 @@ "project_id": "853719b303ef4858a195535eb520e58d", "request_id": "req-3293a3f1-b44c-4609-b8d2-d81b105636b8", "start_time": "2018-03-04T17:02:54.000000", + "finish_time": "2018-03-04T17:02:58.000000", "user_id": "22e81669093742b7a74b1d715a9a5813" } ] diff --git a/zun/api/controllers/v1/views/actions_view.py b/zun/api/controllers/v1/views/actions_view.py index cb7a7e62d..9558d2018 100644 --- a/zun/api/controllers/v1/views/actions_view.py +++ b/zun/api/controllers/v1/views/actions_view.py @@ -20,6 +20,7 @@ from zun.common import utils _action_keys = ( 'action', 'container_uuid', + 'finish_time', 'message', 'project_id', 'request_id', diff --git a/zun/api/controllers/versions.py b/zun/api/controllers/versions.py index 3bcfbb1a6..9d4ddc216 100644 --- a/zun/api/controllers/versions.py +++ b/zun/api/controllers/versions.py @@ -65,10 +65,11 @@ REST_API_VERSION_HISTORY = """REST API Version History: * 1.30 - Introduce API resource for representing private registry * 1.31 - Add 'registry_id' to containers * 1.32 - Make capsule deletion asynchronized + * 1.33 - Add 'finish_time' to container actions """ BASE_VER = '1.1' -CURRENT_MAX_VER = '1.32' +CURRENT_MAX_VER = '1.33' class Version(object): diff --git a/zun/api/rest_api_version_history.rst b/zun/api/rest_api_version_history.rst index 30296db0b..d95e7074a 100644 --- a/zun/api/rest_api_version_history.rst +++ b/zun/api/rest_api_version_history.rst @@ -248,3 +248,10 @@ user documentation. Make capsule deletion asynchronized. API request to delete a capsule will return without waiting for the capsule to be deleted. + +1.33 +---- + + Add 'finish_time' to container action resource. + If the action is finished, 'finish_time' shows the finish time. + Otherwise, this field will be None. diff --git a/zun/tests/unit/api/base.py b/zun/tests/unit/api/base.py index 94099ba42..04d183ca8 100644 --- a/zun/tests/unit/api/base.py +++ b/zun/tests/unit/api/base.py @@ -26,7 +26,7 @@ from zun.tests.unit.db import base PATH_PREFIX = '/v1' -CURRENT_VERSION = "container 1.32" +CURRENT_VERSION = "container 1.33" class FunctionalTest(base.DbTestCase): diff --git a/zun/tests/unit/api/controllers/test_root.py b/zun/tests/unit/api/controllers/test_root.py index 4c3e0267a..cc637bd99 100644 --- a/zun/tests/unit/api/controllers/test_root.py +++ b/zun/tests/unit/api/controllers/test_root.py @@ -28,7 +28,7 @@ class TestRootController(api_base.FunctionalTest): 'default_version': {'id': 'v1', 'links': [{'href': 'http://localhost/v1/', 'rel': 'self'}], - 'max_version': '1.32', + 'max_version': '1.33', 'min_version': '1.1', 'status': 'CURRENT'}, 'description': 'Zun is an OpenStack project which ' @@ -37,7 +37,7 @@ class TestRootController(api_base.FunctionalTest): 'versions': [{'id': 'v1', 'links': [{'href': 'http://localhost/v1/', 'rel': 'self'}], - 'max_version': '1.32', + 'max_version': '1.33', 'min_version': '1.1', 'status': 'CURRENT'}]}