glare.objects package¶
Subpackages¶
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]¶ Create new artifact in Glare repo.
Parameters: context – user context Returns: created artifact object
-
created_at
¶
-
classmethod
delete
(context, af)[source]¶ Delete artifact and all its blobs from Glare.
Parameters: - context – user context
- af – artifact object targeted for deletion
-
description
¶
-
display_type_name
¶
-
fields
= {'activated_at': DateTime(default=None,nullable=True), 'created_at': DateTime(default=None,nullable=False), 'description': String(default=,nullable=True), 'display_type_name': String(default=None,nullable=True), 'id': String(default=None,nullable=False), 'metadata': Dict(default={},nullable=True), 'name': String(default=None,nullable=False), 'owner': String(default=None,nullable=False), 'status': String(default=drafted,nullable=False), 'tags': List(default=[],nullable=True), 'type_name': String(default=None,nullable=True), 'updated_at': DateTime(default=None,nullable=False), 'version': Version(default=0.0.0,nullable=False), 'visibility': String(default=private,nullable=False)}¶
-
classmethod
get_display_type_name
()[source]¶ Provides verbose Artifact type name which any external user can understand easily.
Returns: general purpose name for Artifact
-
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
-
id
¶
-
metadata
¶
-
name
¶
-
owner
¶
-
save
(context)[source]¶ Save artifact in Glare repo.
Parameters: context – user context Returns: updated artifact object
-
status
¶
-
to_dict
()[source]¶ Convert oslo versioned object to dictionary.
Returns: dict with field names and field values
-
type_name
¶
-
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
-
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.
-
classmethod
Blob
(*args, **kwargs)¶ Fabric to build fields.
-
DEFAULT_ARTIFACT_VERSION
= '0.0.0'¶
-
DEFAULT_QUERY_COMBINER
= 'and'¶
-
classmethod
DictField
(*args, **kwargs)¶ Fabric to build fields.
-
classmethod
Field
(*args, **kwargs)¶ Fabric to build fields.
-
classmethod
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>, <oslo_config.cfg.IntOpt object>, <oslo_config.cfg.BoolOpt object>, <oslo_config.cfg.StrOpt object>]¶
-
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>¶
-
classmethod
delete
(context, af)[source]¶ Delete artifact and all its blobs from Glare.
Parameters: - context – user context
- af – artifact object targeted for deletion
-
fields
= {'activated_at': DateTime(default=None,nullable=True), 'created_at': DateTime(default=None,nullable=False), 'description': String(default=,nullable=True), 'display_type_name': String(default=None,nullable=True), 'id': String(default=None,nullable=False), 'metadata': Dict(default={},nullable=True), 'name': String(default=None,nullable=False), 'owner': String(default=None,nullable=False), 'status': String(default=drafted,nullable=False), 'tags': List(default=[],nullable=True), 'updated_at': DateTime(default=None,nullable=False), 'version': Version(default=0.0.0,nullable=False), 'visibility': String(default=private,nullable=False)}¶
-
classmethod
format_all
(values)[source]¶ Specify output format for ‘all’ artifact meta-type
Parameters: values – dict with values that need to be formatted
-
classmethod
get_display_type_name
()[source]¶ Provides verbose Artifact type name which any external user can understand easily.
Returns: general purpose name for Artifact
-
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, list_all_artifacts=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 :param list_all_artifacts: flag that indicate, if the list should return artifact from all tenants (True), or from the specific tenant (False) :return: list of artifact objects
-
save
(context)[source]¶ Save artifact in Glare repo.
Parameters: context – user context Returns: updated artifact object
-
classmethod
show
(context, artifact_id, get_any_artifact=False)[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
-
classmethod
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
¶
-
display_type_name
¶
-
environment
¶
-
fields
= {'activated_at': DateTime(default=None,nullable=True), 'created_at': DateTime(default=None,nullable=False), 'description': String(default=,nullable=True), 'display_type_name': String(default=None,nullable=True), 'environment': BlobFieldType(default=None,nullable=True), 'id': String(default=None,nullable=False), 'metadata': Dict(default={},nullable=True), 'name': String(default=None,nullable=False), 'owner': String(default=None,nullable=False), 'status': String(default=drafted,nullable=False), 'tags': List(default=[],nullable=True), 'updated_at': DateTime(default=None,nullable=False), 'version': Version(default=0.0.0,nullable=False), 'visibility': String(default=private,nullable=False)}¶
-
classmethod
get_display_type_name
()[source]¶ Provides verbose Artifact type name which any external user can understand easily.
Returns: general purpose name for Artifact
-
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
-
id
¶
-
metadata
¶
-
name
¶
-
owner
¶
-
status
¶
-
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
¶
-
display_type_name
¶
-
environments
¶
-
fields
= {'activated_at': DateTime(default=None,nullable=True), 'created_at': DateTime(default=None,nullable=False), 'default_envs': Dict(default={},nullable=True), 'description': String(default=,nullable=True), 'display_type_name': String(default=None,nullable=True), 'environments': Dict(default={},nullable=True), 'id': String(default=None,nullable=False), 'metadata': Dict(default={},nullable=True), 'name': String(default=None,nullable=False), 'nested_templates': Dict(default={},nullable=True), 'owner': String(default=None,nullable=False), 'status': String(default=drafted,nullable=False), 'tags': List(default=[],nullable=True), 'template': BlobFieldType(default=None,nullable=True), 'updated_at': DateTime(default=None,nullable=False), 'version': Version(default=0.0.0,nullable=False), 'visibility': String(default=private,nullable=False)}¶
-
classmethod
get_display_type_name
()[source]¶ Provides verbose Artifact type name which any external user can understand easily.
Returns: general purpose name for Artifact
-
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
-
id
¶
-
metadata
¶
-
name
¶
-
nested_templates
¶
-
owner
¶
-
status
¶
-
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
¶
-
display_type_name
¶
-
fields
= {'activated_at': DateTime(default=None,nullable=True), 'architecture': String(default=None,nullable=True), 'container_format': String(default=None,nullable=True), 'created_at': DateTime(default=None,nullable=False), 'description': String(default=,nullable=True), 'disk_format': String(default=None,nullable=True), 'display_type_name': String(default=None,nullable=True), 'id': String(default=None,nullable=False), 'image': BlobFieldType(default=None,nullable=True), 'instance_uuid': String(default=None,nullable=True), 'kernel_id': String(default=None,nullable=True), 'metadata': Dict(default={},nullable=True), 'min_disk': Integer(default=None,nullable=True), 'min_ram': Integer(default=None,nullable=True), 'name': String(default=None,nullable=False), 'os_distro': String(default=None,nullable=True), 'os_version': String(default=None,nullable=True), 'owner': String(default=None,nullable=False), 'ramdisk_id': String(default=None,nullable=True), 'status': String(default=drafted,nullable=False), 'tags': List(default=[],nullable=True), 'updated_at': DateTime(default=None,nullable=False), 'version': Version(default=0.0.0,nullable=False), 'visibility': String(default=private,nullable=False)}¶
-
classmethod
get_display_type_name
()[source]¶ Provides verbose Artifact type name which any external user can understand easily.
Returns: general purpose name for Artifact
-
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
-
id
¶
-
image
¶
-
instance_uuid
¶
-
kernel_id
¶
-
metadata
¶
-
min_disk
¶
-
min_ram
¶
-
name
¶
-
os_distro
¶
-
os_version
¶
-
owner
¶
-
ramdisk_id
¶
-
status
¶
-
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
¶
-
display_type_name
¶
-
fields
= {'activated_at': DateTime(default=None,nullable=True), 'categories': List(default=[],nullable=True), 'class_definitions': List(default=[],nullable=True), 'created_at': DateTime(default=None,nullable=False), 'dependencies': List(default=[],nullable=True), 'description': String(default=,nullable=True), 'display_name': String(default=None,nullable=True), 'display_type_name': String(default=None,nullable=True), 'id': String(default=None,nullable=False), 'inherits': Dict(default={},nullable=True), 'keywords': List(default=[],nullable=True), 'metadata': Dict(default={},nullable=True), 'name': String(default=None,nullable=False), 'owner': String(default=None,nullable=False), 'package': BlobFieldType(default=None,nullable=True), 'status': String(default=drafted,nullable=False), 'tags': List(default=[],nullable=True), 'type': String(default=Application,nullable=True), 'updated_at': DateTime(default=None,nullable=False), 'version': Version(default=0.0.0,nullable=False), 'visibility': String(default=private,nullable=False)}¶
-
classmethod
get_display_type_name
()[source]¶ Provides verbose Artifact type name which any external user can understand easily.
Returns: general purpose name for Artifact
-
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
-
id
¶
-
inherits
¶
-
keywords
¶
-
metadata
¶
-
name
¶
-
owner
¶
-
package
¶
-
status
¶
-
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
= {'algorithm': String(default=None,nullable=True), 'bit_length': Integer(default=None,nullable=True), 'mode': String(default=None,nullable=True), 'payload': BlobFieldType(default=None,nullable=True), 'payload_content_encoding': String(default=base64,nullable=True), 'secret_type': String(default=opaque,nullable=True)}¶
-
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
¶
-
display_type_name
¶
-
fields
= {'activated_at': DateTime(default=None,nullable=True), 'created_at': DateTime(default=None,nullable=False), 'description': String(default=,nullable=True), 'display_type_name': String(default=None,nullable=True), 'id': String(default=None,nullable=False), 'metadata': Dict(default={},nullable=True), 'name': String(default=None,nullable=False), 'owner': String(default=None,nullable=False), 'status': String(default=drafted,nullable=False), 'tags': List(default=[],nullable=True), 'template': BlobFieldType(default=None,nullable=True), 'template_format': String(default=None,nullable=True), 'updated_at': DateTime(default=None,nullable=False), 'version': Version(default=0.0.0,nullable=False), 'visibility': String(default=private,nullable=False)}¶
-
classmethod
get_display_type_name
()[source]¶ Provides verbose Artifact type name which any external user can understand easily.
Returns: general purpose name for Artifact
-
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
-
id
¶
-
metadata
¶
-
name
¶
-
owner
¶
-
status
¶
-
template
¶
-
template_format
¶
-
updated_at
¶
-
version
¶
-
visibility
¶
-