ElasticsearchStorageHandler
redbox.storage.elasticsearch.ElasticsearchStorageHandler
ElasticsearchStorageHandler(es_client, root_index)
Bases: BaseStorageHandler
Storage Handler for Elasticsearch
Initialise the storage handler
PARAMETER | DESCRIPTION |
---|---|
es_client | TYPE: |
root_index | TYPE: |
PARAMETER | DESCRIPTION |
---|---|
es_client | Elasticsearch client TYPE: |
root_index | Root index to use. Defaults to "redbox". TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
model_type_map class-attribute
instance-attribute
get_model_by_model_type
get_model_by_model_type(model_type)
PARAMETER | DESCRIPTION |
---|---|
model_type |
|
Source code in redbox-core/redbox/storage/storage_handler.py
17 18 |
|
refresh
refresh(index='*')
PARAMETER | DESCRIPTION |
---|---|
index | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
67 68 |
|
write_item
write_item(item)
PARAMETER | DESCRIPTION |
---|---|
item | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
70 71 72 73 74 75 76 77 |
|
write_items
write_items(items)
PARAMETER | DESCRIPTION |
---|---|
items | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
79 80 |
|
read_item
read_item(item_uuid, model_type)
PARAMETER | DESCRIPTION |
---|---|
item_uuid | TYPE: |
model_type | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
82 83 84 85 86 |
|
read_items
read_items(item_uuids, model_type)
PARAMETER | DESCRIPTION |
---|---|
item_uuids | TYPE: |
model_type | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
88 89 90 91 92 93 |
|
update_item
update_item(item)
PARAMETER | DESCRIPTION |
---|---|
item | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
95 96 97 98 99 100 101 102 |
|
update_items
update_items(items)
PARAMETER | DESCRIPTION |
---|---|
items | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
104 105 |
|
delete_item
delete_item(item)
PARAMETER | DESCRIPTION |
---|---|
item | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
107 108 109 |
|
delete_items
delete_items(items)
PARAMETER | DESCRIPTION |
---|---|
items | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
read_all_items
read_all_items(model_type, user_uuid)
PARAMETER | DESCRIPTION |
---|---|
model_type | TYPE: |
user_uuid | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
|
list_all_items
list_all_items(model_type, user_uuid)
PARAMETER | DESCRIPTION |
---|---|
model_type | TYPE: |
user_uuid | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|
get_file_chunks
get_file_chunks(parent_file_uuid, user_uuid)
get chunks for a given file
PARAMETER | DESCRIPTION |
---|---|
parent_file_uuid | TYPE: |
user_uuid | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
188 189 190 191 192 193 194 195 196 197 198 199 |
|
delete_file_chunks
delete_file_chunks(parent_file_uuid, user_uuid)
delete chunks for a given file
PARAMETER | DESCRIPTION |
---|---|
parent_file_uuid | TYPE: |
user_uuid | TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
201 202 203 204 205 206 207 208 |
|
get_file_status
get_file_status(file_uuid, user_uuid)
Get the status of a file and associated Chunks
PARAMETER | DESCRIPTION |
---|---|
file_uuid | TYPE: |
user_uuid | TYPE: |
PARAMETER | DESCRIPTION |
---|---|
file_uuid | The UUID of the file to get the status of TYPE: |
user_uuid | the UUID of the user TYPE: |
RETURNS | DESCRIPTION |
---|---|
FileStatus | The status of the file TYPE: |
Source code in redbox-core/redbox/storage/elasticsearch.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|