Skip to content

Commit

Permalink
change naming and remove getStorage temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
helamanl0424 authored Mar 28, 2024
1 parent 733b92f commit cd8747c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions samples/sample.krl
Original file line number Diff line number Diff line change
Expand Up @@ -28,47 +28,47 @@ ruleset sample_app {

rule store_file {
select when sample_app store_file
pods:store(event:attrs.get("fetchFileURL"), pods:getStorage + event:attrs.get("storeLocation"))
pods:store(event:attrs.get("fetchFileURL"), event:attrs.get("storeLocation"))
}

rule test_overwrite_file_with_name {
select when test overwrite_file
rule overwrite_file_with_name {
select when sample_app overwrite_file
if (event:attrs.get("fileName")) then
pods:overwrite(event:attrs.get("originURL"), pods:getStorage + event:attrs.get("destinationURL"), event:attrs.get("fileName"))
pods:overwrite(event:attrs.get("originURL"), event:attrs.get("destinationURL"), event:attrs.get("fileName"))
}

rule test_overwrite_file_no_name {
select when test overwrite_file
rule overwrite_file_no_name {
select when sample_app overwrite_file
if (not event:attrs.get("fileName")) then
pods:overwrite(event:attrs.get("originURL"), pods:getStorage + event:attrs.get("destinationURL"))
pods:overwrite(event:attrs.get("originURL"), event:attrs.get("destinationURL"))
}

rule remove_file {
select when sample_app remove_file
pods:removeFile(pods:getStorage + event:attrs.get("fileURL"))
pods:removeFile(event:attrs.get("fileURL"))
}

rule copy_file {
select when sample_app copy_file
pods:copyFile(pods:getStorage + event:attrs.get("fetchFileURL"),
pods:copyFile(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"))
dataURL = pods:fetch(event:attrs.get("fileURL"))
}
send_directive(dataURL)
}

rule create_folder {
select when sample_app create_folder
pods:createFolder(pods:getStorage + event:attrs.get("containerURL"))
pods:createFolder(event:attrs.get("containerURL"))
}
rule remove_folder {
select when sample_app remove_folder
pods:removeFolder(pods:getStorage + event:attrs.get("containerURL"))
pods:removeFolder(event:attrs.get("containerURL"))
}

rule grant_agent_access {
Expand All @@ -93,7 +93,7 @@ ruleset sample_app {
rule ls {
select when sample_app ls
pre {
list = pods:listItems(pods:getStorage + event:attrs.get("fileURL"))
list = pods:listItems(event:attrs.get("fileURL"))
}
send_directive(list)
}
Expand Down

0 comments on commit cd8747c

Please sign in to comment.