diff --git a/openstack/compute/v2/_proxy.py b/openstack/compute/v2/_proxy.py index e15629930..61bf6a71e 100644 --- a/openstack/compute/v2/_proxy.py +++ b/openstack/compute/v2/_proxy.py @@ -2174,7 +2174,7 @@ class Proxy(proxy.Proxy): return self._get( _server_action.ServerAction, server_id=server_id, - action_id=server_action, + request_id=server_action, ignore_missing=ignore_missing, ) diff --git a/openstack/compute/v2/server_action.py b/openstack/compute/v2/server_action.py index fff96ae88..06e4a12e3 100644 --- a/openstack/compute/v2/server_action.py +++ b/openstack/compute/v2/server_action.py @@ -49,7 +49,7 @@ class ServerActionEvent(resource.Resource): class ServerAction(resource.Resource): resource_key = 'instanceAction' resources_key = 'instanceActions' - base_path = '/servers/{server_id}/os-instance-actions' + base_path = '/servers/%(server_id)s/os-instance-actions' # capabilities allow_fetch = True @@ -68,7 +68,7 @@ class ServerAction(resource.Resource): # #: The ID of the server that this action relates to. # server_id = resource.Body('instance_uuid') #: The ID of the request that this action related to. - request_id = resource.Body('request_id') + request_id = resource.Body('request_id', alternate_id=True) #: The ID of the user which initiated the server action. user_id = resource.Body('user_id') #: The ID of the project that this server belongs to. diff --git a/openstack/tests/unit/compute/v2/test_proxy.py b/openstack/tests/unit/compute/v2/test_proxy.py index 9b166cc07..8c71fadcd 100644 --- a/openstack/tests/unit/compute/v2/test_proxy.py +++ b/openstack/tests/unit/compute/v2/test_proxy.py @@ -1453,11 +1453,11 @@ class TestServerAction(TestComputeProxy): self._verify( 'openstack.proxy.Proxy._get', self.proxy.get_server_action, - method_args=['action_id'], + method_args=['request_id'], method_kwargs={'server': 'server_id'}, expected_args=[server_action.ServerAction], expected_kwargs={ - 'action_id': 'action_id', 'server_id': 'server_id', + 'request_id': 'request_id', 'server_id': 'server_id', }, ) diff --git a/openstack/tests/unit/compute/v2/test_server_actions.py b/openstack/tests/unit/compute/v2/test_server_actions.py index bb34e2661..881634c35 100644 --- a/openstack/tests/unit/compute/v2/test_server_actions.py +++ b/openstack/tests/unit/compute/v2/test_server_actions.py @@ -55,7 +55,7 @@ class TestServerAction(base.TestCase): self.assertEqual('instanceAction', sot.resource_key) self.assertEqual('instanceActions', sot.resources_key) self.assertEqual( - '/servers/{server_id}/os-instance-actions', + '/servers/%(server_id)s/os-instance-actions', sot.base_path, ) self.assertTrue(sot.allow_fetch)