You are not logged in. Click here to log in.

Application Lifecycle Management

Search In Project

Search inClear

CRP #78801/HEAD / v60
Tags:  not added yet
  1. CRP resources

    1. PUB/SUB

run.py

from csip.utils import Client

ps = Client()

ps.bearertoken = "f84c2452cc7f6b53a6fa0ebe93d83c48"
ps.webhook = "http://perams10.engr.colostate.edu:9003/hooks/crp"
ps.delay = 500
ps.files = "NM_1000/crp_*.json"
ps.batch = (501, 1500)


metainfo = {
    'debug':'false'
}

# callback
def cb(client, file, index):
    print("{} {}: {}".format(index, file, client.get_status()),flush=True)

ps.pubsub('http://csip.engr.colostate.edu:8087/csip-ps/p/pubsub/8087/csip-crp/m/crpassessment/2.0',
   callback=cb,
   extra_metainfo=metainfo)

Start PS:

$ cd crp
$ python3 run.py

Results:

$ cd webhook/crp
$

    1. JQ examples
 $jq '.result[3]' crp_uid_08bcb11e-2c22-40b1-a511-fd0cafb47a7c.json
{
  "description": "Weighted Average Annual Soil Loss by Water and Wind",
  "name": "WtAvgTotalSoilLoss",
  "unit": "ton/ac/yr",
  "value": 693.5023091805484
}