Package com.netflix.simianarmy.chaos

Examples of com.netflix.simianarmy.chaos.ChaosType


        String eventType = getStringField(input, "eventType");
        String groupType = getStringField(input, "groupType");
        String groupName = getStringField(input, "groupName");
        String chaosTypeName = getStringField(input, "chaosType");

        ChaosType chaosType;
        if (!Strings.isNullOrEmpty(chaosTypeName)) {
            chaosType = ChaosType.parse(this.monkey.getChaosTypes(), chaosTypeName);
        } else {
            chaosType = new ShutdownInstanceChaosType(monkey.context().configuration());
        }

        Response.Status responseStatus;
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        JsonGenerator gen = JSON_FACTORY.createJsonGenerator(baos, JsonEncoding.UTF8);
        gen.writeStartObject();
        gen.writeStringField("eventType", eventType);
        gen.writeStringField("groupType", groupType);
        gen.writeStringField("groupName", groupName);
        gen.writeStringField("chaosType", chaosType.getKey());

        if (StringUtils.isEmpty(eventType) || StringUtils.isEmpty(groupType) || StringUtils.isEmpty(groupName)) {
            responseStatus = Response.Status.BAD_REQUEST;
            gen.writeStringField("message", "eventType, groupType, and groupName parameters are all required");
        } else {
View Full Code Here

TOP

Related Classes of com.netflix.simianarmy.chaos.ChaosType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.