senlin/senlin/profiles/os/heat/resource.py

44 lines
1.3 KiB
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from senlin.profiles import base
__type_name__ = 'os.heat.resource'
class ResourceProfile(base.Profile):
'''Profile for an OpenStack Heat resource.
When this profile is used, the whole cluster is Heat stack, composed
of resources initialzed from this profile.
'''
spec_schema = {}
def __init__(self, type_name, name, **kwargs):
super(ResourceProfile, self).__init__(type_name, name, **kwargs)
def do_create(self):
return {}
def do_delete(self, id):
return True
def do_update(self, ):
self.status = self.UPDATING
# TODO(anyone): do update
self.status = self.ACTIVE
return {}
def do_check(self, id):
# TODO(liuh): add actual checking logic
return True