9. cloudmesh-storage¶
-
class
cloudmesh.storage.spec.tests.test_openapi_storage.
Test_cloud_storage
[source]¶ see: https://github.com/cloudmesh/cloudmesh-common/blob/master/cloudmesh/common/run/background.py the code in thel link has not bean tested make this s function execute the server in the back ground not in a terminal, get the pid and kill it after the test is done UNAME := $(shell uname) ifeq ($(UNAME), Darwin) define terminal
osascript -e ‘tell application “Terminal” to do script “cd $(PWD); $1”’endef endif ifeq ($(UNAME), Linux) define terminal
gnome-terminal –command ‘bash -c “cd $(PWD); $1”’endef endif
-
class
cloudmesh.storage.provider.local.Provider.
Provider
(service=None, config='~/.cloudmesh/cloudmesh4.yaml')[source]¶ - cloudmesh:
- a:
- cm:
- active: False heading: Local A host: localhost label: local_a kind: local version: 1.0
- default:
- directory: .
- credentials:
- directory: ~/.cloudmesh/storage/a
default location is credentials.directory / default.directory
-
create_dir
(directory=None)[source]¶ creates a directory
Parameters: directory – the name of the directory Returns: dict
-
create_dir_from_filename
(filename=None)[source]¶ creates a directory
Parameters: directory – the name of the directory for the filename Returns: dict
-
delete
(source=None, recusrive=False)[source]¶ deletes the source
Parameters: - source – the source which either can be a directory or file
- recursive – in case of directory the recursive referes to all subdirectories in the specified source
Returns: dict
-
get
(source=None, destination=None, recusrive=False)[source]¶ gets the source and copies it in destination
Parameters: - source – the source which either can be a directory or file
- destination – the destination which either can be a directory or file
- recursive – in case of directory the recursive referes to all subdirectories in the specified source
Returns: dict
-
put
(source=None, destination=None, recusrive=False)[source]¶ puts the source on the service
Parameters: - source – the source which either can be a directory or file
- destination – the destination which either can be a directory or file
- recursive – in case of directory the recursive referes to all subdirectories in the specified source
Returns: dict
-
search
(directory=None, filename=None, recursive=False)[source]¶ gets the destination and copies it in source
Parameters: - service – the name of the service in the yaml file
- directory – the directory which either can be a directory or file
- recursive – in case of directory the recursive referes to all subdirectories in the specified source
Returns: dict
-
cloudmesh.storage.provider.local.Provider.
creation_date
(path_to_file)[source]¶ Try to get the date that a file was created, falling back to when it was last modified if that isn’t possible. See http://stackoverflow.com/a/39501288/1709587 for explanation.