Skip to content

Instantly share code, notes, and snippets.

@mtorrisi
mtorrisi / 3-check-status-curl
Last active November 16, 2016 14:12
Get task status
## COMMAND
curl -X GET "http://151.97.41.66:8888/v1.0/tasks/16"
## EXPECTED OUTPUT
{
"last_change": "2016-11-16T09:31:33Z",
"input_files": [
{
"name": "sayhello.sh",
"url": "file?path=%2Ftmp%2F137e989e-abdf-11e6-b19b-fa163e72d9ab&name=sayhello.sh",
@mtorrisi
mtorrisi / 1-create-task-curl
Created November 16, 2016 14:11
Create Futuregateway task
## COMMAND
curl -i -H "Content-Type: application/json" -X POST -d '{"application":"2","description":"sayhello@csgfsdk test run", "arguments": ["\"I am saying hello!\""], "output_files": [{"name":"sayhello.data"}], "input_files": [{"name":"sayhello.sh"},{"name":"sayhello.txt"}]}' http://151.97.41.44:8888/v1.0/tasks?user=user
## EXPECTED OUTPUT
{
"status": "WAITING",
"application": "2",
"date": "2016-11-16T09:28:47Z",
"description": "sayhello@csgfsdk test run",
"output_files": [
@mtorrisi
mtorrisi / 2-upload-files-curl
Created November 16, 2016 14:15
Upload input files
## COMMAND
curl -i -F "file[][email protected]" -F "file[][email protected]" "http://151.97.41.66:8888/v1.0/tasks/16/input?user=user"
## EXPECTED OUTPUT
{
"files": [
"sayhello.txt",
"sayhello.sh"
],
"message": "uploaded",
## COMMAND
curl -o sayhello.out -X GET "http://151.97.41.66:8888/v1.0/file?path=%2Ftmp%2F137e989e-abdf-11e6-b19b-fa163e72d9ab%2F16tmp137e989eabdf11e6b19bfa163e72d9ab_48&name=sayhello.out"
@mtorrisi
mtorrisi / sayhello.sh
Created November 16, 2016 14:17
Demo sayhello script
#!/bin/bash
INPFILE=sayhello.txt
DATAFILE=sayhello.data
DELAY=2
printf "starting at: " ; date
printf "running on: "; $(hostname -f)
printf "whoami: "; whoami
printf "home: "; echo $HOME
printf "listing home:\n"
ls -l $HOME
@mtorrisi
mtorrisi / sayhello.txt
Created November 16, 2016 14:19
Say hello input file
!!!Say hello!!!
---------------
Demonstrative application for APIServer
using I/O Sandboxing and arguments
@mtorrisi
mtorrisi / new_tenant.sh
Last active January 31, 2017 14:33 — forked from jriguera/new_tenant.sh
Openstack CLI commands to create a new Project/Tenant, networks and security group using specific Openstack service CLI commands
#!/bin/sh
############## Define those variables for the tenant
TENANT=$1
PASSWORD=$2
TENANT_DESC="$3"
TENANT_EMAIL="$4"
TENANT_NET_CIDR="10.0.1.0/24"
TENANT_NET_GW="10.0.1.1"
DEFAULT_DNS="8.8.8.8"
&share
wrf_core = 'ARW',
max_dom = 2,
start_date = '2017-05-11_00:00:00','2017-05-11_00:00:00',
end_date = '2017-05-22_00:00:00','2017-05-22_00:00:00',
interval_seconds = 21600
io_form_geogrid = 2,
/
&geogrid
&time_control
run_days = 0,
run_hours = 12,
run_minutes = 0,
run_seconds = 0,
start_year = 2017, 2017, 2017,
start_month = 05, 05, 05,
start_day = 11, 11, 11,
start_hour = 00, 00, 00,
start_minute = 00, 00, 00,
#!/bin/csh
#################################################################
# Csh Script to retrieve 45 online Data files of 'ds083.2',
# total 867.77M. This script uses 'wget' to download data.
#
# Highlight this script by Select All, Copy and Paste it into a file;
# make the file executable and run it on command line.
#
# You need pass in your password as a parameter to execute
# this script; or you can set an environment variable RDAPSWD