Storm Types

Storm Objects are used as view objects for manipulating data in the Storm Runtime and in the Cortex itself.

bool

Implements the Storm API for a List instance.

bytes

Implements the Storm API for a Bytes object.

bunzip()

Decompress the bytes using bzip2.

Example:

Decompress bytes with bzip2:

$foo = $mybytez.bunzip()
Returns:
Decompressed bytes. The return type is bytes.

bzip()

Compress the bytes using bzip2 and return them.

Example:

Compress bytes with bzip:

$foo = $mybytez.bzip()
Returns:
The bzip2 compressed bytes. The return type is bytes.

decode(encoding=utf8)

Decode bytes to a string.

Args:
encoding (str): The encoding to use.
Returns:
The decoded string. The return type is str.

gunzip()

Decompress the bytes using gzip and return them.

Example:

Decompress bytes with bzip2:

$foo = $mybytez.gunzip()
Returns:
Decompressed bytes. The return type is bytes.

gzip()

Compress the bytes using gzip and return them.

Example:
Compress bytes with gzip::
$foo = $mybytez.gzip()
Returns:
The gzip compressed bytes. The return type is bytes.

json()

Load JSON data from bytes.

Notes:
The bytes must be UTF8, UTF16 or UTF32 encoded.
Example:
Load bytes to a object::
$foo = $mybytez.json()
Returns:
The deserialized object. The return type is prim.

storm:cmdopts

A dictionary like object that holds a reference to a command options namespace. ( This allows late-evaluation of command arguments rather than forcing capture )

storm:cronjob

Implements the Storm api for a cronjob instance.

iden

The iden of the Cron Job.

Returns:
The type is str.

pack()

Get the Cronjob definition.

Returns:
The definition. The return type is dict.

pprint()

Get a dictionary containing user friendly strings for printing the CronJob.

Returns:
A dictionary containing structured data about a cronjob for display purposes. The return type is dict.

set(name, valu)

Set an editable field in the cron job definition.

Example:

Change the name of a cron job:

$lib.cron.get($iden).set(name, "foo bar cron job")
Args:

name (str): The name of the field being set

valu (any): The value to set on the definition.

Returns:
The storm:cronjob The return type is storm:cronjob.

dict

Implements the Storm API for a Dictionary object.

storm:auth:gate

Implements the Storm API for an AuthGate.

iden

The iden of the AuthGate.

Returns:
The type is str.

roles

The role idens which are a member of the Authgate.

Returns:
The type is list.

users

The user idens which are a member of the Authgate.

Returns:
The type is list.

storm:http:resp

Implements the Storm API for a HTTP response.

body

The raw HTTP response body as bytes.

Returns:
The type is bytes.

code

The HTTP status code.

Returns:
The type is int.

headers

The HTTP Response headers.

Returns:
The type is dict.

json()

Get the JSON deserialized response.

Returns:
The return type is prim.

storm:layer

Implements the Storm api for a layer instance.

addPull(url, offs=0)

Configure the layer to pull edits from a remote layer/feed.

Args:

url (str): The telepath URL to a layer/feed.

offs (int): The offset to begin from.

Returns:
Dictionary containing the pull definition. The return type is dict.

addPush(url, offs=0)

Configure the layer to push edits to a remote layer/feed.

Args:

url (str): A telepath URL of the target layer/feed.

offs (int): The local layer offset to begin pushing from

Returns:
Dictionary containing the push definition. The return type is dict.

delPull(iden)

Remove a pull config from the layer.

Args:
iden (str): The iden of the push config to remove.
Returns:
The return type is null.

delPush(iden)

Remove a push config from the layer.

Args:
iden (str): The iden of the push config to remove.
Returns:
The return type is null.

edits(offs=0, wait=True, size=None)

Yield (offs, nodeedits) tuples from the given offset.

Args:

offs (int): Offset to start getting nodeedits from the layer at.

wait (boolean): If true, wait for new edits, otherwise exit the generator when there are no more edits.

size (int): The maximum number of nodeedits to yield.

Yields:
Yields offset, nodeedit tuples from a given offset. The return type is list.

get(name, defv=None)

Get a arbitrary value in the Layer definition.

Args:

name (str): Name of the value to get.

defv (prim): The default value returned if the name is not set in the Layer.

Returns:
The value requested or the default value. The return type is prim.

getFormCounts()

Get the formcounts for the Layer.

Example:

Get the formcounts for the current :ayer:

$counts = $lib.layer.get().getFormCounts()
Returns:
Dictionary containing form names and the count of the nodes in the Layer. The return type is dict.

getPropCount(propname, maxsize=None)

Get the number of property rows in the layer for the given full form or property name.

Args:

propname (str): The property or form name to look up.

maxsize (int): The maximum number of rows to look up.

Returns:
The count of rows. The return type is int.

getStorNodes()

Get buid, sode tuples representing the data stored in the layer.

Notes:
The storage nodes represent only the data stored in the layer and may not represent whole nodes.
Yields:
Tuple of buid, sode values. The return type is list.

getTagCount(tagname, formname=None)

Return the number of tag rows in the layer for the given tag and optional form.

Examples:

Get the number of inet:ipv4 nodes with the $foo.bar tag:

$count = $lib.layer.get().getTagCount(foo.bar, formname=inet:ipv4)
Args:

tagname (str): The name of the tag to look up.

formname (str): The form to constrain the look up by.

Returns:
The count of tag rows. The return type is int.

iden

The iden of the Layer.

Returns:
The type is str.

pack()

Get the Layer definition.

Returns:
Dictionary containing the Layer definition. The return type is dict.

repr()

Get a string representation of the Layer.

Returns:
A string that can be printed, representing a Layer. The return type is str.

set(name, valu)

Set a arbitrary value in the Layer definition.

Args:

name (str): The name to set.

valu (any): The value to set.

Returns:
The return type is null.

list

Implements the Storm API for a List instance.

append(valu)

Append a value to the list.

Args:
valu (any): The item to append to the list.
Returns:
The return type is null.

has(valu)

Check it a value is in the list.

Args:
valu (any): The value to check.
Returns:
True if the item is in the list, false otherwise. The return type is boolean.

index(valu)

Return a single field from the list by index.

Args:
valu (int): The list index value.
Returns:
The item present in the list at the index position. The return type is any.

length()

Get the length of the list. This is deprecated; please use .size() instead.

Returns:
The size of the list. The return type is integer.

pop()

Pop and return the last entry in the list.

Returns:
The last item from the list. The return type is any.

size()

Return the length of the list.

Returns:
The size of the list. The return type is size.

storm:model:form

Implements the Storm API for a Form.

name

The name of the Form

Returns:
The type is str.

prop(name)

Get a Property on the Form

Args:
name (str): The property to retrieve.
Returns:
The storm:model:prop instance if the property if present on the form or null. The return type may be one of the following: storm:model:prop, null.

storm:model:property

Implements the Storm API for a Property.

full

The full name of the Property.

Returns:
The type is str.

name

The short name of the Property.

Returns:
The type is str.

storm:model:tagprop

Implements the Storm API for a Tag Property.

name

The name of the Tag Property.

Returns:
The type is str.

storm:model:type

A Storm types wrapper around a lib.types.Type

name

The name of the Type.

Returns:
The type is str.

norm(valu)

Get the norm and info for the Type.

Args:
valu (any): The value to norm.
Returns:
A tuple of the normed value and its information dictionary. The return type is list.

repr(valu)

Get the repr of a value for the Type.

Args:
valu (any): The value to get the repr of.
Returns:
The string form of the value as represented by the type. The return type is str.

stortype

The storetype of the Type.

Returns:
The type is int.

storm:node

Implements the Storm api for a node instance.

edges(verb=None)

Yields the (verb, iden) tuples for this nodes edges.

Args:
verb (str): If provided, only return edges with this verb.
Yields:
A tuple of (verb, iden) values for this nodes edges. The return type is list.

form()

Get the form of the Node.

Returns:
The form of the Node. The return type is str.

getByLayer()

Return a dict you can use to lookup which props/tags came from which layers.

Returns:
property / tag lookup dictionary. The return type is dict.

getStorNodes()

Return a list of “storage nodes” which were fused from the layers to make this node.

Returns:
List of storage node objects. The return type is list.

globtags(glob)

Get a list of the tag components from a Node which match a tag glob expression.

Args:
glob (str): The glob expression to match.
Returns:
The components of tags which match the wildcard component of a glob expression. The return type is list.

iden()

Get the iden of the Node.

Returns:
The nodes iden. The return type is str.

isform(name)

Check if a Node is a given form.

Args:
name (str): The form to compare the Node against.
Returns:
True if the form matches, false otherwise. The return type is boolean.

ndef()

Get the form and primary property of the Node.

Returns:
A tuple of the form and primary property. The return type is list.

pack(dorepr=False)

Return the serializable/packed version of the Node.

Args:
dorepr (boolean): Include repr information for human readable versions of properties.
Returns:
A tuple containing the ndef and property bag of the node. The return type is list.

repr(name=None, defv=None)

Get the repr for the primary property or secondary property of a Node.

Args:

name (str): The name of the secondary property to get the repr for.

defv (str): The default value to return if the secondary property does not exist

Returns:
The string representation of the requested value. The return type is str.

tags(glob=None)

Get a list of the tags on the Node.

Args:
glob (str): A tag glob expression. If this is provided, only tags which match the expression are returned.
Returns:
A list of tags on the node. If a glob match is provided, only matching tags are returned. The return type is list.

value()

Get the value of the primary property of the Node.

Returns:
The primary property. The return type is prim.

storm:node:data

A Storm Primitive representing the NodeData stored for a Node.

get(name)

Get the Node data for a given name for the Node.

Args:
name (str): Name of the data to get.
Returns:
The stored node data. The return type is prim.

list()

Get a list of the Node data names on the Node.

Returns:
List of the names of values stored on the node. The return type is list.

load(name)

Load the Node data onto the Node so that the Node data is packed and returned by the runtime.

Args:
name (str): The name of the data to load.
Returns:
The return type is null.

pop(name)

Pop (remove) a the Node data from the Node.

Args:
name (str): The name of the data to remove from the node.
Returns:
The data removed. The return type is prim.

set(name, valu)

Set the Node data for a given name on the Node.

Args:

name (str): The name of the data.

valu (prim): The data to store.

Returns:
The return type is null.

storm:node:props

A Storm Primitive representing the properties on a Node.

get(name)

Get a specific property value by name.

Args:
name (str): The name of the property to return.
Returns:
The requested value. The return type is prim.

list()

List the properties and their values from the $node.

Returns:
A list of (name, value) tuples. The return type is list.

storm:path

Implements the Storm API for the Path object.

idens()

The list of Node idens which this Path has bee forked from during pivot operations.

Returns:
A list of node idens. The return type is list.

listvars()

List variables available in the path of a storm query.

Returns:
List of tuples containing the name and value of path variables. The return type is list.

meta

The PathMeta object for the Path.

Returns:
The type is storm:node:path:meta.

trace()

Make a trace object for the Path. This allows tracking pivots from a arbitrary location in a query.

Returns:
The trace object. The return type is storm:node:path:trace.

vars

The PathVars object for the Path.

Returns:
The type is storm:node:path:vars.

storm:node:path:meta

Put the storm deref/setitem/iter convention on top of path meta information.

storm:node:path:vars

Put the storm deref/setitem/iter convention on top of path variables.

storm:pipe

A Storm Pipe provides fast ephemeral queues.

put(item)

Add a single item to the Pipe.

Args:
item (any): An object to add to the Pipe.
Returns:
The return type is null.

puts(items)

Add a list of items to the Pipe.

Args:
items (list): A list of items to add.
Returns:
The return type is null.

size()

Retrieve the number of items in the Pipe.

Returns:
The number of items in the Pipe. The return type is int.

slice(size=1000)

Return a list of up to size items from the Pipe.

Args:
size (int): The max number of items to return.
Returns:
A list of at least 1 item from the Pipe. The return type is list.

slices(size=1000)

Yield lists of up to size items from the Pipe.

Notes:
The loop will exit when the Pipe is closed and empty.
Examples:

Operation on slices from a pipe one at a time:

for $slice in $pipe.slices(1000) {
    for $item in $slice { $dostuff($item) }
}

Operate on slices from a pipe in bulk:

for $slice in $pipe.slices(1000) {
    $dostuff_batch($slice)
}
Args:
size (int): The max number of items to yield per slice.
Yields:
Yields objects from the Pipe. The return type is any.

storm:project

No doc for Project

storm:project:epic

No doc for ProjectEpic

storm:project:epics

No doc for ProjectEpics

storm:project:sprint

No doc for ProjectSprint

storm:project:sprints

No doc for ProjectSprints

storm:project:ticket

No doc for ProjectTicket

storm:project:tickets

No doc for ProjectTickets

storm:proxy

Implements the Storm API for a Telepath proxy.

These can be created via $lib.telepath.open(). Storm Service objects are also Telepath proxy objects.

Methods called off of these objects are executed like regular Telepath RMI calls.

An example of calling a method which returns data:

$prox = $lib.telepath.open($url)
$result = $prox.doWork($data)
return ( $result )

An example of calling a method which is a generator:

$prox = $lib.telepath.open($url)
for $item in = $prox.genrStuff($data) {
    $doStuff($item)
}

storm:query

A storm primitive representing an embedded query.

exec()

Execute the Query in a sub-runtime.

Notes:
The .exec() method can return a value if the Storm query contains a return( ... ) statement in it.
Returns:
A value specified with a return statement, or none. The return type may be one of the following: none, any.

storm:queue

A StormLib API instance of a named channel in the Cortex multiqueue.

cull(offs)

Remove items from the queue up to, and including, the offset.

Args:
offs (int): The offset which to cull records from the queue.
Returns:
The return type is null.

get(offs=0, cull=True, wait=True)

Get a particular item from the Queue.

Args:

offs (int): The offset to retrieve an item from.

cull (boolean): Culls items up to, but not including, the specified offset.

wait (boolean): Wait for the offset to be available before returning the item.

Returns:
A tuple of the offset and the item from the queue. If wait is false and the offset is not present, null is returned. The return type is list.

gets(offs=0, wait=True, cull=False, size=None)

Get multiple items from the Queue as a iterator.

Args:

offs (int): The offset to retrieve an items from.

wait (boolean): Wait for the offset to be available before returning the item.

cull (boolean): Culls items up to, but not including, the specified offset.

size (int): The maximum number of items to yield

Yields:
Yields tuples of the offset and item. The return type is list.

name

The name of the Queue.

Returns:
The type is str.

pop(offs=None)

Pop a item from the Queue at a specific offset.

Args:
offs (int): Offset to pop the item from. If not specified, the first item in the queue will be popped.
Returns:
The offset and item popped from the queue. If there is no item at the offset or the queue is empty, it returns null. The return type is list.

put(item)

Put an item into the queue.

Args:
item (prim): The item being put into the queue.
Returns:
The return type is null.

puts(items)

Put multiple items into the Queue.

Args:
items (list): The items to put into the Queue.
Returns:
The return type is null.

size()

Get the number of items in the Queue.

Returns:
The number of items in the Queue. The return type is int.

storm:auth:role

Implements the Storm API for a Role.

addRule(rule, gateiden=None)

Add a rule to the Role

Args:

rule (list): The rule tuple to added to the Role.

gateiden (str): The gate iden used for the rule.

Returns:
The return type is null.

delRule(rule, gateiden=None)

Remove a rule from the Role.

Args:

rule (list): The rule tuple to removed from the Role.

gateiden (str): The gate iden used for the rule.

Returns:
The return type is null.

get(name)

Get a arbitrary property from the Role definition.

Args:
name (str): The name of the property to return.
Returns:
The requested value. The return type is prim.

iden

The Role iden.

Returns:
The type is str.

setRules(rules, gateiden=None)

Replace the rules on the Role with new rules.

Args:

rules (list): A list of rules to set on the Role.

gateiden (str): Ahe gate iden used for the rules.

Returns:
The return type is null.

set

Implements the Storm API for a Set object.

add(*items)

Add a item to the set. Each argument is added to the set.

Args:
*items (any): The items to add to the set.
Returns:
The return type is null.

adds(*items)

Add the contents of a iterable items to the set.

Args:
*items (any): Iterables items to add to the set.
Returns:
The return type is null.

has(item)

Check if a item is a member of the set.

Args:
item (any): The item to check the set for membership.
Returns:
True if the item is in the set, false otherwise. The return type is boolean.

list()

Get a list of the current members of the set.

Returns:
A list containing the members of the set. The return type is list.

rem(*items)

Remove an item from the set.

Args:
*items (any): Items to be removed from the set.
Returns:
The return type is null.

rems(*items)

Remove the contents of a iterable object from the set.

Args:
*items (any): Iterables items to remove from the set.
Returns:
The return type is null.

size()

Get the size of the set.

Returns:
The size of the set. The return type is int.

storm:stat:tally

A tally object.

An example of using it:

$tally = $lib.stats.tally()

$tally.inc(foo)

for $name, $total in $tally {
    $doStuff($name, $total)
}

get(name)

Get the value of a given counter.

Args:
name (str): The name of the counter to get.
Returns:
The value of the counter, or 0 if the counter does not exist. The return type is int.

inc(name, valu=1)

Increment a given counter.

Args:

name (str): The name of the counter to increment.

valu (int): The value to increment the counter by.

Returns:
The return type is null.

storm:stix:bundle

No doc for StixBundle

add(node, stixtype=None)

Make one or more STIX objects from a node, and add it to the bundle.

Examples:

Example Storm which would be called remotely via the callStorm() API:

init { $bundle = $lib.stix.bundle() }
#aka.feye.thr.apt1
$bundle.add($node)
fini { return($bundle) }
Args:

node (node): The node to make a STIX object from.

stixtype (str): The explicit name of the STIX type to map the node to. This will override the default mapping.

Returns:
The stable STIX id of the added object. The return type is str.

pack()

Return the bundle as a STIX JSON object.

Returns:
The return type is dict.

storm:hive:dict

A Storm Primitive representing a HiveDict.

get(name, default=None)

Get the named value from the HiveDict.

Args:

name (str): The name of the value.

default (prim): The default value to return if the name is not set.

Returns:
The requested value. The return type is prim.

list()

List the keys and values in the HiveDict.

Returns:
A list of tuples containing key, value pairs. The return type is list.

pop(name, default=None)

Remove a value out of the HiveDict.

Args:

name (str): The name of the value.

default (prim): The default value to return if the name is not set.

Returns:
The requested value. The return type is prim.

set(name, valu)

Set a value in the HiveDict.

Args:

name (str): The name of the value to set

valu (prim): The value to store in the HiveDict

Returns:
Old value of the dictionary if the value was previously set, or none. The return type may be one of the following: null, prim.

str

Implements the Storm API for a String object.

encode(encoding=utf8)

Encoding a string value to bytes.

Args:
encoding (str): Encoding to use. Defaults to utf8.
Returns:
The encoded string. The return type is bytes.

endswith(text)

Check if a string ends with text.

