Little helper to call Taskcluster api calls in command line
Main problem that auth uses HAWK which requires libraries to calculate hmac of the authorization header
Usage in shell:
tc_api POST queue/v1/task '{payload here'}
tc_api GET auth/v1/ping| use std::net::TcpStream; | |
| use std::io::{self, Read}; | |
| use std::time::{SystemTime, UNIX_EPOCH}; | |
| fn get_current_unix_timestamp() -> u64 { | |
| let start = SystemTime::now(); | |
| let since_the_epoch = start.duration_since(UNIX_EPOCH).expect("Ehmmm.."); | |
| // Adjust for the difference between 1900 and 1970 |
| -- assist easier future migration, add readable columns to azure_queue_messages | |
| alter table azure_queue_messages | |
| add column task_queue_id text null, -- expose cryptic names | |
| add column priority int null, -- don't forget about the priority | |
| add column payload jsonb null; -- instead of base64 encoded string use jsonb | |
| -- patch functions to use new columns | |
| CREATE OR REPLACE FUNCTION public.azure_queue_put_extra(queue_name text, message_text text, visible timestamp without time zone, expires timestamp without time zone, task_queue_id text, priority int, payload jsonb) |
Little helper to call Taskcluster api calls in command line
Main problem that auth uses HAWK which requires libraries to calculate hmac of the authorization header
Usage in shell:
tc_api POST queue/v1/task '{payload here'}
tc_api GET auth/v1/pingI hereby claim:
To claim this, I am signing this object:
| /* global phantom, console */ | |
| 'use strict'; | |
| var system = require('system'); | |
| if (system.args.length < 3) { | |
| console.error('I need more arguments: render-image [template] [outputFilename]'); | |
| phantom.exit(1); | |
| } | |
| var page = require('webpage').create(); |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main(int argc, char **argv) { | |
| if (argc < 2) { | |
| printf("No input\n"); | |
| return 1; | |
| } |
| { | |
| "VCALENDAR": [ | |
| { | |
| "VERSION": "2.0", | |
| "PRODID": "-//f1timing v1.0//EN", | |
| "NAME": "Formula One Official Calendar", | |
| "X-WR-CALNAME": "Formula One Official Calendar", | |
| "VEVENT": [ | |
| { | |
| "UID": "f1cal48@formula1.com", |
| --- stack trace --- | |
| #0 0x00007fc243a50cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 | |
| resultvar = 0 | |
| pid = 14973 | |
| selftid = 18597 | |
| #1 0x00007fc243a540d8 in __GI_abort () at abort.c:89 | |
| save_stage = 2 | |
| act = {__sigaction_handler = {sa_handler = 0x7fc2240d8840, sa_sigaction = 0x7fc2240d8840}, sa_mask = {__val = {2, 18628, 140472386274647, 5, 0, 0, 140472335076648, 140471980504576, 18628, 11, 140472386303253, 0, 140472372118602, 0, 140471980499680, 6}}, sa_flags = 0, sa_restorer = 0x1} | |
| sigs = {__val = {32, 0 <repeats 15 times>}} | |
| #2 0x00000000005188f1 in safe_abort () at /opt/kurento/kurento-media-server/server/death_handler.cpp:299 |