blancco_erasure_report = response.getJSON("reports")
.getJSON("blancco_data").getJSON("blancco_erasure_report");
// ###################################################################
erasures = response.getJSON("reports").getJSON("blancco_data")
.getJSON("blancco_erasure_report").getJson("erasures");
// ###################################################################
erasure = response.getJSON("reports").getJSON("blancco_data").getJSON("blancco_erasure_report")
.getJson("erasures").getJson("erasure");
// ###################################################################
m = Map();
l = List();
for each erasure_info in erasure
{
if(erasure_info.contains("erasure_id"))
{
erasure_type1 = erasure_info.getJson("@type");
erasure_erasure_id = erasure_info.getJson("erasure_id");
}
if(erasure_info.contains("timestamp"))
{
erasure_type2 = erasure_info.getJson("@type");
erasure_timestamp = erasure_info.getJson("timestamp");
}
// EXTRACTION OF "TARGET" CODE BELOW
for each rec1 in erasure_info.getJson("target")
{
if(rec1.keys().tostring().remove("@type,") != {"region","supported_formats","features"})
{
l.add(rec1.keys().tostring().remove("@type,"));
}
if(rec1.keys().tostring().remove("@type,") == "region")
{
m1 = Map();
l1 = list();
//l99 = list();
for each rec3 in rec1.getjson("region")
{
l1.add(rec3.keys().tostring().remove("@type,"));
info "l: " + l;
}
m1.put("regions",l1);
l.add(m1);
}
if(rec1.keys().tostring().remove("@type,") == "features")
{
m2 = Map();
l2 = list();
for each rec4 in rec1.getjson("features")
{
l2.add(rec4.keys().tostring().remove("@type,"));
}
m2.put("features",l2);
l.add(m2);
}
if(rec1.keys().tostring().remove("@type,") == "supported_formats")
{
m3 = Map();
l3 = list();
for each rec4 in rec1.getjson("supported_formats")
{
m4 = Map();
l4 = list();
for each rec5 in rec4.getjson("format")
{
l4.add(rec5.keys().tostring().remove("@type,"));
}
m4.put("format",l4);
l3.add(m4);
}
m3.put("supported_formats",l3);
l.add(m3);
}
}
}
// PLEASE NOTE;
//info "l: " + l; // Note: "l" is the whole "target"
info "----------------------------";
//info "l1: " + l1; // Note: "l1" is the data nested inside the "region" <key>
info "----------------------------";
//info "m1: " + m1; // Note: "m1" is the whole "region"
info "----------------------------";
//info "m2: " + m2; // Note: "m2" is the whole "features"
info "----------------------------";
//info "l2: " + l2; // Note: "l2" is the data nested inside the "features" <key>
info "----------------------------";
//info "m3: " + m3; // Note: "m3" is the whole "supported_formats"
info "----------------------------";
//info "m4: " + m4; // Note: "m4" is the whole "format" nested inside "supported_formats"
info "----------------------------";
//info "l4: " + l4; // Note: "l4" is the data nested inside the "format" <key>
info "----------------------------";
// ###################################################################