Storage Methods
The following methods existing in the Agent Storage module:
-
Storage.Check — Tests the existence of a user defined persistent storage table.
-
Storage.Delete — Removes an existing user defined persistent storage table.
-
Storage.Get — Indicate whether a user defined persistent storage table of the specified name is present and return its contents if present.
-
Storage.GetRemote — Retrieve the requested datum directly from the Platform central repository.
-
Storage.List — Enumerates all user-defined persistent storage tables.
-
Storage.Set — Set or change the value of the named persistent storage table.
Each method requires the user defined persistent storage name to be specified.
Examples
Example use of User-defined Persistent Storage
@query = NativeServices.RunWmiQuery(Namespace:"root\\cimv2", Query:"Select Caption, WorkingSetSize from win32_Process"); @workingsetsize = SELECT * FROM @query ORDER BY WorkingSetSize DESC LIMIT 10; @storage = SELECT "WorkingSetSize.Top10" AS Storage; //@found = Storage.Delete(Name: @storage); @found = Storage.Get(Name: @storage); IF (@found) @result = SELECT "SUCCESS: " || Storage || " already exists and has been re-written." AS Result FROM @storage; ELSE @result = SELECT "SUCCESS: " || Storage || " does not exist and has been created." AS Result FROM @storage; ENDIF; // replace contents of table Storage.Set(Name: @storage, Value:@workingsetsize); @found = Storage.Get(Name: @storage); IF NOT (@found) @result = SELECT "ERROR: Failed to write to " || Storage || "." AS Result FROM @storage; ENDIF; // return the result of checking and writing table SELECT * FROM @result;