glare.objects.meta package¶
Submodules¶
glare.objects.meta.fields module¶
-
class
glare.objects.meta.fields.
BlobField
(**kwargs)[source]¶ Bases:
oslo_versionedobjects.fields.AutoTypedField
-
AUTO_TYPE
= <glare.objects.meta.fields.BlobFieldType object at 0x4681150>¶
-
-
class
glare.objects.meta.fields.
BlobFieldType
[source]¶ Bases:
oslo_versionedobjects.fields.FieldType
Blob field contains reference to blob location.
-
ACTIVE
= ‘active’¶
-
BLOB_SCHEMA
= {‘required’: [‘url’, ‘size’, ‘md5’, ‘sha1’, ‘sha256’, ‘external’, ‘status’, ‘id’, ‘content_type’], ‘type’: ‘object’, ‘properties’: {‘status’: {‘enum’: [‘saving’, ‘active’], ‘type’: ‘string’}, ‘sha256’: {‘type’: [‘string’, ‘null’]}, ‘sha1’: {‘type’: [‘string’, ‘null’]}, ‘external’: {‘type’: ‘boolean’}, ‘content_type’: {‘type’: [‘string’, ‘null’]}, ‘url’: {‘maxLength’: 2048, ‘type’: [‘string’, ‘null’], ‘format’: ‘uri’}, ‘md5’: {‘type’: [‘string’, ‘null’]}, ‘id’: {‘type’: ‘string’}, ‘size’: {‘type’: [‘number’, ‘null’]}}}¶
-
BLOB_STATUS
= (‘saving’, ‘active’)¶
-
SAVING
= ‘saving’¶
-
-
class
glare.objects.meta.fields.
Dict
(element_type, **kwargs)[source]¶ Bases:
oslo_versionedobjects.fields.AutoTypedField
-
class
glare.objects.meta.fields.
Link
(**kwargs)[source]¶ Bases:
oslo_versionedobjects.fields.AutoTypedField
-
AUTO_TYPE
= <glare.objects.meta.fields.LinkFieldType object at 0x4681390>¶
-
-
class
glare.objects.meta.fields.
LinkFieldType
[source]¶ Bases:
oslo_versionedobjects.fields.FieldType
Link field specifies Artifact dependency on other artifact or some external resource. From technical perspective it is just soft link to Glare Artifact or https/http resource. So Artifact users can download the referenced file by that link.
-
class
glare.objects.meta.fields.
List
(element_type, **kwargs)[source]¶ Bases:
oslo_versionedobjects.fields.AutoTypedField
glare.objects.meta.file_utils module¶
Contains additional file utils that may be useful for upload hooks.
-
glare.objects.meta.file_utils.
create_temporary_file
(stream, suffix=”)[source]¶ Create a temporary local file from a stream.
Parameters: - stream – stream of bytes to be stored in a temporary file
- suffix – (optional) file name suffix
-
glare.objects.meta.file_utils.
extract_zip_to_temporary_folder
(tfile)[source]¶ Create temporary folder and extract all file contents there.
Parameters: tfile – zip archive to be extracted
-
glare.objects.meta.file_utils.
unpack_zip_archive_to_artifact_folder
(context, af, zip_ref, folder_name)[source]¶ Unpack zip archive to artifact folder.
Parameters: - context – user context
- af – artifact object
- zip_ref – zip archive to be extracted
- folder_name – name of the artifact folder where to extract data
-
glare.objects.meta.file_utils.
upload_content_file
(context, af, data, blob_dict, key_name, content_type=’application/octet-stream’)[source]¶ Upload a file to a blob dictionary.
Parameters: - context – user context
- af – artifact object
- data – bytes that need to be stored in the blob dictionary
- blob_dict – name of the blob_dictionary field
- key_name – name of key in the dictionary
- content_type – (optional) specifies mime type of uploading data
glare.objects.meta.registry module¶
-
class
glare.objects.meta.registry.
ArtifactRegistry
[source]¶ Bases:
oslo_versionedobjects.base.VersionedObjectRegistry
Artifact Registry is responsible for registration of artifacts and returning appropriate artifact types based on artifact type name.
glare.objects.meta.validators module¶
glare.objects.meta.wrappers module¶
This file contains classes that wrap nat
-
glare.objects.meta.wrappers.
BlobDictAttribute
¶ alias of
FolderField
-
glare.objects.meta.wrappers.
CompoundAttribute
¶ alias of
CompoundField
-
class
glare.objects.meta.wrappers.
CompoundField
(field_class, element_type, element_validators=None, **kwargs)[source]¶
-
class
glare.objects.meta.wrappers.
Field
(field_class, mutable=False, required_on_activate=True, system=False, validators=None, nullable=True, default=None, sortable=False, filter_ops=None, description=”)[source]¶ Bases:
object
-
class
glare.objects.meta.wrappers.
FolderField
(max_blob_size=10485760, max_folder_size=2673868800, **kwargs)[source]¶