-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5117da1
commit 9ddfdf7
Showing
1 changed file
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
ruleset sample_app { | ||
meta { | ||
|
||
} | ||
global { | ||
|
||
} | ||
|
||
rule attach_storage { | ||
select when sample_app attach_storage | ||
storage_url re#(.+)# | ||
client_id re#(.+)# | ||
client_secret re#(.+)# | ||
token_url re#(.+)# | ||
setting(storage, id, secret, token) | ||
|
||
pods:connectStorage(storage, id, secret, token) | ||
} | ||
|
||
rule detatch_storage { | ||
select when sample_app detach_storage | ||
pods:disconnectStorage() | ||
} | ||
rule authenticate_storage { | ||
select when sample_app authenticate_storage | ||
pods:authenticate() | ||
} | ||
|
||
rule store_file { | ||
select when sample_app store_file | ||
pods:store(pods:getStorage + event:attrs.get("fetchFileURL"), event:attrs.get("storeLocation")) | ||
} | ||
rule overwrite_file { | ||
select when sample_app overwrite_file | ||
pods:overwrite(pods:getStorage + event:attrs.get("fetchFileURL"), event:attrs.get("storeLocation")) | ||
} | ||
rule remove_file { | ||
select when sample_app remove_file | ||
pods:removeFile(pods:getStorage + event:attrs.get("fileURL")) | ||
} | ||
|
||
rule copy_file { | ||
select when sample_app copy_file | ||
pods:copyFile(pods:getStorage + event:attrs.get("fetchFileURL"), | ||
event:attrs.get("storeLocation")) | ||
} | ||
|
||
rule fetch_file { | ||
select when sample_app fetch_file | ||
pre { | ||
dataURL = pods:fetch(pods:getStorage + event:attrs.get("fileURL")) | ||
} | ||
send_directive(dataURL) | ||
} | ||
|
||
rule create_folder { | ||
select when sample_app create_folder | ||
pods:createFolder(pods:getStorage + event:attrs.get("containerURL")) | ||
} | ||
rule remove_folder { | ||
select when sample_app remove_folder | ||
pods:removeFolder(pods:getStorage + event:attrs.get("containerURL")) | ||
} | ||
|
||
rule grant_agent_access { | ||
select when sample_app grant_agent_access | ||
pods:grantAgentAccess(event:attrs.get("resourceURL"), event:attrs.get("webID")) | ||
} | ||
|
||
rule remove_agent_access { | ||
select when sample_app remove_agent_access | ||
pods:removeAgentAccess(event:attrs.get("resourceURL"), event:attrs.get("webID")) | ||
} | ||
|
||
rule grant_access { | ||
select when sample_app grant_access | ||
pods:grantAccess(event:attrs.get("resourceURL")) | ||
} | ||
rule remove_access { | ||
select when sample_app remove_access | ||
pods:removeAccess(event:attrs.get("resourceURL")) | ||
} | ||
|
||
rule ls { | ||
select when sample_app ls | ||
pre { | ||
list = pods:listItems(pods:getStorage + event:attrs.get("directoryURL")) | ||
} | ||
send_directive(list) | ||
} | ||
|
||
rule find { | ||
select when sample_app find | ||
pods:findFile(event:attrs.get("fileName")) | ||
} | ||
} |