Skip to content

Instantly share code, notes, and snippets.

@dexterlabora
dexterlabora / Code.gs
Last active April 8, 2024 19:46
Meraki Webooks Demo with Google Sheets
/*
Copy this function over the existing Code.gs file in a Google Sheet
Save the Sheet/Script
Publish App
- Execute as You
- Avaiable to Anyone (including anonymous)
Authorize App when prompted
The URL will act as the Webhook URL for Meraki to send alerts
*/
@dexterlabora
dexterlabora / v0-v1-path-operations-diff.json
Created September 4, 2020 20:24
Meraki API v0-v1-path-operations-diff.json
[
{
"oldPath": "/devices/{serial}/camera/qualityAndRetentionSettings",
"newPath": "/devices/{serial}/camera/qualityAndRetention",
"oldOperations": [
"getDeviceCameraQualityAndRetentionSettings",
"updateDeviceCameraQualityAndRetentionSettings"
],
"newOperations": [
"getDeviceCameraQualityAndRetention",
/**
* Internet of Lego - Train Schedule Display
* This program connects to WiFi, utilizes MQTT and displays the local train schedule on an OLED screen
* The OLED graphics library is slimmed down to only text for memory efficiency
* https://github.com/greiman/SSD1306Ascii
*
* Hardware: Cactus Micro Rev2 - http://wiki.aprbrother.com/wiki/Cactus_Micro_Rev2
* Written by: Cory Guynn with some snippets from public examples ;)
* 2016
*
@dexterlabora
dexterlabora / meraki-service.js
Created May 4, 2018 13:31
A collection of functions to interact with the Meraki API. This version is designed to work with a VueJS project.
/* Meraki Dashboard API endpoint service for VueJS
A collection of functions to interact with the Meraki API.
This version is designed to work with a VueJS project.
It is easy to duplicate any of the methods to and modify them for new API endpoints.
The service will leverage an event HUB to broadcast messages while scripts are running. This is helfpul
@dexterlabora
dexterlabora / Code.gs
Last active May 28, 2023 22:06
Google Sheets Scripts with the Meraki Dashboard API
// Settings - Modify this with your values
// *************************
// User Defined in the Script
var API_KEY = '';
var ORG_ID = '';
var NET_ID = '';
var TIMESPAN = '';
// User Defined in a Sheet
@dexterlabora
dexterlabora / meraki-mqtt-v1-asyncapi.yaml
Created April 28, 2022 14:02
DEV --- The is just a TEST schema for Meraki MQTT data.
asyncapi: '2.3.0'
info:
title: Meraki MQTT API
version: '1.0.0'
description: |
The Meraki MQTT service enables real-time telemetry from your network devices.
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
@dexterlabora
dexterlabora / snow-meraki-webhook-alerts.js
Created March 18, 2019 15:57
ServiceNow - Meraki Webhook Alerts
(function process( /*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
// Parse Meraki Alerts Webhook Data
var requestBody = request.body;
var requestString = requestBody.dataString;
var requestParsed = {};
requestParsed = JSON.parse(requestString);
var merakiAlert = requestParsed;
// Create SNOW Incident
@dexterlabora
dexterlabora / merakiFetchReport.gs
Created April 25, 2022 19:02
An add-on custom function to call a Meraki API and shape the data to fit a Google Sheet.
/**
* Fetches Meraki API data and formats the JSON data into Google Sheet format
* @param url url to pull json data from
* @param apiKey API key for authorization
* @param title The title text to display in the cell
* @param refresh Triggers a refresh of report when changed. Cannot use now() functions, so a helper "Refresh Reports" button will update a hidden _meraki_tools settings sheet to set a time, triggering the function to re-evaluate. You can optionaly set a Trigger to call the refreshReports function on a schedule.
* @return Google Sheet data
* @customfunction
@dexterlabora
dexterlabora / jsonata-openapi-parse-ops-paths.txt
Created February 12, 2021 11:38
JSONata - Parse Open API v2 Spec by Path, Operation, Description and Tags
/* OAS Path Ops and Tags */
(
$.paths.*#$index.**.operationId.{
/*"pathIndex": $index,*/
"path": $keys($$.paths)[$index],
"operationid": %.operationId,
"description": %.description,
"tags":%.tags
};
)
@dexterlabora
dexterlabora / esp8266-sniffer
Created August 7, 2019 11:24
A fork of esp8266-sniffer to pipe probe requests the serial port in JSON format to be easily used with Node-RED, etc.
#include <ArduinoJson.h>
#include <iostream>
#include <ESP8266WiFi.h> // added this
#include <ESP8266HTTPClient.h> // added this
const char* serial = "YYYY-YYYY-YYYY"; // fake AP serial
const char* networkId = "N_99999999999"; // fake network ID
const float txPower = 20.5; // power in dBm (0 - 20.5)