diff --git a/source/agent-remote/datacommands_v2.sh b/source/agent-remote/datacommands_v2.sh index 9b68287..271090e 100644 --- a/source/agent-remote/datacommands_v2.sh +++ b/source/agent-remote/datacommands_v2.sh @@ -319,6 +319,62 @@ restore_volume() { # MAIN BACKUP/RESTORE ORCHESTRATION # ============================================================================ +# Process multiple items for creation +# Usage: create_items type1:label1:location1 type2:label2:location2 ... +create_items() { + echo "Starting create operations" + + # Process each item + for item in "$@"; do + IFS=':' read -r type label location <<< "$item" + + case "$type" in + file) + create_file "$label" "$location" + ;; + path) + create_path "$label" "$location" + ;; + volume) + create_volume "$label" "$location" + ;; + *) + echo "Unknown type: $type (must be file, path, or volume)" + ;; + esac + done + + echo "Create operations completed" +} + +# Process multiple items for destruction +# Usage: destroy_items type1:label1:location1 type2:label2:location2 ... +destroy_items() { + echo "Starting destroy operations" + + # Process each item + for item in "$@"; do + IFS=':' read -r type label location <<< "$item" + + case "$type" in + file) + destroy_file "$label" "$location" + ;; + path) + destroy_path "$label" "$location" + ;; + volume) + destroy_volume "$label" "$location" + ;; + *) + echo "Unknown type: $type (must be file, path, or volume)" + ;; + esac + done + + echo "Destroy operations completed" +} + # Process multiple items for backup # Usage: backup_items type1:label1:location1 type2:label2:location2 ... backup_items() {