glare.objects package

Submodules

glare.objects.all module

class glare.objects.all.All(context=None, **kwargs)[source]

Bases: glare.objects.base.BaseArtifact

Artifact type that allows to get artifacts regardless of their type

activated_at
classmethod create(context)[source]
created_at
classmethod delete(context, af)[source]
description
fields = {‘status’: String(default=drafted,nullable=False), ‘type_name’: String(default=None,nullable=True), ‘description’: String(default=,nullable=True), ‘tags’: List(default=[],nullable=True), ‘created_at’: DateTime(default=None,nullable=False), ‘activated_at’: DateTime(default=None,nullable=True), ‘updated_at’: DateTime(default=None,nullable=False), ‘visibility’: String(default=private,nullable=False), ‘version’: Version(default=0.0.0,nullable=False), ‘owner’: String(default=None,nullable=False), ‘metadata’: Dict(default={},nullable=True), ‘id’: String(default=None,nullable=False), ‘name’: String(default=None,nullable=False)}
classmethod get_type_name()[source]
id
metadata
name
owner
save(context)[source]
status
tags
type_name
classmethod update_blob(context, af_id, field_name, values)[source]
updated_at
version
visibility

glare.objects.base module

class glare.objects.base.BaseArtifact(context=None, **kwargs)[source]

Bases: oslo_versionedobjects.base.VersionedObject

BaseArtifact is a central place in Glare. It execute Glare business logic operations and checks in like: 1) Check if artifact satisfies all requirements and can be activated 2) Check that artifact is not deactivated and download blobs … BaseArtifact interacts with database and saves/request artifact info from specified database API. Base Artifact is an abstract class so all concrete classes must be inherited from that class. Concrete classes must define custom fields in addition to BaseArtifact fields and db_api that must be used for interaction with database.

Blob(*args, **kwargs)

Fabric to build fields.

DEFAULT_ARTIFACT_VERSION = ‘0.0.0’
DictField(*args, **kwargs)

Fabric to build fields.

Field(*args, **kwargs)

Fabric to build fields.

ListField(*args, **kwargs)

Fabric to build fields.

OBJ_PROJECT_NAMESPACE = ‘glare’
STATUS = (‘drafted’, ‘active’, ‘deactivated’, ‘deleted’)
artifact_type_opts = []
common_artifact_type_opts = [<oslo_config.cfg.IntOpt object at 0x4e3ab10>, <oslo_config.cfg.IntOpt object at 0x4e3abd0>, <oslo_config.cfg.BoolOpt object at 0x4e3ac50>, <oslo_config.cfg.StrOpt object at 0x4e3acd0>]
create(context)[source]

Create new artifact in Glare repo.

Parameters:context – user context
Returns:created artifact object
db_api = <glare.db.artifact_api.ArtifactAPI object at 0x4e3ad50>
classmethod delete(context, af)[source]

Delete artifact and all its blobs from Glare.

Parameters:
  • context – user context
  • af – artifact object targeted for deletion
fields = {‘status’: String(default=drafted,nullable=False), ‘description’: String(default=,nullable=True), ‘tags’: List(default=[],nullable=True), ‘activated_at’: DateTime(default=None,nullable=True), ‘updated_at’: DateTime(default=None,nullable=False), ‘visibility’: String(default=private,nullable=False), ‘owner’: String(default=None,nullable=False), ‘id’: String(default=None,nullable=False), ‘name’: String(default=None,nullable=False), ‘created_at’: DateTime(default=None,nullable=False), ‘version’: Version(default=0.0.0,nullable=False), ‘metadata’: Dict(default={},nullable=True)}
classmethod gen_schemas()[source]

Return json schema representation of the artifact type.

classmethod get_max_blob_size(field_name)[source]

Get the maximum allowed blob size in bytes.

Parameters:field_name – blob or blob dict field name
Returns:maximum blob size in bytes
classmethod get_max_folder_size(field_name)[source]

Get the maximum allowed folder size in bytes.

Parameters:field_name – folder (blob dict) field name
Returns:maximum folder size in bytes
classmethod get_type_name()[source]

Return type name that allows to find artifact type in Glare

Type name allows to find artifact type definition in Glare registry.

Returns:string that identifies current artifact type
classmethod init_artifact(context, values)[source]

Initialize an empty versioned object with values.

Initialize vo object with default values and values specified by user. Also reset all changes of initialized object so user can track own changes.

Parameters:
  • context – user context
  • values – values needs to be set
Returns:

artifact with initialized values

classmethod is_blob(field_name)[source]

Helper to check that a field is a blob.

Parameters:field_name – name of the field
Returns:True if the field is a blob, False otherwise
classmethod is_blob_dict(field_name)[source]

Helper to check that field is a blob dict.

