Add heat artifacts to Glare
Add heat artifacts to Glare: - Heat templates - Heat environments So after apply this patch users can use Glare to manage Heat templates and Heat environment within OS cloud. Change-Id: I69d59626651173fb30ff2c106cc3806f1ff9c22a
This commit is contained in:
parent
7616ae0756
commit
20954fb364
|
@ -0,0 +1,35 @@
|
|||
# Copyright 2016 OpenStack Foundation
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# 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 glare.objects import base
|
||||
from glare.objects.meta import attribute
|
||||
|
||||
|
||||
Field = attribute.Attribute.init
|
||||
Blob = attribute.BlobAttribute.init
|
||||
Dict = attribute.DictAttribute.init
|
||||
BlobDict = attribute.BlobDictAttribute.init
|
||||
|
||||
|
||||
class HeatEnvironment(base.BaseArtifact):
|
||||
|
||||
fields = {
|
||||
'environment': Blob(description="Heat Environment text body."),
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def get_type_name(cls):
|
||||
return "heat_environments"
|
|
@ -0,0 +1,50 @@
|
|||
# Copyright 2016 OpenStack Foundation
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# 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 oslo_versionedobjects import fields
|
||||
|
||||
from glare.objects import base
|
||||
from glare.objects.meta import attribute
|
||||
from glare.objects.meta import fields as glare_fields
|
||||
|
||||
|
||||
Field = attribute.Attribute.init
|
||||
Blob = attribute.BlobAttribute.init
|
||||
Dict = attribute.DictAttribute.init
|
||||
BlobDict = attribute.BlobDictAttribute.init
|
||||
|
||||
|
||||
class HeatTemplate(base.BaseArtifact):
|
||||
|
||||
fields = {
|
||||
'environments': Dict(glare_fields.Dependency,
|
||||
mutable=True,
|
||||
description="References to Heat Environments "
|
||||
"that can be used with current "
|
||||
"template."),
|
||||
'template': Blob(description="Heat template body."),
|
||||
'nested_templates': BlobDict(description="Dict of nested templates "
|
||||
"where key is the name of "
|
||||
"template and value is "
|
||||
"nested template body."),
|
||||
'default_envs': Dict(fields.String, mutable=True,
|
||||
description="Default environments that can be "
|
||||
"applied to the template if no "
|
||||
"environments specified by user.")
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def get_type_name(cls):
|
||||
return "heat_templates"
|
|
@ -33,7 +33,7 @@ LOG = logging.getLogger(__name__)
|
|||
|
||||
registry_options = [
|
||||
cfg.ListOpt('enabled_artifact_types',
|
||||
default=[],
|
||||
default=['heat_templates', 'heat_environments'],
|
||||
item_type=types.String(),
|
||||
help=_("List of enabled artifact types that will be "
|
||||
"available to user")),
|
||||
|
|
Loading…
Reference in New Issue