Skip to content
Snippets Groups Projects
Commit baf8972d authored by Alonso Ibarra, Juncal's avatar Alonso Ibarra, Juncal
Browse files

ADAPT monitoring M24

parent 8df826a5
No related branches found
No related tags found
No related merge requests found
Showing
with 1808 additions and 16 deletions
{
"id" : "db4630ad-00e0-4d7a-966b-44288416bf21",
"name" : "Socks-shop",
"description" : "A generic microservices application",
"version" : "0.2.2-alpha",
"highTechnologicalRisk" : false,
"nfrs" : [ {
"type" : "Performance",
"tags" : [ "Application" ],
"abstractValue" : "High",
"value" : 100.0,
"unit" : "milliseconds"
}, {
"type" : "Availability",
"tags" : [ "Application" ],
"abstractValue" : "Medium",
"value" : 98.0,
"unit" : "percentage"
} ],
"microservices" : [ {
"id" : "15f66315-bd6b-41d5-837a-a0b94e188978",
"name" : "Front-end",
"classification" : "Computing Public IP",
"stateful" : false,
"programmingLanguage" : "NodeJs",
"tags" : [ "Application" ],
"publicIP" : true,
"endpoints" : [ "http://mircroservice1.com/service" ],
"deploymentOrder" : 0,
"detachableResources" : [ {
"id" : "01420849-546d-4c34-950b-5d7171c495f5",
"name" : "none",
"db" : false,
"sql" : false,
"classification" : "storage"
} ]
}, {
"id" : "2ffa33ff-1f6f-4197-9199-48b7040386d2",
"name" : "Order",
"classification" : "Computing",
"stateful" : false,
"programmingLanguage" : "Java",
"tags" : [ "Application" ],
"publicIP" : false,
"endpoints" : [ "http://mircroservice1.com/service" ],
"deploymentOrder" : 0,
"detachableResources" : [ {
"id" : "69d265aa-fb64-43b2-934a-a87278827c9c",
"name" : "Mongo",
"db" : true,
"sql" : false,
"classification" : "db"
} ]
}, {
"id" : "71948dd0-f8d0-4bfc-b262-50dd04661013",
"name" : "Payment",
"classification" : "Computing",
"stateful" : false,
"programmingLanguage" : "Go",
"tags" : [ "Application" ],
"publicIP" : false,
"endpoints" : [ "http://mircroservice1.com/service" ],
"deploymentOrder" : 0,
"detachableResources" : [ {
"id" : "7407e313-d2fc-44a9-8830-73c85d4d17c6",
"name" : "none",
"db" : false,
"sql" : false,
"classification" : "storage"
} ]
}, {
"id" : "0b7af2fb-52d9-435a-bb99-bd2b61ffa789",
"name" : "User",
"classification" : "Computing",
"stateful" : false,
"programmingLanguage" : "Go",
"tags" : [ "Application" ],
"publicIP" : false,
"endpoints" : [ "http://mircroservice1.com/service" ],
"deploymentOrder" : 0,
"detachableResources" : [ {
"id" : "d9bf985e-1a35-4d26-a499-b2fdc6830055",
"name" : "Mongo",
"db" : true,
"sql" : false,
"classification" : "db"
} ]
}, {
"id" : "52ee44fe-dcef-479d-a6f8-2b761cc65d07",
"name" : "Catalogue",
"classification" : "Computing",
"stateful" : false,
"programmingLanguage" : "Go",
"tags" : [ "Application" ],
"publicIP" : false,
"endpoints" : [ "http://mircroservice1.com/service" ],
"deploymentOrder" : 0,
"detachableResources" : [ {
"id" : "17151dde-ec54-488c-b9f1-638fd15b2c28",
"name" : "MySQL",
"db" : true,
"sql" : true,
"classification" : "db"
} ]
}, {
"id" : "0f53359b-bb7d-43bf-9c13-e944291e9ad4",
"name" : "Cart",
"classification" : "Computing",
"stateful" : false,
"programmingLanguage" : "Java",
"tags" : [ "Application" ],
"publicIP" : false,
"endpoints" : [ "http://mircroservice1.com/service" ],
"deploymentOrder" : 0,
"detachableResources" : [ {
"id" : "b6bfeb8d-f881-4e4f-9b0c-044506fd39d4",
"name" : "Mongo",
"db" : true,
"sql" : false,
"classification" : "db"
} ]
}, {
"id" : "de5d2442-09bc-4d59-99ff-ddfe5724fa5c",
"name" : "Shipping",
"classification" : "Computing",
"stateful" : false,
"programmingLanguage" : "Java",
"tags" : [ "Application" ],
"publicIP" : false,
"endpoints" : [ "http://mircroservice1.com/service" ],
"deploymentOrder" : 0,
"detachableResources" : [ {
"id" : "c57a1fbd-d0ef-43c4-912d-5b7a5d066320",
"name" : "RabbitMQ",
"db" : false,
"sql" : false,
"classification" : "queue system"
} ]
}, {
"id" : "eabad57d-7cae-4e2b-bebf-1d95b8534f53",
"name" : "Queue-Master",
"classification" : "Computing",
"stateful" : false,
"programmingLanguage" : "Java",
"tags" : [ "Application" ],
"publicIP" : false,
"endpoints" : [ "http://mircroservice1.com/service" ],
"deploymentOrder" : 0,
"detachableResources" : [ {
"id" : "e524abef-6814-4724-bad6-4ac048c917e0",
"name" : "none",
"db" : false,
"sql" : false,
"classification" : "storage"
} ]
} ],
"mcsla" : {
"sla" : {
"description" : "SockShop App Service Level Agreement",
"validityPeriod" : 0,
"objectives" : [ {
"termName" : "Availability",
"type" : "slo",
"value" : "99.8",
"unit" : "percentage",
"conditionStatement" : "greaterOrEqual",
"metrics" : [ {
"id" : "CSA_AV_001",
"scale" : "ratio",
"expression" : {
"expression" : "AVAILABILITY_AGGREGATION_SUMTYPE",
"expressionLanguage" : "predefined",
"unit" : "percentage"
},
"underlyingMetrics" : [ {
"id" : "15f66315-bd6b-41d5-837a-a0b94e188978",
"scale" : "ratio",
"expression" : {
"expression" : "AVAILABILITY_MTBFMTTR",
"expressionLanguage" : "predefined",
"unit" : "percentage"
}
}, {
"id" : "2ffa33ff-1f6f-4197-9199-48b7040386d2",
"scale" : "ratio",
"expression" : {
"expression" : "AVAILABILITY_MTBFMTTR",
"expressionLanguage" : "predefined",
"unit" : "percentage"
}
}, {
"id" : "71948dd0-f8d0-4bfc-b262-50dd04661013",
"scale" : "ratio",
"expression" : {
"expression" : "AVAILABILITY_MTBFMTTR",
"expressionLanguage" : "predefined",
"unit" : "percentage"
}
}, {
"id" : "0b7af2fb-52d9-435a-bb99-bd2b61ffa789",
"scale" : "ratio",
"expression" : {
"expression" : "AVAILABILITY_MTBFMTTR",
"expressionLanguage" : "predefined",
"unit" : "percentage"
}
}, {
"id" : "52ee44fe-dcef-479d-a6f8-2b761cc65d07",
"scale" : "ratio",
"expression" : {
"expression" : "AVAILABILITY_MTBFMTTR",
"expressionLanguage" : "predefined",
"unit" : "percentage"
}
}, {
"id" : "0f53359b-bb7d-43bf-9c13-e944291e9ad4",
"scale" : "ratio",
"expression" : {
"expression" : "AVAILABILITY_MTBFMTTR",
"expressionLanguage" : "predefined",
"unit" : "percentage"
}
}, {
"id" : "de5d2442-09bc-4d59-99ff-ddfe5724fa5c",
"scale" : "ratio",
"expression" : {
"expression" : "AVAILABILITY_MTBFMTTR",
"expressionLanguage" : "predefined",
"unit" : "percentage"
}
}, {
"id" : "eabad57d-7cae-4e2b-bebf-1d95b8534f53",
"scale" : "ratio",
"expression" : {
"expression" : "AVAILABILITY_MTBFMTTR",
"expressionLanguage" : "predefined",
"unit" : "percentage"
}
} ]
} ]
}, {
"termName" : "Performance",
"type" : "slo",
"value" : "300.0",
"unit" : "millisecond",
"conditionStatement" : "lessOrEqual",
"metrics" : [ {
"id" : "CSA_PE_001",
"scale" : "ratio",
"expression" : {
"expression" : "AGGREGATION_MAXTYPE",
"expressionLanguage" : "predefined",
"unit" : "millisecond"
}
} ]
}, {
"termName" : "Location",
"type" : "sqo",
"value" : "europe",
"conditionStatement" : "equal"
}, {
"termName" : "Scalability",
"type" : "sqo",
"value" : "messageCount",
"conditionStatement" : "equal"
}, {
"termName" : "Cost",
"type" : "slo",
"value" : "10000.0",
"unit" : "euro",
"conditionStatement" : "less",
"metrics" : [ {
"id" : "CSA_CO_001",
"scale" : "ratio",
"expression" : {
"expression" : "AGGREGATION_SUMTYPE",
"expressionLanguage" : "predefined",
"unit" : "euro"
}
} ]
} ]
},
"csSlas" : {
"15" : {
"description" : "C8_Germany",
"validityPeriod" : 0,
"coveredServices" : [ "Virtual Machine" ],
"objectives" : [ {
"termName" : "Region",
"type" : "sqo",
"value" : "Europe",
"conditionStatement" : "equal",
"metrics" : [ {
"id" : "CS15_001",
"descriptor" : "Location based on continents",
"scale" : "nominal",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "english"
}
} ]
}, {
"termName" : "Zone",
"type" : "sqo",
"value" : "Germany",
"conditionStatement" : "equal",
"metrics" : [ {
"id" : "CS15_001",
"descriptor" : "Location based on countries",
"scale" : "nominal",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "english"
}
} ]
}, {
"termName" : "Provider",
"type" : "sqo",
"value" : "Arsys",
"conditionStatement" : "equal",
"metrics" : [ {
"id" : "CS15_001",
"descriptor" : "Name of the cloud service provider",
"scale" : "nominal",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "english"
}
} ]
}, {
"termName" : "Availability",
"type" : "slo",
"value" : "99.9",
"unit" : "percentage",
"conditionStatement" : "greaterOrEqual",
"metrics" : [ {
"id" : "CS15_001",
"descriptor" : "Uptime during a time period",
"scale" : "ratio",
"expression" : {
"expression" : "AVAILABILITY_UPTIME_BC",
"expressionLanguage" : "predefined",
"unit" : "percentage"
}
} ]
}, {
"comment" : "Response time: Virtual Machine Performance",
"termName" : "Performance",
"type" : "slo",
"value" : "2",
"unit" : "millisecond",
"conditionStatement" : "lessOrEqual",
"metrics" : [ {
"id" : "CS15_001",
"descriptor" : "Response time for a request",
"scale" : "interval",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "predefined",
"unit" : "millisecond"
}
} ]
}, {
"comment" : "Legal Level/Certifications",
"termName" : "Legal Level",
"type" : "sqo",
"value" : "Legal Level 2",
"conditionStatement" : "equal",
"metrics" : [ {
"id" : "CS15_001",
"descriptor" : "Pre defined legal levels",
"scale" : "ordinal",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "english"
}
} ]
}, {
"termName" : "Cost",
"type" : "slo",
"value" : "150",
"unit" : "euro",
"conditionStatement" : "less",
"metrics" : [ {
"id" : "CS15_001",
"descriptor" : "Cost limitation",
"scale" : "ratio",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "predefined"
}
} ]
} ]
},
"28" : {
"description" : "g3.8xlarge",
"validityPeriod" : 0,
"coveredServices" : [ "Virtual Machine" ],
"objectives" : [ {
"termName" : "Region",
"type" : "sqo",
"value" : "North America",
"conditionStatement" : "equal",
"metrics" : [ {
"id" : "CS28_001",
"descriptor" : "Location based on continents",
"scale" : "nominal",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "english"
}
} ]
}, {
"termName" : "Zone",
"type" : "sqo",
"value" : "United States",
"conditionStatement" : "equal",
"metrics" : [ {
"id" : "CS28_001",
"descriptor" : "Location based on countries",
"scale" : "nominal",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "english"
}
} ]
}, {
"termName" : "Provider",
"type" : "sqo",
"value" : "Amazon",
"conditionStatement" : "equal",
"metrics" : [ {
"id" : "CS28_001",
"descriptor" : "Name of the cloud service provider",
"scale" : "nominal",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "english"
}
} ]
}, {
"termName" : "Availability",
"type" : "slo",
"value" : "99.8",
"unit" : "percentage",
"conditionStatement" : "greaterOrEqual",
"metrics" : [ {
"id" : "CS28_001",
"descriptor" : "Uptime during a time period",
"scale" : "ratio",
"expression" : {
"expression" : "AVAILABILITY_UPTIME_BC",
"expressionLanguage" : "predefined",
"unit" : "percentage"
}
} ]
}, {
"comment" : "Response time: Virtual Machine Performance",
"termName" : "Performance",
"type" : "slo",
"value" : "2",
"unit" : "millisecond",
"conditionStatement" : "lessOrEqual",
"metrics" : [ {
"id" : "CS28_001",
"descriptor" : "Response time for a request",
"scale" : "interval",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "predefined",
"unit" : "millisecond"
}
} ]
}, {
"comment" : "Legal Level/Certifications",
"termName" : "Legal Level",
"type" : "sqo",
"value" : "Legal Level 2",
"conditionStatement" : "equal",
"metrics" : [ {
"id" : "CS28_001",
"descriptor" : "Pre defined legal levels",
"scale" : "ordinal",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "english"
}
} ]
}, {
"termName" : "Cost",
"type" : "slo",
"value" : "2209",
"unit" : "euro",
"conditionStatement" : "less",
"metrics" : [ {
"id" : "CS28_001",
"descriptor" : "Cost limitation",
"scale" : "ratio",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "predefined"
}
} ]
} ]
},
"38" : {
"description" : "A2v2",
"validityPeriod" : 0,
"coveredServices" : [ "Virtual Machine" ],
"objectives" : [ {
"termName" : "Region",
"type" : "sqo",
"value" : "Europe",
"conditionStatement" : "equal",
"metrics" : [ {
"id" : "CS38_001",
"descriptor" : "Location based on continents",
"scale" : "nominal",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "english"
}
} ]
}, {
"termName" : "Zone",
"type" : "sqo",
"value" : "Ireland",
"conditionStatement" : "equal",
"metrics" : [ {
"id" : "CS38_001",
"descriptor" : "Location based on countries",
"scale" : "nominal",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "english"
}
} ]
}, {
"termName" : "Provider",
"type" : "sqo",
"value" : "Azure",
"conditionStatement" : "equal",
"metrics" : [ {
"id" : "CS38_001",
"descriptor" : "Name of the cloud service provider",
"scale" : "nominal",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "english"
}
} ]
}, {
"termName" : "Availability",
"type" : "slo",
"value" : "95",
"unit" : "percentage",
"conditionStatement" : "greaterOrEqual",
"metrics" : [ {
"id" : "CS38_001",
"descriptor" : "Uptime during a time period",
"scale" : "ratio",
"expression" : {
"expression" : "AVAILABILITY_UPTIME_BC",
"expressionLanguage" : "predefined",
"unit" : "percentage"
}
} ]
}, {
"comment" : "Response time: Virtual Machine Performance",
"termName" : "Performance",
"type" : "slo",
"value" : "5",
"unit" : "millisecond",
"conditionStatement" : "lessOrEqual",
"metrics" : [ {
"id" : "CS38_001",
"descriptor" : "Response time for a request",
"scale" : "interval",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "predefined",
"unit" : "millisecond"
}
} ]
}, {
"comment" : "Legal Level/Certifications",
"termName" : "Legal Level",
"type" : "sqo",
"value" : "Legal Level 2",
"conditionStatement" : "equal",
"metrics" : [ {
"id" : "CS38_001",
"descriptor" : "Pre defined legal levels",
"scale" : "ordinal",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "english"
}
} ]
}, {
"termName" : "Cost",
"type" : "slo",
"value" : "93,60",
"unit" : "euro",
"conditionStatement" : "less",
"metrics" : [ {
"id" : "CS38_001",
"descriptor" : "Cost limitation",
"scale" : "ratio",
"expression" : {
"expression" : "EMPTY",
"expressionLanguage" : "predefined"
}
} ]
} ]
}
}
},
"containers" : [ {
"imageName" : "my-traefik",
"imageTag" : "1",
"dockerPrivateRegistryIp" : "54.221.168.175",
"dockerPrivateRegistryPort" : 8200,
"hostname" : "front-end",
"restart" : "always",
"command" : [ "--consul", "--consul.endpoint=54.221.168.175:8500", "--consul.prefix=Socks-shop/traefik" ],
"entrypoint" : [ "traefik" ],
"dockerHostNodeName" : "node-2",
"consulKvProviderNodeName" : "node-1",
"addConsulService" : 1,
"consulServicePort" : 80,
"addConsulTraefikRules" : 0,
"portMapping" : [ {
"hostPort" : "80",
"containerPort" : "80"
}, {
"hostPort" : "8082",
"containerPort" : "8082"
}, {
"hostPort" : "9411",
"containerPort" : "9411"
} ],
"endpoints" : [ {
"protocol" : "http",
"port" : 80
} ],
"dockerPrivateRegistryPassword" : "d3cid3",
"containerName" : "traefik-private",
"dockerPrivateRegistryUser" : "decide-user"
}, {
"imageName" : "weaveworksdemos/catalogue",
"imageTag" : "latest",
"hostname" : "catalogue",
"restart" : "always",
"dockerHostNodeName" : "node-2",
"networks" : [ "catalogue-network" ],
"environment" : [ "ZIPKIN=http://TBD_zipkin-ip:8493/api/v1/spans" ],
"consulKvProviderNodeName" : "node-1",
"addConsulService" : 1,
"consulServicePort" : 8480,
"addConsulTraefikRules" : 1,
"portMapping" : [ {
"hostPort" : "8480",
"containerPort" : "80"
} ],
"endpoints" : [ {
"protocol" : "http",
"port" : 8480
} ],
"containerName" : "catalogue"
}, {
"imageName" : "weaveworksdemos/catalogue-db",
"imageTag" : "latest",
"hostname" : "catalogue-db",
"restart" : "always",
"dockerHostNodeName" : "node-2",
"networks" : [ "catalogue-network" ],
"environment" : [ "MYSQL_ROOT_PASSWORD=$${MYSQL_ROOT_PASSWORD}", "MYSQL_ALLOW_EMPTY_PASSWORD=true", "MYSQL_DATABASE=socksdb" ],
"containerName" : "catalogue-db"
}, {
"imageName" : "weaveworksdemos/user-db",
"imageTag" : "latest",
"hostname" : "user-db",
"restart" : "always",
"dockerHostNodeName" : "node-1",
"networks" : [ "user-network" ],
"containerName" : "user-db"
}, {
"imageName" : "weaveworksdemos/user",
"imageTag" : "latest",
"hostname" : "user",
"restart" : "always",
"dockerHostNodeName" : "node-1",
"networks" : [ "user-network" ],
"environment" : [ "MONGO_HOST=user-db:27017" ],
"consulKvProviderNodeName" : "node-1",
"addConsulService" : 1,
"consulServicePort" : 8485,
"addConsulTraefikRules" : 1,
"portMapping" : [ {
"hostPort" : "8485",
"containerPort" : "80"
} ],
"endpoints" : [ {
"protocol" : "http",
"port" : 8485
} ],
"containerName" : "user",
"hostMapping" : [ {
"ip" : "",
"referencedContainerName" : "traefik-private",
"host" : "zipkin"
} ]
}, {
"imageName" : "mongo",
"imageTag" : "latest",
"hostname" : "carts-db",
"restart" : "always",
"dockerHostNodeName" : "node-1",
"networks" : [ "carts-network" ],
"containerName" : "carts-db"
}, {
"imageName" : "weaveworksdemos/carts",
"imageTag" : "latest",
"hostname" : "user",
"restart" : "always",
"dockerHostNodeName" : "node-1",
"networks" : [ "carts-network" ],
"environment" : [ "JAVA_OPTS=-Xms64m -Xmx128m -XX:PermSize=32m -XX:MaxPermSize=64m -XX:+UseG1GC -Djava.security.egd=file:/dev/urandom", "ZIPKIN=TBD_traefik-ip" ],
"consulKvProviderNodeName" : "node-1",
"addConsulService" : 1,
"consulServicePort" : 8481,
"addConsulTraefikRules" : 1,
"portMapping" : [ {
"hostPort" : "8481",
"containerPort" : "80"
} ],
"endpoints" : [ {
"protocol" : "http",
"port" : 8481
} ],
"containerName" : "carts"
}, {
"imageName" : "openzipkin/zipkin",
"imageTag" : "latest",
"hostname" : "zipkin",
"restart" : "always",
"dockerHostNodeName" : "node-1",
"environment" : [ "reschedule=on-node-failure" ],
"addConsulService" : 1,
"consulServicePort" : 9411,
"addConsulTraefikRules" : 1,
"portMapping" : [ {
"hostPort" : "8493",
"containerPort" : "9411"
} ],
"endpoints" : [ {
"protocol" : "http",
"port" : 9411
} ],
"containerName" : "zipkin"
}, {
"imageName" : "weaveworksdemos/front-end",
"imageTag" : "latest",
"hostname" : "front-end",
"restart" : "always",
"dockerHostNodeName" : "node-2",
"addConsulService" : 1,
"consulServicePort" : 8479,
"addConsulTraefikRules" : 1,
"portMapping" : [ {
"hostPort" : "8479",
"containerPort" : "8079"
} ],
"endpoints" : [ {
"protocol" : "http",
"port" : 8479,
"skipRule" : 1,
"containerNameOverride" : "shop-front-end"
} ],
"containerName" : "front-end",
"hostMapping" : [ {
"ip" : "",
"referencedContainerName" : "traefik-private",
"host" : "catalogue"
}, {
"ip" : "",
"referencedContainerName" : "traefik-private",
"host" : "carts"
}, {
"ip" : "",
"referencedContainerName" : "traefik-private",
"host" : "user"
}, {
"ip" : "",
"referencedContainerName" : "zipkin",
"host" : "zipkin"
} ]
}, {
"imageName" : "weaveworksdemos/shipping",
"imageTag" : "latest",
"hostname" : "shipping",
"restart" : "always",
"dockerHostNodeName" : "node-2",
"networks" : [ "shipping-network" ],
"environment" : [ "ZIPKIN=http://TBD_zipkin-ip}" ],
"consulKvProviderNodeName" : "node-1",
"addConsulService" : 1,
"consulServicePort" : 8483,
"addConsulTraefikRules" : 1,
"portMapping" : [ {
"hostPort" : "8483",
"containerPort" : "80"
} ],
"endpoints" : [ {
"protocol" : "http",
"port" : 8483
} ],
"containerName" : "shipping"
}, {
"imageName" : "weaveworksdemos/queue-master",
"imageTag" : "latest",
"hostname" : "queue-master",
"restart" : "always",
"dockerHostNodeName" : "node-2",
"networks" : [ "shipping-network" ],
"volumeMapping" : [ {
"hostPath" : "/var/run/docker.sock",
"containerPath" : "/var/run/docker.sock"
} ],
"containerName" : "queue-master"
}, {
"imageName" : "rabbitmq",
"imageTag" : "3.6.8",
"hostname" : "rabbitmq",
"restart" : "always",
"dockerHostNodeName" : "node-2",
"networks" : [ "shipping-network" ],
"containerName" : "rabbitmq"
}, {
"imageName" : "weaveworksdemos/orders",
"imageTag" : "latest",
"hostname" : "orders",
"restart" : "always",
"dockerHostNodeName" : "node-2",
"networks" : [ "orders-network" ],
"environment" : [ "ZIPKIN=http://TBD_zipkin-ip}" ],
"consulKvProviderNodeName" : "node-1",
"addConsulService" : 1,
"consulServicePort" : 8482,
"addConsulTraefikRules" : 1,
"portMapping" : [ {
"hostPort" : "8482",
"containerPort" : "80"
} ],
"endpoints" : [ {
"protocol" : "http",
"port" : 8482
} ],
"containerName" : "orders"
}, {
"imageName" : "mongo",
"imageTag" : "latest",
"hostname" : "orders-db",
"restart" : "always",
"dockerHostNodeName" : "node-2",
"networks" : [ "orders-network" ],
"containerName" : "orders-db"
}, {
"imageName" : "weaveworksdemos/payment",
"imageTag" : "latest",
"hostname" : "payment",
"restart" : "always",
"dockerHostNodeName" : "node-2",
"environment" : [ "ZIPKIN=http://TBD_zipkin-ip}", "reschedule=on-node-failure" ],
"consulKvProviderNodeName" : "node-1",
"addConsulService" : 1,
"consulServicePort" : 8484,
"addConsulTraefikRules" : 1,
"portMapping" : [ {
"hostPort" : "8484",
"containerPort" : "80"
} ],
"endpoints" : [ {
"protocol" : "http",
"port" : 8484
} ],
"containerName" : "payment"
} ],
"virtualMachines" : [ {
"vmSoftwareId" : "21b7ebed-5076-43b6-8351-0e06cf16eedc",
"vmResourceId" : "27b1fb7b-2fd9-4042-8902-e4996e0bc420",
"vmRegionId" : "d112253a-951f-417a-a1f1-3a892bf35a45",
"instanceTypeId" : "f554e8a1-29d8-48e5-bd68-c01417576628",
"keyPairId" : "dbe5cc42-1f33-4ca4-b761-aec1c46a76fe",
"dockerPrivateRegistryIp" : "54.221.168.175",
"dockerHostNodeName" : "node-1",
"dockerHostPublicIp" : "82.223.100.123",
"vmUser" : "root",
"openedPort" : "22,80,8000-9000,9411",
"dockerPrivateRegistryPort" : "8200"
}, {
"vmSoftwareId" : "21b7ebed-5076-43b6-8351-0e06cf16eedc",
"vmResourceId" : "27b1fb7b-2fd9-4042-8902-e4996e0bc420",
"vmRegionId" : "d112253a-951f-417a-a1f1-3a892bf35a45",
"instanceTypeId" : "f554e8a1-29d8-48e5-bd68-c01417576628",
"keyPairId" : "dbe5cc42-1f33-4ca4-b761-aec1c46a76fe",
"dockerPrivateRegistryIp" : "54.221.168.175",
"dockerHostNodeName" : "node-2",
"dockerHostPublicIp" : "82.223.2.216",
"vmUser" : "root",
"openedPort" : "22,80,8000-9000,9411",
"dockerPrivateRegistryPort" : "8200"
} ],
"recommendedPatterns" : [ {
"title" : "Resiliency Management Process",
"uriRef" : "http://decideh2020.eu/resources/patterns/resiliency-management-process",
"tags" : [ "Application" ],
"positiveImpacts" : [ "availability" ],
"categories" : [ "optimization" ],
"selected" : true
}, {
"title" : "Compliant Data Replication",
"uriRef" : "http://decideh2020.eu/resources/patterns/compliant-data-replication",
"tags" : [ "Application" ],
"positiveImpacts" : [ "location" ],
"categories" : [ "optimization", "deployment" ],
"selected" : true
}, {
"title" : "Elasticity Manager",
"uriRef" : "http://decideh2020.eu/resources/patterns/elasticity-manager",
"tags" : [ "Application" ],
"positiveImpacts" : [ "scalability" ],
"categories" : [ "deployment" ],
"selected" : true
} ],
"schema" : [ {
"microservices" : [ "[15f66315-bd6b-41d5-837a-a0b94e188978", " 2ffa33ff-1f6f-4197-9199-48b7040386d2", " 69d265aa-fb64-43b2-934a-a87278827c9c", " 71948dd0-f8d0-4bfc-b262-50dd04661013", " 52ee44fe-dcef-479d-a6f8-2b761cc65d07", " 17151dde-ec54-488c-b9f1-638fd15b2c28", " de5d2442-09bc-4d59-99ff-ddfe5724fa5c", " c57a1fbd-d0ef-43c4-912d-5b7a5d066320", " eabad57d-7cae-4e2b-bebf-1d95b8534f53]" ],
"csId" : "56",
"index" : 1689678579
}, {
"microservices" : [ "[0b7af2fb-52d9-435a-bb99-bd2b61ffa789", " d9bf985e-1a35-4d26-a499-b2fdc6830055", " 0f53359b-bb7d-43bf-9c13-e944291e9ad4", " b6bfeb8d-f881-4e4f-9b0c-044506fd39d4]" ],
"csId" : "55",
"index" : 1689679104
} ],
"monitoring" : {
"status" : true,
"urls" : [ "http://85.91.40.245:8093" ]
},
"applicationInstanceId" : "f6229960-201c-4f56-af96-b4659a95299d",
"consulJoinIp" : "54.221.168.175"
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>eu.decideh2020.adapt.monitoring.server</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
2.3.1
\ No newline at end of file
# Swagger Jersey generated server
## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This
is an example of building a swagger-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
To run the server, please execute the following:
```
mvn clean package jetty:run
```
You can then view the swagger listing here:
```
http://localhost:8080/monitoringmanager/swagger.json
```
Note that if you have configured the `host` to be something other than localhost, the calls through
swagger-ui will be directed to that host and not localhost!
\ No newline at end of file
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
<groupId>eu.decideh2020</groupId> <groupId>eu.decideh2020</groupId>
<artifactId>seu.decideh2020.adapt.monitoring.server</artifactId> <artifactId>seu.decideh2020.adapt.monitoring.server</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>swagger-jaxrs-server</name> <name>adapt.monitoring.server</name>
<version>1.0.0</version> <version>1.0.0</version>
<licenses> <licenses>
<license> <license>
<name>Unlicense</name> <name>Unlicense</name>
...@@ -13,7 +12,6 @@ ...@@ -13,7 +12,6 @@
<distribution>repo</distribution> <distribution>repo</distribution>
</license> </license>
</licenses> </licenses>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>
<plugins> <plugins>
...@@ -99,6 +97,21 @@ ...@@ -99,6 +97,21 @@
</resources> </resources>
</build> </build>
<dependencies> <dependencies>
<!-- <dependency>
<groupId>eu.decideh2020</groupId>
<artifactId>eu.decideh2020.ACSmI.monitoring.client</artifactId>
<version>1.0.0</version>
</dependency>-->
<!-- <dependency>
<groupId>eu.decideh2020</groupId>
<artifactId>eu.decideh2020.ACSmI.monitoring.client</artifactId>
<version>1.0.0</version>
</dependency>-->
<dependency>
<groupId>eu.decideh2020</groupId>
<artifactId>eu.decideh2020.telegraf.configparser</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>eu.DECIDEh2020</groupId> <groupId>eu.DECIDEh2020</groupId>
<artifactId>mcsla-core</artifactId> <artifactId>mcsla-core</artifactId>
...@@ -151,12 +164,12 @@ ...@@ -151,12 +164,12 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.datatype</groupId> <groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId> <artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-version}</version> <version>${jackson-jaxrs-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId> <groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId> <artifactId>jackson-jaxrs-json-provider</artifactId>
<version>${jackson-version}</version> <version>${jackson-jaxrs-version}</version>
</dependency> </dependency>
<!-- Base64 encoding that works in both JVM and Android --> <!-- Base64 encoding that works in both JVM and Android -->
<dependency> <dependency>
...@@ -187,10 +200,12 @@ ...@@ -187,10 +200,12 @@
<java.version>1.7</java.version> <java.version>1.7</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.15</swagger-core-version> <swagger-core-version>1.5.18</swagger-core-version>
<jetty-version>9.2.9.v20150224</jetty-version> <jetty-version>9.2.9.v20150224</jetty-version>
<jersey2-version>2.22.2</jersey2-version> <jersey2-version>2.22.2</jersey2-version>
<jackson-version>2.8.9</jackson-version> <cxf-version>3.1.11</cxf-version>
<!-- <jackson-version>2.8.9</jackson-version> -->
<jackson-jaxrs-version>2.9.1</jackson-jaxrs-version>
<junit-version>4.12</junit-version> <junit-version>4.12</junit-version>
<logback-version>1.1.7</logback-version> <logback-version>1.1.7</logback-version>
<servlet-api-version>2.5</servlet-api-version> <servlet-api-version>2.5</servlet-api-version>
......
package eu.decideh2020.adapt.monitoring.server.api;
import io.swagger.annotations.ApiParam;
import io.swagger.jaxrs.*;
import java.util.Map;
import java.util.List;
import java.io.InputStream;
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.glassfish.jersey.media.multipart.FormDataParam;
import eu.decideh2020.adapt.monitoring.server.api.ApiApiService;
import eu.decideh2020.adapt.monitoring.server.api.NotFoundException;
import eu.decideh2020.adapt.monitoring.server.api.factories.ApiApiServiceFactory;
import eu.decideh2020.adapt.monitoring.server.model.*;
import javax.servlet.ServletConfig;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.*;
import javax.validation.constraints.*;
@Path("/api")
@io.swagger.annotations.Api(description = "the api API")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-03-26T08:06:54.399Z")
public class ApiApi {
private final ApiApiService delegate;
public ApiApi(@Context ServletConfig servletContext) {
ApiApiService delegate = null;
if (servletContext != null) {
String implClass = servletContext.getInitParameter("ApiApi.implementation");
if (implClass != null && !"".equals(implClass.trim())) {
try {
delegate = (ApiApiService) Class.forName(implClass).newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
if (delegate == null) {
delegate = ApiApiServiceFactory.getApiApi();
}
this.delegate = delegate;
}
@POST
@Path("/alert")
@Consumes({ "alert/json" })
@Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "createAlert", notes = "Creates an alert to be included in ADAPT monitoring", response = Alert.class, tags={ "alert", })
@io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "Alert Created", response = Alert.class),
@io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized", response = Void.class) })
public Response createAlertUsingPOST(@ApiParam(value = "" ,required=true) Alert alert
,@Context SecurityContext securityContext)
throws NotFoundException {
return delegate.createAlertUsingPOST(alert,securityContext);
}
@POST
@Path("/applications")
@Consumes({ "application/json" })
@Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "createApplication", notes = "Creates an application to be included in ADAPT monitoring", response = Application.class, tags={ "application", })
@io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "Application monitoring Created", response = Application.class),
@io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
@io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden", response = Void.class),
@io.swagger.annotations.ApiResponse(code = 404, message = "Not Found", response = Void.class) })
public Response createApplicationUsingPOST(@ApiParam(value = "" ,required=true) Application application
,@Context SecurityContext securityContext)
throws NotFoundException {
return delegate.createApplicationUsingPOST(application,securityContext);
}
@DELETE
@Path("/applications/{appdescuri}")
@Consumes({ "application/json" })
@Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "deleteApplication", notes = "", response = Void.class, tags={ "application", })
@io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "App deleted form the monitoring list", response = Void.class),
@io.swagger.annotations.ApiResponse(code = 204, message = "No Content", response = Void.class),
@io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
@io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden", response = Void.class) })
public Response deleteApplicationUsingDELETE(@ApiParam(value = "id",required=true) @PathParam("appdescuri") String appdescuri
,@Context SecurityContext securityContext)
throws NotFoundException {
return delegate.deleteApplicationUsingDELETE(appdescuri,securityContext);
}
@GET
@Path("/applications")
@Consumes({ "application/json" })
@Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "getAllApplications", notes = "Gets the list of all the applications in ADAPT monitoring, including their id and the status", response = Application.class, responseContainer = "List", tags={ "application", })
@io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "the list of simulations is being returned", response = Application.class, responseContainer = "List"),
@io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
@io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden", response = Void.class),
@io.swagger.annotations.ApiResponse(code = 404, message = "Not Found", response = Void.class) })
public Response getAllApplicationsUsingGET(@Context SecurityContext securityContext)
throws NotFoundException {
return delegate.getAllApplicationsUsingGET(securityContext);
}
@GET
@Path("/applications/{appdescuri}")
@Consumes({ "application/json" })
@Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "getApplicationstatus", notes = "Gets the status wrt monitoring of a given application", response = Application.class, tags={ "application", })
@io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "Specific app monitoring is returned", response = Application.class),
@io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
@io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden", response = Void.class),
@io.swagger.annotations.ApiResponse(code = 404, message = "Not Found", response = Void.class) })
public Response getApplicationUsingGET(@ApiParam(value = "id",required=true) @PathParam("appdescuri") String appdescuri
,@Context SecurityContext securityContext)
throws NotFoundException {
return delegate.getApplicationUsingGET(appdescuri,securityContext);
}
@PUT
@Path("/applications/{appdescuri}")
@Consumes({ "application/json" })
@Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "updateApplication", notes = "Updates the monitoring status of a given application", response = Application.class, tags={ "application", })
@io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "Status updated", response = Application.class),
@io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
@io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden", response = Void.class),
@io.swagger.annotations.ApiResponse(code = 404, message = "Not Found", response = Void.class) })
public Response updateApplicationUsingPUT(@ApiParam(value = "id",required=true) @PathParam("appdescuri") String appdescuri
,@Context SecurityContext securityContext)
throws NotFoundException {
return delegate.updateApplicationUsingPUT(appdescuri,securityContext);
}
}
package eu.decideh2020.adapt.monitoring.server.api;
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import eu.decideh2020.adapt.monitoring.server.api.*;
import eu.decideh2020.adapt.monitoring.server.model.*;
import java.util.List;
import java.io.InputStream;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.validation.constraints.*;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-03-26T08:06:54.399Z")
public abstract class ApiApiService {
public abstract Response createAlertUsingPOST(Alert alert,SecurityContext securityContext) throws NotFoundException;
public abstract Response createApplicationUsingPOST(Application application,SecurityContext securityContext) throws NotFoundException;
public abstract Response deleteApplicationUsingDELETE(String appdescuri,SecurityContext securityContext) throws NotFoundException;
public abstract Response getAllApplicationsUsingGET(SecurityContext securityContext) throws NotFoundException;
public abstract Response getApplicationUsingGET(String appdescuri,SecurityContext securityContext) throws NotFoundException;
public abstract Response updateApplicationUsingPUT(String appdescuri,SecurityContext securityContext) throws NotFoundException;
}
package eu.decideh2020.adapt.monitoring.server.api;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-05-15T15:32:55.738Z")
public class ApiException extends Exception{
private int code;
public ApiException (int code, String msg) {
super(msg);
this.code = code;
}
}
package eu.decideh2020.adapt.monitoring.server.api;
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-05-15T15:32:55.738Z")
public class ApiOriginFilter implements javax.servlet.Filter {
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse res = (HttpServletResponse) response;
res.addHeader("Access-Control-Allow-Origin", "*");
res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
res.addHeader("Access-Control-Allow-Headers", "Content-Type");
chain.doFilter(request, response);
}
public void destroy() {}
public void init(FilterConfig filterConfig) throws ServletException {}
}
\ No newline at end of file
package eu.decideh2020.adapt.monitoring.server.api;
import javax.xml.bind.annotation.XmlTransient;
@javax.xml.bind.annotation.XmlRootElement
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-05-15T15:32:55.738Z")
public class ApiResponseMessage {
public static final int ERROR = 1;
public static final int WARNING = 2;
public static final int INFO = 3;
public static final int OK = 4;
public static final int TOO_BUSY = 5;
int code;
String type;
String message;
public ApiResponseMessage(){}
public ApiResponseMessage(int code, String message){
this.code = code;
switch(code){
case ERROR:
setType("error");
break;
case WARNING:
setType("warning");
break;
case INFO:
setType("info");
break;
case OK:
setType("ok");
break;
case TOO_BUSY:
setType("too busy");
break;
default:
setType("unknown");
break;
}
this.message = message;
}
@XmlTransient
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package eu.decideh2020.adapt.monitoring.server.api;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.joda.*;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.Provider;
@Provider
@Produces({MediaType.APPLICATION_JSON})
public class JacksonJsonProvider extends JacksonJaxbJsonProvider {
public JacksonJsonProvider() {
ObjectMapper objectMapper = new ObjectMapper()
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.registerModule(new JodaModule())
.setDateFormat(new RFC3339DateFormat());
setMapper(objectMapper);
}
}
\ No newline at end of file
package eu.decideh2020.adapt.monitoring.server.api;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-03-26T08:06:54.399Z")
public class NotFoundException extends ApiException {
private int code;
public NotFoundException (int code, String msg) {
super(code, msg);
this.code = code;
}
}
package eu.decideh2020.adapt.monitoring.server.api;
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
import com.fasterxml.jackson.databind.util.ISO8601Utils;
import java.text.FieldPosition;
import java.util.Date;
public class RFC3339DateFormat extends ISO8601DateFormat {
// Same as ISO8601DateFormat but serializing milliseconds.
@Override
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
String value = ISO8601Utils.format(date, true);
toAppendTo.append(value);
return toAppendTo;
}
}
\ No newline at end of file
package eu.decideh2020.adapt.monitoring.server.api;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-03-26T08:06:54.399Z")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
*
* @param array The array
* @param value The value to search
* @return true if the array contains the value
*/
public static boolean containsIgnoreCase(String[] array, String value) {
for (String str : array) {
if (value == null && str == null) return true;
if (value != null && value.equalsIgnoreCase(str)) return true;
}
return false;
}
/**
* Join an array of strings with the given separator.
* <p>
* Note: This might be replaced by utility method from commons-lang or guava someday
* if one of those libraries is added as dependency.
* </p>
*
* @param array The array of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(String[] array, String separator) {
int len = array.length;
if (len == 0) return "";
StringBuilder out = new StringBuilder();
out.append(array[0]);
for (int i = 1; i < len; i++) {
out.append(separator).append(array[i]);
}
return out.toString();
}
}
/*
* adapt monitoring API
* adapt monitoring API documentation.This API describes the methods to access the ADAPT monitoring functionalities
*
* OpenAPI spec version: 0.0.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package eu.decideh2020.adapt.monitoring.server.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* Alert
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-05-02T12:11:42.283Z")
public class Alert {
@JsonProperty("alid")
private String alid = null;
@JsonProperty("altype")
private String altype = null;
@JsonProperty("appdescuri")
private String appdescuri = null;
public Alert alid(String alid) {
this.alid = alid;
return this;
}
/**
* Get alid
* @return alid
**/
@JsonProperty("alid")
@ApiModelProperty(required = true, value = "")
@NotNull
public String getAlid() {
return alid;
}
public void setAlid(String alid) {
this.alid = alid;
}
public Alert altype(String altype) {
this.altype = altype;
return this;
}
/**
* Get altype
* @return altype
**/
@JsonProperty("altype")
@ApiModelProperty(required = true, value = "")
@NotNull
public String getAltype() {
return altype;
}
public void setAltype(String altype) {
this.altype = altype;
}
public Alert appdescuri(String appdescuri) {
this.appdescuri = appdescuri;
return this;
}
/**
* Get appdescuri
* @return appdescuri
**/
@JsonProperty("appdescuri")
@ApiModelProperty(required = true, value = "")
@NotNull
public String getAppdescuri() {
return appdescuri;
}
public void setAppdescuri(String appdescuri) {
this.appdescuri = appdescuri;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Alert alert = (Alert) o;
return Objects.equals(this.alid, alert.alid) &&
Objects.equals(this.altype, alert.altype) &&
Objects.equals(this.appdescuri, alert.appdescuri);
}
@Override
public int hashCode() {
return Objects.hash(alid, altype, appdescuri);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Alert {\n");
sb.append(" alid: ").append(toIndentedString(alid)).append("\n");
sb.append(" altype: ").append(toIndentedString(altype)).append("\n");
sb.append(" appdescuri: ").append(toIndentedString(appdescuri)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
/*
* adapt monitoring API
* adapt monitoring API documentation This API describes the methods to access the ADAPT monitoring functionalities. This version updates de methods that need monid. In this version these methods include the appdescuri in their body
*
* OpenAPI spec version: 0.0.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package eu.decideh2020.adapt.monitoring.server.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* Application
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-03-26T08:06:54.399Z")
public class Application {
@JsonProperty("monid")
private String monid = null;
@JsonProperty("appdescuri")
private String appdescuri = null;
@JsonProperty("status")
private String status = null;
@JsonProperty("user")
private String user = null;
@JsonProperty("password")
private String password = null;
public Application monid(String monid) {
this.monid = monid;
return this;
}
/**
* Get monid
* @return monid
**/
@JsonProperty("monid")
@ApiModelProperty(value = "")
public String getMonid() {
return monid;
}
public void setMonid(String monid) {
this.monid = monid;
}
public Application appdescuri(String appdescuri) {
this.appdescuri = appdescuri;
return this;
}
/**
* Get appdescuri
* @return appdescuri
**/
@JsonProperty("appdescuri")
@ApiModelProperty(required = true, value = "")
@NotNull
public String getAppdescuri() {
return appdescuri;
}
public void setAppdescuri(String appdescuri) {
this.appdescuri = appdescuri;
}
public Application status(String status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
**/
@JsonProperty("status")
@ApiModelProperty(value = "")
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Application user(String user) {
this.user = user;
return this;
}
/**
* Get user
* @return user
**/
@JsonProperty("user")
@ApiModelProperty(value = "")
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public Application password(String password) {
this.password = password;
return this;
}
/**
* Get password
* @return password
**/
@JsonProperty("password")
@ApiModelProperty(value = "")
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Application application = (Application) o;
return Objects.equals(this.monid, application.monid) &&
Objects.equals(this.appdescuri, application.appdescuri) &&
Objects.equals(this.status, application.status) &&
Objects.equals(this.user, application.user) &&
Objects.equals(this.password, application.password);
}
@Override
public int hashCode() {
return Objects.hash(monid, appdescuri, status, user, password);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Application {\n");
sb.append(" monid: ").append(toIndentedString(monid)).append("\n");
sb.append(" appdescuri: ").append(toIndentedString(appdescuri)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" user: ").append(toIndentedString(user)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
package eu.decideh2020.adapt.monitoring.server.api;
import io.swagger.jaxrs.config.SwaggerContextService;
import io.swagger.models.*;
import io.swagger.models.auth.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
public class Bootstrap extends HttpServlet {
@Override
public void init(ServletConfig config) throws ServletException {
Info info = new Info()
.title("Swagger Server")
.description("adapt monitoring API documentation")
.termsOfService("")
.contact(new Contact()
.email(""))
.license(new License()
.name("")
.url("http://unlicense.org"));
ServletContext context = config.getServletContext();
Swagger swagger = new Swagger().info(info);
new SwaggerContextService().withServletConfig(config).updateSwagger(swagger);
}
}
package eu.decideh2020.adapt.monitoring.server.api.factories;
import eu.decideh2020.adapt.monitoring.server.api.ApiApiService;
import eu.decideh2020.adapt.monitoring.server.api.impl.ApiApiServiceImpl;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-03-26T08:06:54.399Z")
public class ApiApiServiceFactory {
private final static ApiApiService service = new ApiApiServiceImpl();
public static ApiApiService getApiApi() {
return service;
}
}
...@@ -19,6 +19,7 @@ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT ...@@ -19,6 +19,7 @@ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*Contributors (in alphabetical order): *Contributors (in alphabetical order):
*Alberto Molinuevo Tecnalia
*Gorka Benguria Tecnalia *Gorka Benguria Tecnalia
*Iñaki Etxaniz Tecnalia *Iñaki Etxaniz Tecnalia
*Juncal Alonso Tecnalia *Juncal Alonso Tecnalia
...@@ -38,11 +39,10 @@ import javax.ws.rs.core.Response; ...@@ -38,11 +39,10 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.SecurityContext;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-03-26T08:06:54.399Z") @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-03-26T08:06:54.399Z")
public class ApiApiServiceImpl extends ApiApiService { public class ApiApiServiceImpl extends ApiApiService {
//Creating a list for the application monitoring objects //Creating a list for the application monitoring objects (check if this list is initialized every time the Post is generated), if so declare it as a static variable
ArrayList<Application> AppMonitoringlist = new ArrayList<Application>(); ArrayList<Application> AppMonitoringlist = new ArrayList<Application>();
//Creating a list for the alerts objects //Creating a list for the alerts objects
ArrayList<Alert> Alertlist = new ArrayList<Alert>(); ArrayList<Alert> Alertlist = new ArrayList<Alert>();
@Override @Override
public Response createApplicationUsingPOST(Application application, SecurityContext securityContext) throws NotFoundException { public Response createApplicationUsingPOST(Application application, SecurityContext securityContext) throws NotFoundException {
//Adds a new application to the monitoring list, visualize the application (opening a web browser) and returns the created object //Adds a new application to the monitoring list, visualize the application (opening a web browser) and returns the created object
...@@ -51,6 +51,7 @@ public class ApiApiServiceImpl extends ApiApiService { ...@@ -51,6 +51,7 @@ public class ApiApiServiceImpl extends ApiApiService {
int numero = (int) (Math.random() * 100) + 1; int numero = (int) (Math.random() * 100) + 1;
String monid=Integer.toString(numero); String monid=Integer.toString(numero);
//monid=appdescinstance (monid); //monid=appdescinstance (monid);
//Call ACSmI monitoring
//Call to configure monitoring //Call to configure monitoring
configuration currentconfiguration=new configuration(); configuration currentconfiguration=new configuration();
currentconfiguration.apply(); currentconfiguration.apply();
...@@ -62,17 +63,18 @@ public class ApiApiServiceImpl extends ApiApiService { ...@@ -62,17 +63,18 @@ public class ApiApiServiceImpl extends ApiApiService {
return Response.ok(application).build(); return Response.ok(application).build();
} }
@Override @Override
public Response deleteApplicationUsingDELETE(String appdescuri, SecurityContext securityContext) throws NotFoundException { public Response deleteApplicationUsingDELETE(String appdescinstanceid, SecurityContext securityContext) throws NotFoundException {
//Instead of giving the appdescuri , ADAPT DO should provide the appinstanceid
//Changes the current status of the element of the list to "notmonitored" //Changes the current status of the element of the list to "notmonitored"
for (int i=0;i<AppMonitoringlist.size();i++) { for (int i=0;i<AppMonitoringlist.size();i++) {
if (AppMonitoringlist.get(i).getMonid().equals(appdescuri)) { if (AppMonitoringlist.get(i).getMonid().equals(appdescinstanceid)) {
// monitoringvisualization currentvisualization= new monitoringvisualization(); //Stop the monitoring (Stop telegraf) change the App description monitoring url and status (Monitoring object) in the App description)
//currentvisualization.closevisualize(AppMonitoringlist.get(i)); Stopmonitoring stopcurrentmonitoring= new Stopmonitoring(appdescinstanceid);
//AppMonitoringlist.remove(i); //Change the status of the App Monitoring list to not monitored
AppMonitoringlist.get(i).setStatus("notmonitored"); AppMonitoringlist.get(i).setStatus("notmonitored");
} }
} }
// Returns all the AppMonitoring list
return Response.ok(AppMonitoringlist).build(); return Response.ok(AppMonitoringlist).build();
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment