corelink.sh

Corelink bash client

Overview

This library is used for interacting with the Corelink project. corelink.hsrn.nyu.edu

Index

findIP

Helper function that dynamically finds an available IP

finish

This traps the script so there are no hanging websocket connections

inquire

Helper function to dynamically inquire arguments and set results

error_check

Helper function to check the status code of every server response

Arguments

  • $1 (full): server response

debug_print

Function to print the raw requests and responses if debug is true

connect

connect to the corelink server with websocket

Arguments

  • $1 (server): name

login

log into Corelink and populate the token and IP parameters

Arguments

  • $1 username
  • $2 password

addWorkspace

Create a new workspace

Arguments

  • $1 (Name): of the new workspace

setDefaultWorkspace

Set a default workspace

Arguments

  • $1 (Name): of the workspace

getDefaultWorkspace

Get the Corelink default workspace

listWorkspaces

Get all of the current Corelink workspaces

rmWorkspace

Delete a workspace

Arguments

  • $1 (Name): of the workspace

listFunctions

query Corelink for all available functions

listServerFunctions

query Corelink for all server callbacks

describeFunction

Query Corelink to describe a control function

Arguments

  • $1 (function): name to get info on

describeServerFunction

Query Corelink to describe a server function

Arguments

  • $1 (function): name to get info on

createSender

Create a corelink sender

Options

  • 1 workspace to create sender
  • 2 proto
  • 3 sender type
  • 4 meta
  • 5 from
  • 6 alert

sendws

This sends a ws message (and creates a socket if necessary)

Options

  • 1 msg

sendtcp

This sends a tcp message (and creates a socket if necessary)

Options

  • 1 msg

sendudp

This sends a udp message (and creates a socket if necessary)

Options

  • 1 msg

send

Send some data with corelink

Options

  • 1 streamID
  • 2 data
  • 3 header

createReceiver

Create a corelink receiver

Options

  • 1 workspace to create receiver
  • 2 receiverID
  • 3 streamIDs
  • 4 proto
  • 5 type
  • 6 alert
  • 7 echo
  • 8 meta

subscribe

Subscribe to a corelink data stream

Options

  • 1 receiverID
  • 2 streamID

unsubscribe

Unsubscribe from a corelink data stream

Options

  • 1 receiverID
  • 2 streamID

listen

Listen to coming messages from receivers that have been created

setConfig

Set Corelink config

Arguments

  • $1 config
  • $2 context
  • $3 app
  • $4 user
  • $5 value

listStreams

query Corelink for streams based off a filter

Arguments

  • $1 (workspaces,): [] if empty
  • $2 (types,): [] if empty

listUsers

query Corelink for all usernames

rmUser

Ask Corelink to remove a user

Arguments

  • $1 (user): name that you would like to remove

addUser

Ask Corelink to add a user

Arguments

  • $1 (username): that you would like to add
  • $2 (password): of the user that you would like to add
  • $3 (first): name
  • $4 (last): name
  • $5 (email): address
  • $6 (admin): property of the new user

password

Ask Corelink to change your password

Arguments

  • $1 (new): password

listGroups

query Corelink for all groups

rmGroup

Ask Corelink to remove a group

Arguments

  • $1 (group): name that you would like to remove

addGroup

Ask Corelink to add a group

Arguments

  • $1 (group): name that you would like to add

addUserGroup

Ask Corelink to add a user to a group

Arguments

  • $1 (name): that you would like to add user to group
  • $2 (Groupname): that will have a new user

rmUserGroup

Ask Corelink to remove a user from a group

Arguments

  • $1 (name): that you would like to remove user from group
  • $2 (Groupname): that will have a new user

changeOwner

Changes the ownership of a group to a different user

Arguments

  • $1 (group): name
  • $2 username

disconnect

disconnect your own streams

Arguments

  • $1 (workspaces,): [] if empty
  • $2 (types,): [] if empty
  • $3 (streamIDs,): [] if empty

exit

exit from utility