github.com/qri-io/qri@v0.10.1-0.20220104210721-c771715036cb/api/spec/testdata/automation.json (about)

     1  [
     2    {
     3      "endpoint": "/auto/apply",
     4      "method": "POST",
     5      "headers": {
     6        "Content-Type": "application/json"
     7      },
     8      "body": {
     9        "ref": "peer/movies",
    10        "transform": {
    11          "text": "def transform(ds,ctx):\nreturn"
    12        }
    13      },
    14      "expect": {
    15        "code": 200,
    16        "headers": {
    17          "Content-Type": "application/json"
    18        }
    19      }
    20    },
    21    {
    22  	  "endpoint": "/auto/deploy",
    23  	  "method": "POST",
    24  	  "headers": {
    25  		  "Content-Type": "application/json"
    26  	  },
    27  	  "body": {
    28  		  "ref": "peer/now",
    29  		  "dataset": {
    30  			  "name": "now",
    31  			  "peername": "peer",
    32  			  "transform": {
    33  				"steps": [
    34  					{
    35  					  "syntax":"starlark",
    36  					  "name":"setup",
    37  					  "script":"load(\"time.star\", \"time\")\nds = dataset.latest()"
    38  					},
    39  					{
    40  					  "syntax":"starlark",
    41  					  "name":"transform",
    42  					  "script":"currentTime = time.now()\nbody = [\n    ['timestamp']\n  ]\nds.body = body.append([[str(currentTime)]])\ndataset.commit(ds)"
    43  					}
    44  				]
    45  			}
    46  		},
    47  		"workflow": {
    48  		}
    49  	  },
    50  	  "expect": {
    51  		  "code": 200,
    52  		  "headers": {
    53  			  "Content-Type":"application/json"
    54  		  }
    55  	  }
    56    },
    57    {
    58  	  "endpoint": "/auto/run",
    59  	  "method": "POST",
    60  	  "headers": {
    61  		  "Content-Type": "application/json"
    62  	  },
    63  	  "body": {
    64  		  "workflowID": "1d79b0ff-a133-4731-9892-5ee01842ca81"
    65  	  },
    66  	  "expect": {
    67  		  "code": 200,
    68  		  "headers": {
    69  			  "Content-Type":"application/json"
    70  		  }
    71  	  }
    72    },
    73    {
    74  	"endpoint": "/auto/workflow",
    75  	"method": "POST",
    76  	"headers": {
    77  		"Content-Type": "application/json"
    78  	},
    79  	"body": {
    80  		"workflowID": "9e45m9ll-b366-0945-2743-8mm90731jl72"
    81  	},
    82  	"expect": {
    83  	      "code": 200,
    84  	      "headers": {
    85  		"Content-Type": "application/json"
    86  	      }
    87  	}
    88    },
    89    {
    90  	  "endpoint": "/auto/remove",
    91  	  "method": "POST",
    92  	  "headers": {
    93  		  "Content-Type": "application/json"
    94  	  },
    95  	  "body": {
    96  		"workflowID": "9e45m9ll-b366-0945-2743-8mm90731jl72"
    97  	},
    98  	"expect": {
    99  	      "code": 200,
   100  	      "headers": {
   101  		"Content-Type": "application/json"
   102  	      }
   103  	} 
   104    }
   105  ]