Parameters:field_name – name of the field
Returns:True if the field is a blob dict, False otherwise
classmethod list(context, filters=None, marker=None, limit=None, sort=None, latest=False)[source]

Return list of artifacts requested by user.

Parameters:
  • context – user context
  • filters – filters that need to be applied to artifact
  • marker – the artifact that considered as begin of the list

so all artifacts before marker (including marker itself) will not be added to artifact list :param limit: maximum number of items in the list :param sort: sorting options :param latest: flag that indicates, that only artifacts with highest versions should be returned in output :return: list of artifact objects

classmethod list_artifact_type_opts()[source]
obj_changes_to_primitive()[source]
classmethod post_activate_hook(context, af)[source]
classmethod post_add_location_hook(context, af, field_name, blob_key)[source]
classmethod post_create_hook(context, af)[source]
classmethod post_deactivate_hook(context, af)[source]
classmethod post_delete_hook(context, af)[source]
classmethod post_download_hook(context, af, field_name, blob_key, fd)[source]
classmethod post_publish_hook(context, af)[source]
classmethod post_reactivate_hook(context, af)[source]
classmethod post_update_hook(context, af)[source]
classmethod post_upload_hook(context, af, field_name, blob_key)[source]
classmethod pre_activate_hook(context, af)[source]
classmethod pre_add_location_hook(context, af, field_name, blob_key, location)[source]
classmethod pre_create_hook(context, af)[source]
classmethod pre_deactivate_hook(context, af)[source]
classmethod pre_delete_hook(context, af)[source]
classmethod pre_download_hook(context, af, field_name, blob_key)[source]
classmethod pre_publish_hook(context, af)[source]
classmethod pre_reactivate_hook(context, af)[source]
classmethod pre_update_hook(context, af)[source]
classmethod pre_upload_hook(context, af, field_name, blob_key, fd)[source]
save(context)[source]

Save artifact in Glare repo.

Parameters:context – user context
Returns:updated artifact object
classmethod show(context, artifact_id)[source]

Return Artifact from Glare repo

Parameters:
  • context – user context
  • artifact_id – id of requested artifact
Returns:

requested artifact object

to_dict()[source]

Convert oslo versioned object to dictionary.

Returns:dict with field names and field values
to_notification()[source]

Return notification body that can be send to listeners.

Returns:dict with notification information
classmethod update_blob(context, af_id, field_name, values)[source]

Update blob info in database.

Parameters:
  • context – user context
  • af_id – id of modified artifact
  • field_name – blob or blob dict field name
  • values – updated blob values
Returns:

updated artifact definition in Glare

glare.objects.heat_environment module

class glare.objects.heat_environment.HeatEnvironment(context=None, **kwargs)[source]

Bases: glare.objects.base.BaseArtifact

activated_at
created_at
description
environment
fields = {‘status’: String(default=drafted,nullable=False), ‘description’: String(default=,nullable=True), ‘tags’: List(default=[],nullable=True), ‘created_at’: DateTime(default=None,nullable=False), ‘activated_at’: DateTime(default=None,nullable=True), ‘updated_at’: DateTime(default=None,nullable=False), ‘visibility’: String(default=private,nullable=False), ‘environment’: BlobFieldType(default=None,nullable=True), ‘version’: Version(default=0.0.0,nullable=False), ‘owner’: String(default=None,nullable=False), ‘metadata’: Dict(default={},nullable=True), ‘id’: String(default=None,nullable=False), ‘name’: String(default=None,nullable=False)}
classmethod get_type_name()[source]
id
metadata
name
owner
status
tags
updated_at
version
visibility

glare.objects.heat_template module

class glare.objects.heat_template.HeatTemplate(context=None, **kwargs)[source]

Bases: glare.objects.base.BaseArtifact

activated_at
created_at
default_envs
description
environments
fields = {‘status’: String(default=drafted,nullable=False), ‘description’: String(default=,nullable=True), ‘default_envs’: Dict(default={},nullable=True), ‘tags’: List(default=[],nullable=True), ‘created_at’: DateTime(default=None,nullable=False), ‘activated_at’: DateTime(default=None,nullable=True), ‘updated_at’: DateTime(default=None,nullable=False), ‘environments’: Dict(default={},nullable=True), ‘name’: String(default=None,nullable=False), ‘version’: Version(default=0.0.0,nullable=False), ‘visibility’: String(default=private,nullable=False), ‘template’: BlobFieldType(default=None,nullable=True), ‘owner’: String(default=None,nullable=False), ‘metadata’: Dict(default={},nullable=True), ‘id’: String(default=None,nullable=False), ‘nested_templates’: Dict(default={},nullable=True)}
classmethod get_type_name()[source]
id
metadata
name
nested_templates
owner
status
tags
template
updated_at
version
visibility

glare.objects.image module

class glare.objects.image.Image(context=None, **kwargs)[source]

