Skip to content

Instantly share code, notes, and snippets.

@SynapseProject
SynapseProject / CustomController.cs
Created April 6, 2017 04:20
Created a custom ApiControllers with Synapse.Server.Extensibility
using System;
using System.Web.Http;
using Synapse.Services;
/// <summary>
/// Create a new Class Library (dll) project
/// Add a ref to Synapse.Services.Extensibility from: https://www.nuget.org/packages/Synapse.Server.Extensibility
/// </summary>
namespace Synapse.Custom
{
@SynapseProject
SynapseProject / PlanInfo.cmd
Last active April 2, 2017 15:13
Synapse.Controller.Cli example for fetching Plan list and PlanInstanceId list
C:\synapse>Synapse.Controller.Cli.exe l filter:json
Calling GetPlanList on http://localhost:20001/synapse/execute
[
"jsonList",
"jsonSimple"
]
//same, as a URL
http://localhost:20001/synapse/execute/?filter=json
@SynapseProject
SynapseProject / MyHandler.cs
Created March 21, 2017 01:05
Synapse.Core: Example of custom Handler and consuming Plan (simple).
using System;
using Synapse.Core;
namespace ExampleHandler
{
//Inherit HandlerRuntimeBase for the easiest implementation.
public class MyHandler : HandlerRuntimeBase
{
override public ExecuteResult Execute(HandlerStartInfo startInfo)
{
@SynapseProject
SynapseProject / StartPlan_Post_Json.ps1
Last active March 19, 2017 18:49
SynapseServer: Example PowerShell to call Synapse.Controller StartPlan with HTTP Post using embedded JSON list.
# - This sample script expects to use the attached Synapse Plan "jsonEcho.yaml", which calls "jsonEcho.ps1"
# - To execute the script, download Synapse.Server, following the instructions here:
# http://synapse.readthedocs.io/en/latest/run/server/
# - It is fine to run Controller/Node from the associated CLIs; locate jsonEcho.ps1/jsonEcho.yaml in the
# Controller/FileSystemDal/Plans folder, and update jsonEcho.ps1 for the correct folder path.
$hostPort = "localhost:20001"
$planName = "jsonEcho"
$uri = "http://$hostPort/synapse/execute/$planName/start/"