Google Cloud Storage support
We introduce a new node_type, storage, which can support different file storage backends and makes them available for browsing via dedicated entry points in the application. We intend to keep pillar storage agnostic and support both internal/local storages as well as remote/hosted solutions.
This commit is contained in:
@@ -636,6 +636,40 @@ def populate_node_types(old_ids={}):
|
||||
}
|
||||
}
|
||||
|
||||
node_type_storage = {
|
||||
'name': 'storage',
|
||||
'description': 'Entrypoint to a remote or local storage solution',
|
||||
'dyn_schema': {
|
||||
# The project ID, use for lookups in the storage backend. For example
|
||||
# when using Google Cloud Storage, the project id will be the name
|
||||
# of the bucket.
|
||||
'project': {
|
||||
'type': 'objectid',
|
||||
'data_relation': {
|
||||
'resource': 'nodes',
|
||||
'field': '_id'
|
||||
},
|
||||
},
|
||||
# The entry point in a subdirectory of the main storage for the project
|
||||
'subdir': {
|
||||
'type': 'string',
|
||||
},
|
||||
# Which backend is used to store the files (gcs, pillar, bam, cdnsun)
|
||||
'backend': {
|
||||
'type': 'string',
|
||||
},
|
||||
|
||||
},
|
||||
'form_schema': {
|
||||
'subdir': {},
|
||||
'project': {},
|
||||
'backend': {}
|
||||
},
|
||||
'parent': {
|
||||
"node_types": ["group", "project"]
|
||||
}
|
||||
}
|
||||
|
||||
from pymongo import MongoClient
|
||||
|
||||
client = MongoClient(MONGO_HOST, 27017)
|
||||
@@ -671,6 +705,7 @@ def populate_node_types(old_ids={}):
|
||||
# upgrade(comment_node_type, old_ids)
|
||||
upgrade(project_node_type, old_ids)
|
||||
upgrade(asset_node_type, old_ids)
|
||||
upgrade(node_type_storage, old_ids)
|
||||
|
||||
|
||||
@manager.command
|
||||
|
Reference in New Issue
Block a user