Args:
text (str): The text to check.
Returns:
True if the text ends with the string, false otherwise. The return type is boolean.

ljust(size)

Left justify the string.

Args:
size (int): The length of character to left justify.
Returns:
The left justified string. The return type is str.

lower()

Get a lowercased copy the of the string.

Examples:

Printing a lowercased string:

$foo="Duck"
$lib.print($foo.lower())
Returns:
The lowercased string. The return type is str.

lstrip(chars=None)

Remove leading characters from a string.

Examples:

Removing whitespace and specific characters:

$strippedFoo = $foo.lstrip()
$strippedBar = $bar.lstrip(w)
Args:
chars (str): A list of characters to remove. If not specified, whitespace is stripped.
Returns:
The stripped string. The return type is str.

replace(oldv, newv, maxv=None)

Replace occurrences of a string with a new string, optionally restricting the number of replacements.

Example:

Replace instances of the string “bar” with the string “baz”:

$foo.replace('bar', 'baz')
Args:

oldv (str): The value to replace.

newv (str): The value to add into the string.

maxv (int): The maximum number of occurances to replace.

Returns:
The new string with replaced instances. The return type is str.

reverse()

Get a reversed copy of the string.

Examples:

Printing a reversed string:

$foo="foobar"
$lib.print($foo.reverse())
Returns:
The reversed string. The return type is str.

rjust(size)

Right justify the string.

Args:
size (int): The length of character to right justify.
Returns:
The right justified string. The return type is str.

rstrip(chars=None)

Remove trailing characters from a string.

Examples:

Removing whitespace and specific characters:

$strippedFoo = $foo.rstrip()
$strippedBar = $bar.rstrip(asdf)
Args:
chars (str): A list of characters to remove. If not specified, whitespace is stripped.
Returns:
The stripped string. The return type is str.

slice(start, end=None)

Get a substring slice of the string.

Examples:

Slice from index to 1 to 5:

$x="foobar"
$y=$x.slice(1,5)  // "ooba"

Slice from index 3 to the end of the string:

$y=$x.slice(3)  // "bar"
Args:

start (int): The starting character index.

end (int): The ending character index. If not specified, slice to the end of the string

Returns:
The slice substring. The return type is str.

split(text)

Split the string into multiple parts based on a separator.

Example:

Split a string on the colon character:

($foo, $bar) = $baz.split(":")
Args:
text (str): The text to split the string up with.
Returns:
A list of parts representing the split string. The return type is list.

startswith(text)

Check if a string starts with text.

Args:
text (str): The text to check.
Returns:
True if the text starts with the string, false otherwise. The return type is boolean.

strip(chars=None)

Remove leading and trailing characters from a string.

Examples:

Removing whitespace and specific characters:

$strippedFoo = $foo.strip()
$strippedBar = $bar.strip(asdf)
Args:
chars (str): A list of characters to remove. If not specified, whitespace is stripped.
Returns:
The stripped string. The return type is str.

storm:text

A mutable text type for simple text construction.

add(text, **kwargs)

Add text to the Text object.

Args:

text (str): The text to add.

**kwargs (any): Keyword arguments used to format the text.

Returns:
The return type is null.

str()

Get the text content as a string.

Returns:
The current string of the text object. The return type is str.

storm:node:path:trace

Storm API wrapper for the Path Trace object.

idens()

Get the idens in the current trace object.

Returns:
A List of Node idens. The return type is list.

storm:trigger

Implements the Storm API for a Trigger.

iden

The Trigger iden.

Returns:
The type is str.

set(name, valu)

Set information in the trigger.

Args:

name (str): Name of the key to set.

valu (prim): The data to set

Returns:
The return type is null.

storm:auth:user

Implements the Storm API for a User.

addRule(rule, gateiden=None)

Add a rule to the User.

Args:

rule (list): The rule tuple to add to the User.

gateiden (str): The gate iden used for the rule.

Returns:
The return type is null.

allowed(permname, gateiden=None)

