Repository: jclouds-labs Updated Branches: refs/heads/master d68a2d37c -> 87c547003
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/java/org/apache/jclouds/oneandone/rest/features/MonitoringPolicyApiMockTest.java ---------------------------------------------------------------------- diff --git a/oneandone/src/test/java/org/apache/jclouds/oneandone/rest/features/MonitoringPolicyApiMockTest.java b/oneandone/src/test/java/org/apache/jclouds/oneandone/rest/features/MonitoringPolicyApiMockTest.java new file mode 100644 index 0000000..59c21de --- /dev/null +++ b/oneandone/src/test/java/org/apache/jclouds/oneandone/rest/features/MonitoringPolicyApiMockTest.java @@ -0,0 +1,543 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jclouds.oneandone.rest.features; + +import com.squareup.okhttp.mockwebserver.MockResponse; +import java.util.ArrayList; +import java.util.List; +import org.apache.jclouds.oneandone.rest.domain.MonitoringPolicy; +import org.apache.jclouds.oneandone.rest.domain.Types; +import org.apache.jclouds.oneandone.rest.domain.options.GenericQueryOptions; +import org.apache.jclouds.oneandone.rest.internal.BaseOneAndOneApiMockTest; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import org.testng.annotations.Test; + +@Test(groups = "unit", testName = "MonitoringPolicyApiMockTest", singleThreaded = true) +public class MonitoringPolicyApiMockTest extends BaseOneAndOneApiMockTest { + + private MonitoringPolicyApi monitoringPolicyApi() { + return api.monitoringPolicyApi(); + } + + @Test + public void testList() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/list.json")) + ); + + List<MonitoringPolicy> result = monitoringPolicyApi().list(); + + assertEquals(result.size(), 2); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies"); + } + + @Test + public void testList404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + + List<MonitoringPolicy> result = monitoringPolicyApi().list(); + + assertEquals(result.size(), 0); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies"); + } + + @Test + public void testListWithOption() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/list.options.json")) + ); + GenericQueryOptions options = new GenericQueryOptions(); + options.options(0, 0, null, "New", null); + List<MonitoringPolicy> result = monitoringPolicyApi().list(options); + + assertEquals(result.size(), 2); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies?q=New"); + } + + @Test + public void testListWithOption404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + + GenericQueryOptions options = new GenericQueryOptions(); + options.options(0, 0, null, "New", null); + List<MonitoringPolicy> result = monitoringPolicyApi().list(options); + + assertEquals(result.size(), 0); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies?q=New"); + } + + @Test + public void testGet() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.json")) + ); + MonitoringPolicy result = monitoringPolicyApi().get("monitoringpolicyId"); + + assertNotNull(result); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/monitoringpolicyId"); + } + + @Test + public void testGet404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + + MonitoringPolicy result = monitoringPolicyApi().get("monitoringpolicyId"); + + assertEquals(result, null); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/monitoringpolicyId"); + } + + @Test + public void testCreate() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.json")) + ); + List<MonitoringPolicy.Port.AddPort> ports = new ArrayList<MonitoringPolicy.Port.AddPort>(); + MonitoringPolicy.Port.AddPort port = MonitoringPolicy.Port.AddPort.create(80, Types.AlertIfType.RESPONDING, true, Types.ProtocolType.TCP); + ports.add(port); + List<org.apache.jclouds.oneandone.rest.domain.MonitoringPolicy.Process.AddProcess> processes = new ArrayList<org.apache.jclouds.oneandone.rest.domain.MonitoringPolicy.Process.AddProcess>(); + org.apache.jclouds.oneandone.rest.domain.MonitoringPolicy.Process.AddProcess process = org.apache.jclouds.oneandone.rest.domain.MonitoringPolicy.Process.AddProcess.create("", Types.AlertIfType.RESPONDING, true); + processes.add(process); + + MonitoringPolicy.Threshold.Cpu.Warning warning = MonitoringPolicy.Threshold.Cpu.Warning.create(90, true); + MonitoringPolicy.Threshold.Cpu.Critical critical = MonitoringPolicy.Threshold.Cpu.Critical.create(90, true); + MonitoringPolicy.Threshold.Cpu cpu = MonitoringPolicy.Threshold.Cpu.create(warning, critical); + + MonitoringPolicy.Threshold.Ram.Warning ramWarning = MonitoringPolicy.Threshold.Ram.Warning.create(90, true); + MonitoringPolicy.Threshold.Ram.Critical ramCritical = MonitoringPolicy.Threshold.Ram.Critical.create(90, true); + MonitoringPolicy.Threshold.Ram ram = MonitoringPolicy.Threshold.Ram.create(ramWarning, ramCritical); + + MonitoringPolicy.Threshold.Disk.Warning diskWarning = MonitoringPolicy.Threshold.Disk.Warning.create(90, true); + MonitoringPolicy.Threshold.Disk.Critical diskCritical = MonitoringPolicy.Threshold.Disk.Critical.create(95, true); + MonitoringPolicy.Threshold.Disk disk = MonitoringPolicy.Threshold.Disk.create(diskWarning, diskCritical); + + MonitoringPolicy.Threshold.InternalPing.Warning pingWarning = MonitoringPolicy.Threshold.InternalPing.Warning.create(90, true); + MonitoringPolicy.Threshold.InternalPing.Critical pingCritical = MonitoringPolicy.Threshold.InternalPing.Critical.create(90, true); + MonitoringPolicy.Threshold.InternalPing ping = MonitoringPolicy.Threshold.InternalPing.create(pingWarning, pingCritical); + + MonitoringPolicy.Threshold.Transfer.Warning tranWarning = MonitoringPolicy.Threshold.Transfer.Warning.create(90, true); + MonitoringPolicy.Threshold.Transfer.Critical tranCritical = MonitoringPolicy.Threshold.Transfer.Critical.create(90, true); + MonitoringPolicy.Threshold.Transfer transfer = MonitoringPolicy.Threshold.Transfer.create(tranWarning, tranCritical); + + MonitoringPolicy.Threshold threshold = MonitoringPolicy.Threshold.create(cpu, ram, disk, transfer, ping); + MonitoringPolicy.CreatePolicy payload = MonitoringPolicy.CreatePolicy.builder() + .name("name") + .agent(true) + .email("email") + .ports(ports) + .processes(processes) + .description("dsec") + .thresholds(threshold) + .build(); + MonitoringPolicy response = monitoringPolicyApi().create(payload); + + assertNotNull(response); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "POST", "/monitoring_policies", "{\"name\":\"name\",\"description\":\"dsec\",\"email\":\"email\",\"agent\":true," + + "\"thresholds\":{\"cpu\":{\"warning\":{\"value\":90,\"alert\":true},\"critical\":{\"value\":90,\"alert\":true}}," + + "\"ram\":{\"warning\":{\"value\":90,\"alert\":true},\"critical\":{\"value\":90,\"alert\":true}}," + + "\"disk\":{\"warning\":{\"value\":90,\"alert\":true},\"critical\":{\"value\":95,\"alert\":true}}," + + "\"transfer\":{\"warning\":{\"value\":90,\"alert\":true},\"critical\":{\"value\":90,\"alert\":true}}," + + "\"internal_ping\":{\"warning\":{\"value\":90,\"alert\":true},\"critical\":{\"value\":90,\"alert\":true}}}," + + "\"ports\":[{\"port\":80,\"alert_if\":\"RESPONDING\",\"email_notification\":true,\"protocol\":\"TCP\"}]," + + "\"processes\":[{\"process\":\"\",\"alert_if\":\"RESPONDING\",\"email_notification\":true}]}"); + } + + @Test + public void testUpdate() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.json")) + ); + + MonitoringPolicy.Threshold.Cpu.Warning warning = MonitoringPolicy.Threshold.Cpu.Warning.create(90, true); + MonitoringPolicy.Threshold.Cpu.Critical critical = MonitoringPolicy.Threshold.Cpu.Critical.create(90, true); + MonitoringPolicy.Threshold.Cpu cpu = MonitoringPolicy.Threshold.Cpu.create(warning, critical); + + MonitoringPolicy.Threshold.Ram.Warning ramWarning = MonitoringPolicy.Threshold.Ram.Warning.create(90, true); + MonitoringPolicy.Threshold.Ram.Critical ramCritical = MonitoringPolicy.Threshold.Ram.Critical.create(90, true); + MonitoringPolicy.Threshold.Ram ram = MonitoringPolicy.Threshold.Ram.create(ramWarning, ramCritical); + + MonitoringPolicy.Threshold.Disk.Warning diskWarning = MonitoringPolicy.Threshold.Disk.Warning.create(90, true); + MonitoringPolicy.Threshold.Disk.Critical diskCritical = MonitoringPolicy.Threshold.Disk.Critical.create(95, true); + MonitoringPolicy.Threshold.Disk disk = MonitoringPolicy.Threshold.Disk.create(diskWarning, diskCritical); + + MonitoringPolicy.Threshold.InternalPing.Warning pingWarning = MonitoringPolicy.Threshold.InternalPing.Warning.create(90, true); + MonitoringPolicy.Threshold.InternalPing.Critical pingCritical = MonitoringPolicy.Threshold.InternalPing.Critical.create(90, true); + MonitoringPolicy.Threshold.InternalPing ping = MonitoringPolicy.Threshold.InternalPing.create(pingWarning, pingCritical); + + MonitoringPolicy.Threshold.Transfer.Warning tranWarning = MonitoringPolicy.Threshold.Transfer.Warning.create(90, true); + MonitoringPolicy.Threshold.Transfer.Critical tranCritical = MonitoringPolicy.Threshold.Transfer.Critical.create(90, true); + MonitoringPolicy.Threshold.Transfer transfer = MonitoringPolicy.Threshold.Transfer.create(tranWarning, tranCritical); + + MonitoringPolicy.Threshold threshold = MonitoringPolicy.Threshold.create(cpu, ram, disk, transfer, ping); + MonitoringPolicy.UpdatePolicy payload = MonitoringPolicy.UpdatePolicy.builder() + .name("name") + .agent(true) + .email("email") + .description("dsec") + .thresholds(threshold) + .build(); + MonitoringPolicy response = monitoringPolicyApi().update("monitoringpolicyId", payload); + + assertNotNull(response); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "PUT", "/monitoring_policies/monitoringpolicyId", "{\"name\":\"name\",\"description\":\"dsec\",\"email\":\"email\"," + + "\"agent\":true,\"thresholds\":{\"cpu\":{\"warning\":{\"value\":90,\"alert\":true},\"critical\":{\"value\":90,\"alert\":true}}," + + "\"ram\":{\"warning\":{\"value\":90,\"alert\":true},\"critical\":{\"value\":90,\"alert\":true}}," + + "\"disk\":{\"warning\":{\"value\":90,\"alert\":true},\"critical\":{\"value\":95,\"alert\":true}}," + + "\"transfer\":{\"warning\":{\"value\":90,\"alert\":true},\"critical\":{\"value\":90,\"alert\":true}}," + + "\"internal_ping\":{\"warning\":{\"value\":90,\"alert\":true},\"critical\":{\"value\":90,\"alert\":true}}}}"); + } + + @Test + public void testDelete() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.json")) + ); + MonitoringPolicy response = monitoringPolicyApi().delete("monitoringpolicyId"); + + assertNotNull(response); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "DELETE", "/monitoring_policies/monitoringpolicyId"); + } + + @Test + public void testDelete404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + MonitoringPolicy response = monitoringPolicyApi().delete("monitoringpolicyId"); + + assertEquals(response, null); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "DELETE", "/monitoring_policies/monitoringpolicyId"); + } + + @Test + public void testListPorts() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/list.ports.json")) + ); + + List<MonitoringPolicy.Port> result = monitoringPolicyApi().listPorts("policyId"); + + assertNotNull(result); + assertEquals(result.size(), 2); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/policyId/ports"); + } + + @Test + public void testListPorts404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + + List<MonitoringPolicy.Port> result = monitoringPolicyApi().listPorts("policyId"); + + assertEquals(result.size(), 0); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/policyId/ports"); + } + + @Test + public void testGetPort() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.port.json")) + ); + MonitoringPolicy.Port result = monitoringPolicyApi().getPort("policyId", "portId"); + + assertNotNull(result); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/policyId/ports/portId"); + } + + @Test + public void testGetPort404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + MonitoringPolicy.Port result = monitoringPolicyApi().getPort("policyId", "portId"); + + assertEquals(result, null); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/policyId/ports/portId"); + } + + @Test + public void testAddPort() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.json")) + ); + + List<MonitoringPolicy.Port.AddPort> ports = new ArrayList<MonitoringPolicy.Port.AddPort>(); + MonitoringPolicy.Port.AddPort port = MonitoringPolicy.Port.AddPort.create(80, Types.AlertIfType.RESPONDING, true, Types.ProtocolType.TCP); + ports.add(port); + + MonitoringPolicy response = monitoringPolicyApi().addPort("policyId", MonitoringPolicy.Port.CreatePort.create(ports)); + + assertNotNull(response); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "POST", "/monitoring_policies/policyId/ports", "{\"ports\":[{\"port\":80,\"alert_if\":\"RESPONDING\",\"email_notification\":true,\"protocol\":\"TCP\"}]}"); + } + + @Test + public void testUpdatePort() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.json")) + ); + + MonitoringPolicy.Port.AddPort port = MonitoringPolicy.Port.AddPort.create(80, Types.AlertIfType.RESPONDING, true, Types.ProtocolType.TCP); + + MonitoringPolicy response = monitoringPolicyApi().updatePort("policyId", "portId", MonitoringPolicy.Port.UpdatePort.create(port)); + + assertNotNull(response); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "PUT", "/monitoring_policies/policyId/ports/portId", "{\"ports\":{\"port\":80,\"alert_if\":\"RESPONDING\",\"email_notification\":true,\"protocol\":\"TCP\"}}"); + } + + @Test + public void testDeletePort() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.json")) + ); + MonitoringPolicy response = monitoringPolicyApi().deletePort("policyId", "portId"); + + assertNotNull(response); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "DELETE", "/monitoring_policies/policyId/ports/portId"); + } + + @Test + public void testDeletePort404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + MonitoringPolicy response = monitoringPolicyApi().deletePort("policyId", "portId"); + + assertEquals(response, null); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "DELETE", "/monitoring_policies/policyId/ports/portId"); + } + + @Test + public void testListProcesses() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/list.process.json")) + ); + + List<MonitoringPolicy.Process> result = monitoringPolicyApi().listProcesses("policyId"); + + assertNotNull(result); + assertEquals(result.size(), 2); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/policyId/processes"); + } + + @Test + public void testListProcesses404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + + List<MonitoringPolicy.Process> result = monitoringPolicyApi().listProcesses("policyId"); + + assertEquals(result.size(), 0); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/policyId/processes"); + } + + @Test + public void testGetProcess() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.process.json")) + ); + MonitoringPolicy.Process result = monitoringPolicyApi().getProcess("policyId", "processId"); + + assertNotNull(result); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/policyId/processes/processId"); + } + + @Test + public void testGetProcess404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + MonitoringPolicy.Process result = monitoringPolicyApi().getProcess("policyId", "processId"); + + assertEquals(result, null); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/policyId/processes/processId"); + } + + @Test + public void testAddProcess() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.json")) + ); + + List<MonitoringPolicy.Process.AddProcess> processes = new ArrayList<MonitoringPolicy.Process.AddProcess>(); + MonitoringPolicy.Process.AddProcess process = MonitoringPolicy.Process.AddProcess.create("process", Types.AlertIfType.RESPONDING, true); + processes.add(process); + MonitoringPolicy response = monitoringPolicyApi().addProcess("policyId", MonitoringPolicy.Process.CreateProcess.create(processes)); + + assertNotNull(response); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "POST", "/monitoring_policies/policyId/processes", "{\"processes\":[{\"process\":\"process\",\"alert_if\":\"RESPONDING\",\"email_notification\":true}]}"); + } + + @Test + public void testUpdateProcess() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.json")) + ); + + MonitoringPolicy.Process.AddProcess process = MonitoringPolicy.Process.AddProcess.create("process", Types.AlertIfType.RESPONDING, true); + + MonitoringPolicy response = monitoringPolicyApi().updateProcess("policyId", "processId", MonitoringPolicy.Process.UpdateProcess.create(process)); + + assertNotNull(response); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "PUT", "/monitoring_policies/policyId/processes/processId", "{\"processes\":{\"process\":\"process\",\"alert_if\":\"RESPONDING\",\"email_notification\":true}}"); + } + + @Test + public void testDeleteProcess() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.json")) + ); + MonitoringPolicy response = monitoringPolicyApi().deleteProcess("policyId", "processId"); + + assertNotNull(response); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "DELETE", "/monitoring_policies/policyId/processes/processId"); + } + + @Test + public void testDeleteProcess404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + MonitoringPolicy response = monitoringPolicyApi().deleteProcess("policyId", "processId"); + + assertEquals(response, null); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "DELETE", "/monitoring_policies/policyId/processes/processId"); + } + + @Test + public void testListServers() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/list.servers.json")) + ); + + List<MonitoringPolicy.Server> servers = monitoringPolicyApi().listServers("policyId"); + + assertEquals(servers.size(), 2); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/policyId/servers"); + } + + @Test + public void testListServers404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + + List<MonitoringPolicy.Server> servers = monitoringPolicyApi().listServers("policyId"); + + assertEquals(servers.size(), 0); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/policyId/servers"); + } + + @Test + public void testGetServer() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.server.json")) + ); + MonitoringPolicy.Server result = monitoringPolicyApi().getServer("policyId", "serverId"); + + assertNotNull(result); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/policyId/servers/serverId"); + } + + @Test + public void testGetServer404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + MonitoringPolicy.Server result = monitoringPolicyApi().getServer("policyId", "serverId"); + + assertEquals(result, null); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/monitoring_policies/policyId/servers/serverId"); + } + + @Test + public void testAttachServer() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.json")) + ); + + List<String> servers = new ArrayList<String>(); + String toAdd = "serverid"; + servers.add(toAdd); + MonitoringPolicy response = monitoringPolicyApi().attachServer("policyId", MonitoringPolicy.Server.CreateServer.create(servers)); + + assertNotNull(response); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "POST", "/monitoring_policies/policyId/servers", "{\"servers\":[\"serverid\"]}"); + } + + @Test + public void testDetachServer() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/monitoringpolicy/get.json")) + ); + MonitoringPolicy response = monitoringPolicyApi().detachServer("policyId", "serverId"); + + assertNotNull(response); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "DELETE", "/monitoring_policies/policyId/servers/serverId"); + } + + @Test + public void testDetachServer404() throws InterruptedException { + server.enqueue( + new MockResponse().setResponseCode(404)); + MonitoringPolicy response = monitoringPolicyApi().detachServer("policyId", "serverId"); + + assertEquals(response, null); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "DELETE", "/monitoring_policies/policyId/servers/serverId"); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/resources/monitoringcenters/get.json ---------------------------------------------------------------------- diff --git a/oneandone/src/test/resources/monitoringcenters/get.json b/oneandone/src/test/resources/monitoringcenters/get.json new file mode 100644 index 0000000..d2da023 --- /dev/null +++ b/oneandone/src/test/resources/monitoringcenters/get.json @@ -0,0 +1,165 @@ +{ + "id": "BDAF0EC6A36E9E554B80B7E7365821F5", + "name": "My Server 1", + "status": { + "state": "POWERED_ON" + }, + "datacenter": { + "id": "D0F6D8C8ED29D3036F94C27BBB7BAD36", + "name": "United States" + }, + "alerts_count": { + "resources": { + "critical": 0, + "warning": 0, + "ok": 4 + }, + "ports": { + "critical": 0, + "warning": 0, + "ok": 0 + }, + "process": { + "critical": 0, + "warning": 0, + "ok": 0 + } + }, + "agent": { + "agent_installed": false, + "monitoring_needs_agent": false, + "missing_agent_alert": false + }, + "cpu": { + "warning": 90, + "critical": 95, + "data": [ + { + "date": "2015-19-05T00:05:00Z", + "used_percent": 0.4011 + }, + { + "date": "2015-19-05T00:10:00Z", + "used_percent": 1.0435 + }, + { + "date": "2015-19-05T00:15:00Z", + "used_percent": 0.4065 + }, + { + "date": "2015-19-05T00:20:00Z", + "used_percent": 0.49866666666667 + }, + { + "date": "2015-19-05T00:25:00Z", + "used_percent": 0.30266666666667 + } + ], + "unit": { + "used_percent": "%" + }, + "status": "CPU usage: OK - CPU_Total 0% used: CPU0 0% used" + }, + "ram": { + "warning": 90, + "critical": 95, + "data": [ + { + "date": "2015-19-05T00:05:00Z", + "used_percent": 1.99 + }, + { + "date": "2015-19-05T00:10:00Z", + "used_percent": 1 + }, + { + "date": "2015-19-05T00:15:00Z", + "used_percent": 3.96 + }, + { + "date": "2015-19-05T00:20:00Z", + "used_percent": 5.9633333333333 + }, + { + "date": "2015-19-05T00:25:00Z", + "used_percent": 2.0433333333333 + } + ], + "unit": { + "used_percent": "%" + }, + "status": "RAM usage: OK 789MB (39%) used" + }, + "transfer": { + "warning": 1000, + "critical": 2000, + "data": [ + { + "date": "2015-19-05T00:05:00Z", + "downstream": 0, + "upstream": 0 + }, + { + "date": "2015-19-05T00:10:00Z", + "downstream": 0, + "upstream": 0 + }, + { + "date": "2015-19-05T00:15:00Z", + "downstream": 0, + "upstream": 0 + }, + { + "date": "2015-19-05T00:20:00Z", + "downstream": 0, + "upstream": 0 + }, + { + "date": "2015-19-05T00:25:00Z", + "downstream": 0, + "upstream": 0 + } + ], + "unit": { + "downstream": "bps", + "upstream": "bps" + }, + "status": "Network traffic: OK - 0 Kbps received: 0 Kbps transmitted:" + }, + "internal_ping": { + "warning": 50, + "critical": 100, + "data": [ + { + "date": "2015-19-05T00:05:00Z", + "pl": 100, + "rta": 0 + }, + { + "date": "2015-19-05T00:10:00Z", + "pl": 100, + "rta": 0 + }, + { + "date": "2015-19-05T00:15:00Z", + "pl": 100, + "rta": 0 + }, + { + "date": "2015-19-05T00:20:00Z", + "pl": 100, + "rta": 0 + }, + { + "date": "2015-19-05T00:25:00Z", + "pl": 100, + "rta": 0 + } + ], + "unit": { + "pl": "%", + "rta": "ms" + }, + "status": "OK - 10.4.141.242: rta 0.657ms, lost 0%" + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/resources/monitoringcenters/list.json ---------------------------------------------------------------------- diff --git a/oneandone/src/test/resources/monitoringcenters/list.json b/oneandone/src/test/resources/monitoringcenters/list.json new file mode 100644 index 0000000..4e75fd8 --- /dev/null +++ b/oneandone/src/test/resources/monitoringcenters/list.json @@ -0,0 +1,98 @@ +[ + { + "id": "ABA6F4C16FE9893B09B354A4CF6321DF", + "name": "My Server remame", + "status": { + "state": "POWERED_ON", + "cpu": { + "state": "CPU usage: OK - CPU_Total 0% used: CPU0 0% used" + }, + "ram": { + "state": "RAM usage: OK 789MB (39%) used" + }, + "disk": { + "state": "Disk usage: OK C: 12.04GB (30%) used" + }, + "transfer": { + "state": "Network traffic: OK - 0 Kbps received: 0 Kbps transmitted:" + }, + "internal_ping": { + "state": "OK - 10.4.141.242: rta 0.671ms, lost 0%" + } + }, + "datacenter": { + "id": "D0F6D8C8ED29D3036F94C27BBB7BAD36", + "name": "United States" + }, + "alerts": { + "resources": { + "critical": 1, + "warning": 0, + "ok": 3 + }, + "ports": { + "critical": 0, + "warning": 0, + "ok": 0 + }, + "process": { + "critical": 0, + "warning": 0, + "ok": 0 + } + }, + "agent": { + "agent_installed": false, + "monitoring_needs_agent": false, + "missing_agent_alert": false + } + }, + { + "id": "BDAF0EC6A36E9E554B80B7E7365821F5", + "name": "My Server 1", + "status": { + "state": "POWERED_ON", + "cpu": { + "state": "CPU usage: OK - CPU_Total 0% used: CPU0 0% used" + }, + "ram": { + "state": "RAM usage: OK 789MB (39%) used" + }, + "disk": { + "state": "Disk usage: OK C: 12.04GB (30%) used" + }, + "transfer": { + "state": "Network traffic: OK - 0 Kbps received: 0 Kbps transmitted:" + }, + "internal_ping": { + "state": "OK - 10.4.141.242: rta 0.671ms, lost 0%" + } + }, + "region": { + "id": "D0F6D8C8ED29D3036F94C27BBB7BAD36", + "name": "United States" + }, + "alerts_count": { + "resources": { + "critical": 0, + "warning": 0, + "ok": 4 + }, + "ports": { + "critical": 0, + "warning": 0, + "ok": 0 + }, + "process": { + "critical": 0, + "warning": 0, + "ok": 0 + } + }, + "agent": { + "agent_installed": false, + "monitoring_needs_agent": false, + "missing_agent_alert": false + } + } +] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/resources/monitoringcenters/list.options.json ---------------------------------------------------------------------- diff --git a/oneandone/src/test/resources/monitoringcenters/list.options.json b/oneandone/src/test/resources/monitoringcenters/list.options.json new file mode 100644 index 0000000..4e75fd8 --- /dev/null +++ b/oneandone/src/test/resources/monitoringcenters/list.options.json @@ -0,0 +1,98 @@ +[ + { + "id": "ABA6F4C16FE9893B09B354A4CF6321DF", + "name": "My Server remame", + "status": { + "state": "POWERED_ON", + "cpu": { + "state": "CPU usage: OK - CPU_Total 0% used: CPU0 0% used" + }, + "ram": { + "state": "RAM usage: OK 789MB (39%) used" + }, + "disk": { + "state": "Disk usage: OK C: 12.04GB (30%) used" + }, + "transfer": { + "state": "Network traffic: OK - 0 Kbps received: 0 Kbps transmitted:" + }, + "internal_ping": { + "state": "OK - 10.4.141.242: rta 0.671ms, lost 0%" + } + }, + "datacenter": { + "id": "D0F6D8C8ED29D3036F94C27BBB7BAD36", + "name": "United States" + }, + "alerts": { + "resources": { + "critical": 1, + "warning": 0, + "ok": 3 + }, + "ports": { + "critical": 0, + "warning": 0, + "ok": 0 + }, + "process": { + "critical": 0, + "warning": 0, + "ok": 0 + } + }, + "agent": { + "agent_installed": false, + "monitoring_needs_agent": false, + "missing_agent_alert": false + } + }, + { + "id": "BDAF0EC6A36E9E554B80B7E7365821F5", + "name": "My Server 1", + "status": { + "state": "POWERED_ON", + "cpu": { + "state": "CPU usage: OK - CPU_Total 0% used: CPU0 0% used" + }, + "ram": { + "state": "RAM usage: OK 789MB (39%) used" + }, + "disk": { + "state": "Disk usage: OK C: 12.04GB (30%) used" + }, + "transfer": { + "state": "Network traffic: OK - 0 Kbps received: 0 Kbps transmitted:" + }, + "internal_ping": { + "state": "OK - 10.4.141.242: rta 0.671ms, lost 0%" + } + }, + "region": { + "id": "D0F6D8C8ED29D3036F94C27BBB7BAD36", + "name": "United States" + }, + "alerts_count": { + "resources": { + "critical": 0, + "warning": 0, + "ok": 4 + }, + "ports": { + "critical": 0, + "warning": 0, + "ok": 0 + }, + "process": { + "critical": 0, + "warning": 0, + "ok": 0 + } + }, + "agent": { + "agent_installed": false, + "monitoring_needs_agent": false, + "missing_agent_alert": false + } + } +] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/resources/monitoringpolicy/get.json ---------------------------------------------------------------------- diff --git a/oneandone/src/test/resources/monitoringpolicy/get.json b/oneandone/src/test/resources/monitoringpolicy/get.json new file mode 100644 index 0000000..2bb0f3b --- /dev/null +++ b/oneandone/src/test/resources/monitoringpolicy/get.json @@ -0,0 +1,83 @@ +{ + "id": "6027B730256C9585B269DAA8B1788DEC", + "name": "Default Policy", + "description": "Default Policy Description", + "default": 1, + "state": "ACTIVE", + "creation_date": "2015-10-16T11:19:12+00:00", + "email": "", + "agent": false, + "servers": [{ + "id": "213573A87AC01FF70ACDFC2A18643D36", + "name": "Docs\/Content Test Server: CentOS 7-1" + }, { + "id": "C547B6BFF993428B72448330883B9A9F", + "name": "Doc\/Content Test Server: Ubuntu 14.04-1" + }, { + "id": "E7D36EC025C73796035BF4F171379025", + "name": "Docs\/Content Test Server: CentOS 7-2" + }, { + "id": "4ADC7A1550FBF4F9A75E16D1BF483273", + "name": "Docs\/Content Test Server: Win 2012" + }, { + "id": "DDDC4CCA34AAB08132FA1E40F9FEAC25", + "name": "App Dev Server 5" + }, { + "id": "8122D014AE7E8B4E5D9337C215F48A19", + "name": "Doc\/Content Test Server: Debian 7" + }, { + "id": "BFA8EBD2BE60D224FA87D9AD952C0E1F", + "name": "Docs\/Content Test Server: CentOS 6 (2)" + }, { + "id": "55561BAF1FAFBD65600C61D1008C1AC7", + "name": "Doc\/Content Test Server: Ubuntu 12.04" + }, { + "id": "79DF0AD5F3B3EC37E9E0B16806081C13", + "name": "Doc\/Content Test Server: Ubuntu 14.04-2" + }], + "thresholds": { + "cpu": { + "warning": { + "value": 90, + "alert": false + }, + "critical": { + "value": 95, + "alert": false + } + }, + "ram": { + "warning": { + "value": 90, + "alert": false + }, + "critical": { + "value": 95, + "alert": false + } + }, + "transfer": { + "warning": { + "value": 1000, + "alert": false + }, + "critical": { + "value": 2000, + "alert": false + } + }, + "internal_ping": { + "warning": { + "value": 50, + "alert": false + }, + "critical": { + "value": 100, + "alert": false + } + } + }, + "ports": [], + "processes": [], + "cloudpanel_id": "moFF88C_1" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/resources/monitoringpolicy/get.port.json ---------------------------------------------------------------------- diff --git a/oneandone/src/test/resources/monitoringpolicy/get.port.json b/oneandone/src/test/resources/monitoringpolicy/get.port.json new file mode 100644 index 0000000..2750da4 --- /dev/null +++ b/oneandone/src/test/resources/monitoringpolicy/get.port.json @@ -0,0 +1,7 @@ +{ + "id": "663D21E232530D79E4E584104C400EE4", + "protocol": "TCP", + "port": 22, + "alert_if": "RESPONDING", + "email_notifications": true +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/resources/monitoringpolicy/get.process.json ---------------------------------------------------------------------- diff --git a/oneandone/src/test/resources/monitoringpolicy/get.process.json b/oneandone/src/test/resources/monitoringpolicy/get.process.json new file mode 100644 index 0000000..c09d656 --- /dev/null +++ b/oneandone/src/test/resources/monitoringpolicy/get.process.json @@ -0,0 +1,6 @@ +{ + "id": "663D21E232530D79E4E584104C400EE4", + "process": "iexplorer", + "alert_if": "NOT_RUNNING", + "email_notifications": true +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/resources/monitoringpolicy/get.server.json ---------------------------------------------------------------------- diff --git a/oneandone/src/test/resources/monitoringpolicy/get.server.json b/oneandone/src/test/resources/monitoringpolicy/get.server.json new file mode 100644 index 0000000..b7f5213 --- /dev/null +++ b/oneandone/src/test/resources/monitoringpolicy/get.server.json @@ -0,0 +1,4 @@ +{ + "id": "C72CF0A681B0CCE7EC624DD194D585C6", + "name": "My server 1" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/resources/monitoringpolicy/list.json ---------------------------------------------------------------------- diff --git a/oneandone/src/test/resources/monitoringpolicy/list.json b/oneandone/src/test/resources/monitoringpolicy/list.json new file mode 100644 index 0000000..d6b5390 --- /dev/null +++ b/oneandone/src/test/resources/monitoringpolicy/list.json @@ -0,0 +1,173 @@ +[ + { + "id": "6027B730256C9585B269DAA8B1788DEC", + "name": "Default Policy", + "description": "Default Policy Description", + "default": 1, + "state": "ACTIVE", + "creation_date": "2015-10-16T11:19:12+00:00", + "email": "", + "agent": false, + "servers": [{ + "id": "213573A87AC01FF70ACDFC2A18643D36", + "name": "Docs\/Content Test Server: CentOS 7-1" + }, { + "id": "C547B6BFF993428B72448330883B9A9F", + "name": "Doc\/Content Test Server: Ubuntu 14.04-1" + }, { + "id": "E7D36EC025C73796035BF4F171379025", + "name": "Docs\/Content Test Server: CentOS 7-2" + }, { + "id": "4ADC7A1550FBF4F9A75E16D1BF483273", + "name": "Docs\/Content Test Server: Win 2012" + }, { + "id": "DDDC4CCA34AAB08132FA1E40F9FEAC25", + "name": "App Dev Server 5" + }, { + "id": "8122D014AE7E8B4E5D9337C215F48A19", + "name": "Doc\/Content Test Server: Debian 7" + }, { + "id": "BFA8EBD2BE60D224FA87D9AD952C0E1F", + "name": "Docs\/Content Test Server: CentOS 6 (2)" + }, { + "id": "55561BAF1FAFBD65600C61D1008C1AC7", + "name": "Doc\/Content Test Server: Ubuntu 12.04" + }, { + "id": "79DF0AD5F3B3EC37E9E0B16806081C13", + "name": "Doc\/Content Test Server: Ubuntu 14.04-2" + }], + "thresholds": { + "cpu": { + "warning": { + "value": 90, + "alert": false + }, + "critical": { + "value": 95, + "alert": false + } + }, + "ram": { + "warning": { + "value": 90, + "alert": false + }, + "critical": { + "value": 95, + "alert": false + } + }, + "transfer": { + "warning": { + "value": 1000, + "alert": false + }, + "critical": { + "value": 2000, + "alert": false + } + }, + "internal_ping": { + "warning": { + "value": 50, + "alert": false + }, + "critical": { + "value": 100, + "alert": false + } + } + }, + "ports": [], + "processes": [], + "cloudpanel_id": "moFF88C_1" + } + , { + "id": "0A5626106ED596E6A86B74E503962CDD", + "name": "AgentMonPolicy", + "description": null, + "default": 0, + "state": "ACTIVE", + "creation_date": "2015-11-30T19:45:07+00:00", + "email": "[email protected]", + "agent": true, + "servers": [], + "thresholds": { + "cpu": { + "warning": { + "value": 10, + "alert": false + }, + "critical": { + "value": 80, + "alert": false + } + }, + "ram": { + "warning": { + "value": 90, + "alert": false + }, + "critical": { + "value": 95, + "alert": false + } + }, + "disk": { + "warning": { + "value": 20, + "alert": false + }, + "critical": { + "value": 90, + "alert": false + } + }, + "transfer": { + "warning": { + "value": 1000, + "alert": false + }, + "critical": { + "value": 2000, + "alert": false + } + }, + "internal_ping": { + "warning": { + "value": 50, + "alert": false + }, + "critical": { + "value": 100, + "alert": false + } + } + }, + "ports": [{ + "id": "740AB9FA852AE4B24EBB46BAD3455EB9", + "protocol": "TCP", + "port": 97, + "alert_if": "RESPONDING", + "email_notification": true + }, { + "id": "D8B5EB2C49A67476DCB077B5A481F815", + "protocol": "TCP", + "port": 97, + "alert_if": "RESPONDING", + "email_notification": true + }], + "processes": [{ + "id": "A180589700DB3BA65527B8167A17F717", + "process": "taskmgm", + "alert_if": "NOT_RUNNING", + "email_notification": false + }, { + "id": "53A88AE9CA993D843264942E8161E0DD", + "process": "httpdeamon", + "alert_if": "NOT_RUNNING", + "email_notification": false + }], + "cloudpanel_id": "moFF88C_8" + } +] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/resources/monitoringpolicy/list.options.json ---------------------------------------------------------------------- diff --git a/oneandone/src/test/resources/monitoringpolicy/list.options.json b/oneandone/src/test/resources/monitoringpolicy/list.options.json new file mode 100644 index 0000000..d6b5390 --- /dev/null +++ b/oneandone/src/test/resources/monitoringpolicy/list.options.json @@ -0,0 +1,173 @@ +[ + { + "id": "6027B730256C9585B269DAA8B1788DEC", + "name": "Default Policy", + "description": "Default Policy Description", + "default": 1, + "state": "ACTIVE", + "creation_date": "2015-10-16T11:19:12+00:00", + "email": "", + "agent": false, + "servers": [{ + "id": "213573A87AC01FF70ACDFC2A18643D36", + "name": "Docs\/Content Test Server: CentOS 7-1" + }, { + "id": "C547B6BFF993428B72448330883B9A9F", + "name": "Doc\/Content Test Server: Ubuntu 14.04-1" + }, { + "id": "E7D36EC025C73796035BF4F171379025", + "name": "Docs\/Content Test Server: CentOS 7-2" + }, { + "id": "4ADC7A1550FBF4F9A75E16D1BF483273", + "name": "Docs\/Content Test Server: Win 2012" + }, { + "id": "DDDC4CCA34AAB08132FA1E40F9FEAC25", + "name": "App Dev Server 5" + }, { + "id": "8122D014AE7E8B4E5D9337C215F48A19", + "name": "Doc\/Content Test Server: Debian 7" + }, { + "id": "BFA8EBD2BE60D224FA87D9AD952C0E1F", + "name": "Docs\/Content Test Server: CentOS 6 (2)" + }, { + "id": "55561BAF1FAFBD65600C61D1008C1AC7", + "name": "Doc\/Content Test Server: Ubuntu 12.04" + }, { + "id": "79DF0AD5F3B3EC37E9E0B16806081C13", + "name": "Doc\/Content Test Server: Ubuntu 14.04-2" + }], + "thresholds": { + "cpu": { + "warning": { + "value": 90, + "alert": false + }, + "critical": { + "value": 95, + "alert": false + } + }, + "ram": { + "warning": { + "value": 90, + "alert": false + }, + "critical": { + "value": 95, + "alert": false + } + }, + "transfer": { + "warning": { + "value": 1000, + "alert": false + }, + "critical": { + "value": 2000, + "alert": false + } + }, + "internal_ping": { + "warning": { + "value": 50, + "alert": false + }, + "critical": { + "value": 100, + "alert": false + } + } + }, + "ports": [], + "processes": [], + "cloudpanel_id": "moFF88C_1" + } + , { + "id": "0A5626106ED596E6A86B74E503962CDD", + "name": "AgentMonPolicy", + "description": null, + "default": 0, + "state": "ACTIVE", + "creation_date": "2015-11-30T19:45:07+00:00", + "email": "[email protected]", + "agent": true, + "servers": [], + "thresholds": { + "cpu": { + "warning": { + "value": 10, + "alert": false + }, + "critical": { + "value": 80, + "alert": false + } + }, + "ram": { + "warning": { + "value": 90, + "alert": false + }, + "critical": { + "value": 95, + "alert": false + } + }, + "disk": { + "warning": { + "value": 20, + "alert": false + }, + "critical": { + "value": 90, + "alert": false + } + }, + "transfer": { + "warning": { + "value": 1000, + "alert": false + }, + "critical": { + "value": 2000, + "alert": false + } + }, + "internal_ping": { + "warning": { + "value": 50, + "alert": false + }, + "critical": { + "value": 100, + "alert": false + } + } + }, + "ports": [{ + "id": "740AB9FA852AE4B24EBB46BAD3455EB9", + "protocol": "TCP", + "port": 97, + "alert_if": "RESPONDING", + "email_notification": true + }, { + "id": "D8B5EB2C49A67476DCB077B5A481F815", + "protocol": "TCP", + "port": 97, + "alert_if": "RESPONDING", + "email_notification": true + }], + "processes": [{ + "id": "A180589700DB3BA65527B8167A17F717", + "process": "taskmgm", + "alert_if": "NOT_RUNNING", + "email_notification": false + }, { + "id": "53A88AE9CA993D843264942E8161E0DD", + "process": "httpdeamon", + "alert_if": "NOT_RUNNING", + "email_notification": false + }], + "cloudpanel_id": "moFF88C_8" + } +] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/resources/monitoringpolicy/list.ports.json ---------------------------------------------------------------------- diff --git a/oneandone/src/test/resources/monitoringpolicy/list.ports.json b/oneandone/src/test/resources/monitoringpolicy/list.ports.json new file mode 100644 index 0000000..dd2c141 --- /dev/null +++ b/oneandone/src/test/resources/monitoringpolicy/list.ports.json @@ -0,0 +1,16 @@ +[ + { + "id": "663D21E232530D79E4E584104C400EE4", + "protocol": "TCP", + "port": 22, + "alert_if": "RESPONDING", + "email_notifications": true + }, + { + "id": "663D21E232530D79E4E584104C400AAA", + "protocol": "TCP", + "port": 80, + "alert_if": "NOT_RESPONDING", + "email_notifications": true + } +] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/resources/monitoringpolicy/list.process.json ---------------------------------------------------------------------- diff --git a/oneandone/src/test/resources/monitoringpolicy/list.process.json b/oneandone/src/test/resources/monitoringpolicy/list.process.json new file mode 100644 index 0000000..d20941d --- /dev/null +++ b/oneandone/src/test/resources/monitoringpolicy/list.process.json @@ -0,0 +1,14 @@ +[ + { + "id": "663D21E232530D79E4E584104C400EE4", + "process": "iexplorer", + "alert_if": "NOT_RUNNING", + "email_notifications": true + }, + { + "id": "663D21E232530D79E4E584104C400EE4", + "process": "winword", + "alert_if": "NOT_RUNNING", + "email_notifications": true + } +] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/87c54700/oneandone/src/test/resources/monitoringpolicy/list.servers.json ---------------------------------------------------------------------- diff --git a/oneandone/src/test/resources/monitoringpolicy/list.servers.json b/oneandone/src/test/resources/monitoringpolicy/list.servers.json new file mode 100644 index 0000000..83935b5 --- /dev/null +++ b/oneandone/src/test/resources/monitoringpolicy/list.servers.json @@ -0,0 +1,10 @@ +[ +{ + "id": "C72CF0A681B0CCE7EC624DD194D585C6", + "name": "My server 1" +}, +{ + "id": "4ECD9D188EB457317B2CF8F07885E7B4", + "name": "My server 2" +} +] \ No newline at end of file
