Add OBJ_PROJECT_NAMESPACE for Heat project
This code will be used when objects are registered and serialized. Change-Id: I9d9095bc40e61a104ebea5042f4eb75d16d27d69 Partial-Bug: 1491258
This commit is contained in:
parent
aa867937c1
commit
dfdbc99d8f
22
heat/objects/base.py
Normal file
22
heat/objects/base.py
Normal file
@ -0,0 +1,22 @@
|
||||
# Copyright 2015 Intel Corp.
|
||||
#
|
||||
# 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.
|
||||
|
||||
"""Heat common internal object model"""
|
||||
|
||||
from oslo_versionedobjects import base as ovoo_base
|
||||
|
||||
|
||||
class HeatObject(ovoo_base.VersionedObject):
|
||||
OBJ_PROJECT_NAMESPACE = 'heat'
|
||||
VERSION = '1.0'
|
@ -18,10 +18,14 @@ from oslo_versionedobjects import base
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
from heat.objects import fields as heat_fields
|
||||
|
||||
|
||||
class Event(base.VersionedObject, base.VersionedObjectDictCompat):
|
||||
class Event(
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
):
|
||||
fields = {
|
||||
'id': fields.IntegerField(),
|
||||
'stack_id': fields.StringField(),
|
||||
|
@ -24,11 +24,12 @@ from oslo_versionedobjects import fields
|
||||
from heat.common import crypt
|
||||
from heat.common import environment_format as env_fmt
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
from heat.objects import fields as heat_fields
|
||||
|
||||
|
||||
class RawTemplate(
|
||||
base.VersionedObject,
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject,
|
||||
):
|
||||
|
@ -23,6 +23,7 @@ import six
|
||||
|
||||
from heat.common import crypt
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
from heat.objects import fields as heat_fields
|
||||
from heat.objects import resource_data
|
||||
from heat.objects import stack
|
||||
@ -31,7 +32,7 @@ cfg.CONF.import_opt('encrypt_parameters_and_properties', 'heat.common.config')
|
||||
|
||||
|
||||
class Resource(
|
||||
base.VersionedObject,
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject,
|
||||
):
|
||||
|
@ -20,10 +20,11 @@ from oslo_versionedobjects import fields
|
||||
|
||||
from heat.common import exception
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
|
||||
|
||||
class ResourceData(
|
||||
base.VersionedObject,
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject,
|
||||
):
|
||||
|
@ -18,11 +18,14 @@ from oslo_versionedobjects import base
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
|
||||
|
||||
class Service(base.VersionedObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject):
|
||||
class Service(
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject,
|
||||
):
|
||||
fields = {
|
||||
'id': fields.StringField(),
|
||||
'engine_id': fields.StringField(),
|
||||
|
@ -19,12 +19,15 @@ from oslo_versionedobjects import base
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
from heat.objects import fields as heat_fields
|
||||
|
||||
|
||||
class Snapshot(base.VersionedObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject):
|
||||
class Snapshot(
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject,
|
||||
):
|
||||
|
||||
fields = {
|
||||
'id': fields.StringField(),
|
||||
|
@ -19,12 +19,15 @@ from oslo_versionedobjects import base
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
from heat.objects import fields as heat_fields
|
||||
|
||||
|
||||
class SoftwareConfig(base.VersionedObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject):
|
||||
class SoftwareConfig(
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject,
|
||||
):
|
||||
fields = {
|
||||
'id': fields.StringField(),
|
||||
'name': fields.StringField(nullable=True),
|
||||
|
@ -19,13 +19,16 @@ from oslo_versionedobjects import base
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
from heat.objects import fields as heat_fields
|
||||
from heat.objects import software_config
|
||||
|
||||
|
||||
class SoftwareDeployment(base.VersionedObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject):
|
||||
class SoftwareDeployment(
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject,
|
||||
):
|
||||
fields = {
|
||||
'id': fields.StringField(),
|
||||
'config_id': fields.StringField(),
|
||||
|
@ -23,13 +23,14 @@ from oslo_versionedobjects import fields
|
||||
from heat.common import exception
|
||||
from heat.common.i18n import _
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
from heat.objects import fields as heat_fields
|
||||
from heat.objects import raw_template
|
||||
from heat.objects import stack_tag
|
||||
|
||||
|
||||
class Stack(
|
||||
base.VersionedObject,
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject,
|
||||
):
|
||||
|
@ -18,11 +18,14 @@ from oslo_versionedobjects import base
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
|
||||
|
||||
class StackLock(base.VersionedObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject):
|
||||
class StackLock(
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject,
|
||||
):
|
||||
fields = {
|
||||
'engine_id': fields.StringField(nullable=True),
|
||||
'stack_id': fields.StringField(),
|
||||
|
@ -18,11 +18,14 @@ from oslo_versionedobjects import base
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
|
||||
|
||||
class StackTag(base.VersionedObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject):
|
||||
class StackTag(
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject,
|
||||
):
|
||||
fields = {
|
||||
'id': fields.IntegerField(),
|
||||
'tag': fields.StringField(nullable=True),
|
||||
@ -49,8 +52,10 @@ class StackTag(base.VersionedObject,
|
||||
return cls._from_db_object(cls(context), tag)
|
||||
|
||||
|
||||
class StackTagList(base.VersionedObject,
|
||||
base.ObjectListBase):
|
||||
class StackTagList(
|
||||
heat_base.HeatObject,
|
||||
base.ObjectListBase,
|
||||
):
|
||||
|
||||
fields = {
|
||||
'objects': fields.ListOfObjectsField('StackTag'),
|
||||
|
@ -19,12 +19,15 @@ from oslo_versionedobjects import base
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
from heat.objects import fields as heat_fields
|
||||
|
||||
|
||||
class SyncPoint(base.VersionedObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject):
|
||||
class SyncPoint(
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject,
|
||||
):
|
||||
|
||||
fields = {
|
||||
'entity_id': fields.StringField(),
|
||||
|
@ -19,12 +19,15 @@ from oslo_versionedobjects import base
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
|
||||
|
||||
@base.VersionedObjectRegistry.register
|
||||
class UserCreds(base.VersionedObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject):
|
||||
class UserCreds(
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
base.ComparableVersionedObject,
|
||||
):
|
||||
fields = {
|
||||
'id': fields.StringField(),
|
||||
'created_at': fields.DateTimeField(read_only=True),
|
||||
|
@ -18,10 +18,14 @@ from oslo_versionedobjects import base
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
from heat.objects import fields as heat_fields
|
||||
|
||||
|
||||
class WatchData(base.VersionedObject, base.VersionedObjectDictCompat):
|
||||
class WatchData(
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
):
|
||||
|
||||
fields = {
|
||||
'id': fields.IntegerField(),
|
||||
|
@ -18,12 +18,16 @@ from oslo_versionedobjects import base
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from heat.db import api as db_api
|
||||
from heat.objects import base as heat_base
|
||||
from heat.objects import fields as heat_fields
|
||||
from heat.objects import stack
|
||||
from heat.objects import watch_data
|
||||
|
||||
|
||||
class WatchRule(base.VersionedObject, base.VersionedObjectDictCompat):
|
||||
class WatchRule(
|
||||
heat_base.HeatObject,
|
||||
base.VersionedObjectDictCompat,
|
||||
):
|
||||
|
||||
fields = {
|
||||
'id': fields.IntegerField(),
|
||||
|
Loading…
Reference in New Issue
Block a user