1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
# not use this file except in compliance with the License. You may obtain
5
# a copy of the License at
7
# http://www.apache.org/licenses/LICENSE-2.0
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
# License for the specific language governing permissions and limitations
15
from heatclient.common import base
16
from heatclient.v1 import stacks
18
DEFAULT_PAGE_SIZE = 20
21
class Action(base.Resource):
23
return "<Action %s>" % self._info
25
def update(self, **fields):
26
self.manager.update(self, **fields)
29
return self.manager.delete(self)
31
def data(self, **kwargs):
32
return self.manager.data(self, **kwargs)
35
class ActionManager(stacks.StackChildManager):
36
resource_class = Action
38
def suspend(self, stack_id):
39
"""Suspend a stack."""
40
body = {'suspend': None}
41
resp, body = self.api.json_request('POST',
42
'/stacks/%s/actions' % stack_id,
45
def resume(self, stack_id):
47
body = {'resume': None}
48
resp, body = self.api.json_request('POST',
49
'/stacks/%s/actions' % stack_id,