Exploring tools that allow converting a JSON response automagically into an OpenAPI / Swagger spec.
{
"accounts": {
"default": {| function getLambdaEventSource(event) { | |
| if (event.Records && event.Records[0].cf) return 'isCloudfront'; | |
| if (event.configRuleId && event.configRuleName && event.configRuleArn) return 'isAwsConfig'; | |
| if (event.Records && (event.Records[0].eventSource === 'aws:codecommit')) return 'isCodeCommit'; | |
| if (event.authorizationToken === "incoming-client-token") return 'isApiGatewayAuthorizer'; | |
| if (event.StackId && event.RequestType && event.ResourceType) return 'isCloudFormation'; |
| KEY=XXXXXXXXXXXX | |
| HOST="https://metrics.crisidev.org" | |
| mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do | |
| curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json | |
| done |
| package com.pluralsight.proxy; | |
| import java.util.List; | |
| import twitter4j.Query; | |
| import twitter4j.QueryResult; | |
| import twitter4j.Status; | |
| import twitter4j.Twitter; | |
| import twitter4j.TwitterException; | |
| import twitter4j.TwitterFactory; |
| package bank; | |
| import java.util.ArrayList; | |
| /** | |
| This bank contains a collection of bank accounts. | |
| */ | |
| public class Bank | |
| { |
| input { | |
| redis { | |
| host => "127.0.0.1" | |
| type => "redis-input" | |
| # these settings should match the output of the agent | |
| data_type => "list" | |
| key => "logstash" | |
| # We use json_event here since the sender is a logstash agent | |
| message_format => "json_event" | |
| } |