Coder Social home page Coder Social logo

azure-chaos-fn's Introduction

azure-chaos-fn

Build Status

To scaffold projects more easily, see generator-azure-chaos-fn. ✨

The base module for all azure-chaos extensions ⚙️ :robot_face:

readme logo

This module defines a javascript framework that is helpful when authoring azure-chaos functions. It provides a lightweight processing pipeline that allows extension authors to more easily engineer chaos, without worrying about communication details with the orchestrator.

API

If your functions are async they should return a Promise!

Current version is v1 - access it with require('azure-chaos-fn/v1') or require('azure-chaos-fn').v1.

start.bootStrap

Function that bootstraps the request to start chaos. Should be given context (from azure functions) and func (the function to run).

Example:

const yourFunc = require('./your-func')
bootStrap(context, yourFunc)

stop.bootStrap

Function that bootstraps the request to stop chaos. Should be given context (from azure functions) and func (the function to run).

Example:

const yourFunc = require('./your-func')
bootStrap(context, yourFunc)

ChaosRequest

Represents a request

accessToken

String - the access token to use when issuing requests to azure

resourceIds

Array of ChaosResourceIds

ChaosResponse

status

Function that takes a status (a Number) and optionally a desc (a String) that describe the result of the request for chaos.

Example:

res.status(200, JSON.stringify({status: 'all good'}))

end

Function that locks the response, indicating it's ready to be sent and will have no more action taken upon it. This can only be called once.

wasEnded

Bool that indicates if end was called.

ChaosResourceId

Represents the tri-part resourceIds that are passed in a ChaosRequest.

subscription

String - the subscription id

resourceId

String - the resource id

resourceGroup

String - The resource group

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.