Check if the user has a given permission.

Args:

permname (str): The permission string to check.

gateiden (str): The authgate iden.

Returns:
True if the rule is allowed, False otherwise. The return type is boolean.

delRule(rule, gateiden=None)

Remove a rule from the User.

Args:

rule (list): The rule tuple to removed from the User.

gateiden (str): The gate iden used for the rule.

Returns:
The return type is null.

get(name)

Get a arbitrary property from the User definition.

Args:
name (str): The name of the property to return.
Returns:
The requested value. The return type is prim.

grant(iden)

Grant a Role to the User.

Args:
iden (str): The iden of the Role.
Returns:
The return type is null.

iden

The User iden.

Returns:
The type is str.

revoke(iden)

Remove a Role from the User

Args:
iden (str): The iden of the Role.
Returns:
The return type is null.

roles()

Get the Roles for the User.

Returns:
A list of storm:auth:roles with the user is a member of. The return type is list.

setAdmin(admin, gateiden=None)

Set the Admin flag for the user.

Args:

admin (boolean): True to make the User an admin, false to remove their admin status.

gateiden (str): The gate iden used for the operation.

Returns:
The return type is null.

setEmail(email)

Set the email address of the User.

Args:
email (str): The email address to set for the User.
Returns:
The return type is null.

setLocked(locked)

Set the locked status for a user.

Args:
locked (boolean): True to lock the user, false to unlock them.
Returns:
The return type is null.

setPasswd(passwd)

Set the Users password.

Args:
passwd (str): The new password for the user. This is best passed into the runtime as a variable.
Returns:
The return type is null.

setRoles(idens)

Replace all the Roles of the User with a new list of roles.

Notes:
The roleiden for the “all” role must be present in the new list of roles. This replaces all existing roles that the user has with the new roles.
Args:
idens (list): The idens to of the Role.
Returns:
The return type is null.

setRules(rules, gateiden=None)

Replace the rules on the User with new rules.

Args:

rules (list): A list of rule tuples.

gateiden (str): The gate iden used for the rules.

Returns:
The return type is null.

storm:view

Implements the Storm api for a View instance.

addNodeEdits(edits)

Add NodeEdits to the view.

Args:
edits (list): A list of nodeedits.
Returns:
The return type is null.

fork(name=None)

Fork a View in the Cortex.

Args:
name (str): The name of the new view.
Returns:
The storm:view object for the new View. The return type is storm:view.

get(name, defv=None)

Get a arbitrary value in the View definition.

Args:

name (str): Name of the value to get.

defv (prim): The default value returned if hte name is not set in the View.

Returns:
The value requested or the default value. The return type is prim.

getEdgeVerbs()

Get the Edge verbs which exist in the View.

Yields:
Yields the edge verbs used by Layers which make up the View. The return type is str.

getEdges(verb=None)

Get node information for Edges in the View.

Args:
verb (str): The name of the Edges verb to iterate over.
Yields:
Yields tuples containing the source iden, verb, and destination iden. The return type is list.

getFormCounts()

Get the formcounts for the View.

Example:

Get the formcounts for the current View:

$counts = $lib.view.get().getFormCounts()
Returns:
Dictionary containing form names and the count of the nodes in the View’s Layers. The return type is dict.

iden

The iden of the View.

Returns:
The type is str.

layers

The storm:layer objects associated with the storm:view.

Returns:
The type is list.

merge()

Merge a forked View back into its parent View.

Returns:
The return type is null.

pack()

Get the View definition.

Returns:
Dictionary continaing the View definition. The return type is dict.

repr()

Get a string representation of the View.

Returns:
A list of lines that can be printed, representing a View. The return type is list.

set(name, valu)

Set a arbitrary value in the View definition.

Args:

name (str): The name of the value to set.

valu (prim): The value to set.

Returns:
The return type is null.

triggers

The storm:trigger objects associated with the storm:view.

Returns:
The type is list.