Bases: glare.objects.base.BaseArtifact

activated_at
architecture
container_format
created_at
description
disk_format
fields = {‘container_format’: String(default=None,nullable=True), ‘min_ram’: Integer(default=None,nullable=True), ‘ramdisk_id’: String(default=None,nullable=True), ‘updated_at’: DateTime(default=None,nullable=False), ‘owner’: String(default=None,nullable=False), ‘id’: String(default=None,nullable=False), ‘os_distro’: String(default=None,nullable=True), ‘disk_format’: String(default=None,nullable=True), ‘os_version’: String(default=None,nullable=True), ‘version’: Version(default=0.0.0,nullable=False), ‘image’: BlobFieldType(default=None,nullable=True), ‘metadata’: Dict(default={},nullable=True), ‘status’: String(default=drafted,nullable=False), ‘description’: String(default=,nullable=True), ‘tags’: List(default=[],nullable=True), ‘kernel_id’: String(default=None,nullable=True), ‘activated_at’: DateTime(default=None,nullable=True), ‘visibility’: String(default=private,nullable=False), ‘min_disk’: Integer(default=None,nullable=True), ‘instance_uuid’: String(default=None,nullable=True), ‘name’: String(default=None,nullable=False), ‘created_at’: DateTime(default=None,nullable=False), ‘architecture’: String(default=None,nullable=True)}
classmethod get_type_name()[source]
id
image
instance_uuid
kernel_id
metadata
min_disk
min_ram
name
os_distro
os_version
owner
ramdisk_id
status
tags
updated_at
version
visibility

glare.objects.murano_package module

class glare.objects.murano_package.MuranoPackage(context=None, **kwargs)[source]

Bases: glare.objects.base.BaseArtifact

activated_at
categories
class_definitions
created_at
dependencies
description
display_name
fields = {‘inherits’: Dict(default={},nullable=True), ‘status’: String(default=drafted,nullable=False), ‘class_definitions’: List(default=[],nullable=True), ‘activated_at’: DateTime(default=None,nullable=True), ‘display_name’: String(default=None,nullable=True), ‘description’: String(default=,nullable=True), ‘package’: BlobFieldType(default=None,nullable=True), ‘created_at’: DateTime(default=None,nullable=False), ‘tags’: List(default=[],nullable=True), ‘updated_at’: DateTime(default=None,nullable=False), ‘visibility’: String(default=private,nullable=False), ‘owner’: String(default=None,nullable=False), ‘dependencies’: List(default=[],nullable=True), ‘version’: Version(default=0.0.0,nullable=False), ‘keywords’: List(default=[],nullable=True), ‘metadata’: Dict(default={},nullable=True), ‘type’: String(default=Application,nullable=True), ‘id’: String(default=None,nullable=False), ‘categories’: List(default=[],nullable=True), ‘name’: String(default=None,nullable=False)}
classmethod get_type_name()[source]
id
inherits
keywords
metadata
name
owner
package
status
tags
type
updated_at
version
visibility

glare.objects.secret module

class glare.objects.secret.Secret(context=None, **kwargs)[source]

Bases: glare.objects.base.BaseArtifact

The purpose this glare artifact, Secret, is to enable the user to store ‘secret’ data such as: Private key, Certificate, Password, SSH keys Etc.

VERSION = ‘1.0’
fields = {‘secret_type’: String(default=opaque,nullable=True), ‘algorithm’: String(default=None,nullable=True), ‘payload_content_encoding’: String(default=base64,nullable=True), ‘mode’: String(default=None,nullable=True), ‘bit_length’: Integer(default=None,nullable=True), ‘payload’: BlobFieldType(default=None,nullable=True)}
classmethod get_type_name()[source]

glare.objects.tosca_template module

class glare.objects.tosca_template.TOSCATemplate(context=None, **kwargs)[source]

Bases: glare.objects.base.BaseArtifact

activated_at
created_at
description
fields = {‘status’: String(default=drafted,nullable=False), ‘description’: String(default=,nullable=True), ‘tags’: List(default=[],nullable=True), ‘created_at’: DateTime(default=None,nullable=False), ‘activated_at’: DateTime(default=None,nullable=True), ‘updated_at’: DateTime(default=None,nullable=False), ‘visibility’: String(default=private,nullable=False), ‘owner’: String(default=None,nullable=False), ‘version’: Version(default=0.0.0,nullable=False), ‘template’: BlobFieldType(default=None,nullable=True), ‘template_format’: String(default=None,nullable=True), ‘metadata’: Dict(default={},nullable=True), ‘id’: String(default=None,nullable=False), ‘name’: String(default=None,nullable=False)}
classmethod get_type_name()[source]
id
metadata
name
owner
status
tags
template
template_format
updated_at
version
visibility

Module contents