action maif_update_snow_monkey { label: "Update current Snow Monkey config" description: "Update current Snow Monkey config" provider: maif method: PUT path: "/api/snowmonkey/config" encoding: json input: { type: "object" description: "An Otoroshi service group is just a group of service descriptor. It is useful to be able to define Api Keys for the whole group" required: ["id", "name"] properties: { description: { type: "string" description: "The descriptoin of the group" } id: { type: "string" description: "The unique id of the group. Usually 64 random alpha numerical characters, but can be anything" } name: { type: "string" description: "The name of the group" } } } output: { type: "object" description: "Configuration for the faults that can be injected in requests. The name Snow Monkey is an hommage to Netflix's Chaos Monkey 😉" required: ["chaosConfig", "dryRun", "enabled", "includeUserFacingDescriptors", "outageDurationFrom", "outageDurationTo", "outageStrategy", "startTime", "stopTime", "targetGroups", "timesPerDay"] properties: { chaosConfig: { type: "object" description: "Configuration for the faults that can be injected in requests" required: ["enabled"] properties: { badResponsesFaultConfig: { type: "object" description: "Config for bad requests injection fault" required: ["ratio", "responses"] properties: { ratio: { type: "number" format: "double" description: "The percentage of requests affected by this fault. Value should be between 0.0 and 1.0" } responses: { type: "array" description: "The possibles responses" items: { type: "object" description: "An HTTP response that is not supposed to be returned by a service" required: ["status", "body", "headers"] properties: { body: { type: "string" description: "The body of the HTTP response" } headers: { type: "object" description: "The HTTP headers of the response" } status: { type: "integer" format: "int32" description: "The HTTP status for the response" } } } } } } enabled: { type: "boolean" description: "Whether or not this config is enabled" } largeRequestFaultConfig: { type: "object" description: "Config for large request injection fault" required: ["additionalRequestSize", "ratio"] properties: { additionalRequestSize: { type: "integer" format: "int32" description: "The size added to the request body in bytes. Added payload will be spaces only." } ratio: { type: "number" format: "double" description: "The percentage of requests affected by this fault. Value should be between 0.0 and 1.0" } } } largeResponseFaultConfig: { type: "object" description: "Config for large response injection fault" required: ["additionalResponseSize", "ratio"] properties: { additionalRequestSize: { type: "integer" format: "int32" description: "The size added to the response body in bytes. Added payload will be spaces only." } ratio: { type: "number" format: "double" description: "The percentage of requests affected by this fault. Value should be between 0.0 and 1.0" } } } latencyInjectionFaultConfig: { type: "object" description: "Config for large latency injection fault" required: ["from", "ratio", "to"] properties: { from: { type: "integer" format: "int32" description: "The start range of latency added to the request" } ratio: { type: "number" format: "double" description: "The percentage of requests affected by this fault. Value should be between 0.0 and 1.0" } to: { type: "integer" format: "int32" description: "The end range of latency added to the request" } } } } } dryRun: { type: "boolean" description: "Whether or not outages will actualy impact requests" } enabled: { type: "boolean" description: "Whether or not this config is enabled" } includeUserFacingDescriptors: { type: "boolean" description: "Whether or not user facing apps. will be impacted by Snow Monkey" } outageDurationFrom: { type: "integer" format: "int32" description: "Start of outage duration range" } outageDurationTo: { type: "integer" format: "int32" description: "End of outage duration range" } outageStrategy: { type: "string" enum: ["OneServicePerGroup", "AllServicesPerGroup"] } startTime: { type: "string" format: "time" description: "Start time of Snow Monkey each day" } stopTime: { type: "string" format: "time" description: "Stop time of Snow Monkey each day" } targetGroups: { type: "array" description: "Groups impacted by Snow Monkey. If empty, all groups will be impacted" items: { type: "string" } } timesPerDay: { type: "integer" format: "int32" description: "Number of time per day each service will be outage" } } } }