From 5dc2f656367482bcb899eea99fef7e4efb423cb8 Mon Sep 17 00:00:00 2001 From: Jason King Date: Tue, 20 Dec 2011 11:18:06 +0000 Subject: [PATCH] Issue 695: Deleted AnonymousResource now name is optional. --- ...ndCreateVirtualMachineKeyToXmlPayload.java | 4 +- .../domain/internal/AnonymousResource.java | 95 ------------------- .../domain/layout/LayoutRequest.java | 20 ++-- .../domain/network/LinuxCustomization.java | 12 +-- .../ComputePoolPerformanceStatistic.java | 20 ++-- .../domain/vm/CreateVirtualMachine.java | 14 +-- ...eateVirtualMachineKeyToXmlPayloadTest.java | 7 +- .../VirtualMachineClientLiveTest.java | 7 +- ...lPerformanceStatisticsJAXBParsingTest.java | 6 +- 9 files changed, 44 insertions(+), 141 deletions(-) delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/AnonymousResource.java diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayload.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayload.java index bcfb04ab89..700cc1de37 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayload.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayload.java @@ -22,7 +22,7 @@ import com.jamesmurty.utils.XMLBuilder; import org.jclouds.http.HttpRequest; import org.jclouds.rest.Binder; import org.jclouds.rest.binders.BindToStringPayload; -import org.jclouds.tmrk.enterprisecloud.domain.internal.AnonymousResource; +import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; import org.jclouds.tmrk.enterprisecloud.domain.layout.LayoutRequest; import org.jclouds.tmrk.enterprisecloud.domain.network.LinuxCustomization; import org.jclouds.tmrk.enterprisecloud.domain.network.NetworkAdapterSetting; @@ -76,7 +76,7 @@ public class BindCreateVirtualMachineKeyToXmlPayload implements Binder { final String description = vmData.getDescription(); final LayoutRequest layout = vmData.getLayout(); final String poweredOn = Boolean.toString(vmData.isPoweredOn()); - final AnonymousResource template = vmData.getTemplate(); + final NamedResource template = vmData.getTemplate(); XMLBuilder builder = XMLBuilder.create("CreateVirtualMachine").a("name",name) .e("ProcessorCount").t(processorCount).up() diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/AnonymousResource.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/AnonymousResource.java deleted file mode 100644 index 0ffeb4cbe3..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/AnonymousResource.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds 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.jclouds.tmrk.enterprisecloud.domain.internal; - -import java.net.URI; -import java.util.Map; - -/** - * A Resource with no name. - * @author Jason King - * - */ -public class AnonymousResource extends BaseResource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromBaseResource(this); - } - - public static class Builder extends BaseResource.Builder { - - /** - * {@inheritDoc} - */ - @Override - public AnonymousResource build() { - return new AnonymousResource(href, type); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map in) { - return Builder.class.cast(super.fromAttributes(in)); - } - - } - - private AnonymousResource(URI href, String type) { - super(href, type); - } - - protected AnonymousResource() { - //For JAXB - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutRequest.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutRequest.java index 3799ef57d7..6661915f36 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutRequest.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutRequest.java @@ -19,7 +19,7 @@ package org.jclouds.tmrk.enterprisecloud.domain.layout; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.AnonymousResource; +import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; import javax.xml.bind.annotation.XmlElement; @@ -61,15 +61,15 @@ public class LayoutRequest { } public static class Builder { - private AnonymousResource row; - private AnonymousResource group; + private NamedResource row; + private NamedResource group; private String newRow; private String newGroup; /** * @see LayoutRequest#getRow */ - public Builder row(AnonymousResource row) { + public Builder row(NamedResource row) { this.row = row; return this; } @@ -77,7 +77,7 @@ public class LayoutRequest { /** * @see LayoutRequest#getGroup */ - public Builder group(AnonymousResource group) { + public Builder group(NamedResource group) { this.group = group; return this; } @@ -108,10 +108,10 @@ public class LayoutRequest { } @XmlElement(name = "Row", required = false) - private AnonymousResource row; + private NamedResource row; @XmlElement(name = "Group", required = false) - private AnonymousResource group; + private NamedResource group; @XmlElement(name = "NewRow", required = false) private String newRow; @@ -120,7 +120,7 @@ public class LayoutRequest { private String newGroup; - private LayoutRequest(@Nullable AnonymousResource row, @Nullable AnonymousResource group, @Nullable String newRow, @Nullable String newGroup) { + private LayoutRequest(@Nullable NamedResource row, @Nullable NamedResource group, @Nullable String newRow, @Nullable String newGroup) { this.row = row; this.group = group; this.newRow = newRow; @@ -131,11 +131,11 @@ public class LayoutRequest { //For JAXB } - public AnonymousResource getRow() { + public NamedResource getRow() { return row; } - public AnonymousResource getGroup() { + public NamedResource getGroup() { return group; } diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/LinuxCustomization.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/LinuxCustomization.java index 74ff4f82b2..f63cb1a59d 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/LinuxCustomization.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/LinuxCustomization.java @@ -19,7 +19,7 @@ package org.jclouds.tmrk.enterprisecloud.domain.network; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.AnonymousResource; +import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; import javax.xml.bind.annotation.XmlElement; @@ -41,7 +41,7 @@ public class LinuxCustomization { public static class Builder { private NetworkSettings networkSettings = NetworkSettings.builder().build(); - private AnonymousResource sshKey; + private NamedResource sshKey; /** * @see org.jclouds.tmrk.enterprisecloud.domain.network.LinuxCustomization#getNetworkSettings @@ -54,7 +54,7 @@ public class LinuxCustomization { /** * @see org.jclouds.tmrk.enterprisecloud.domain.network.LinuxCustomization#getSshKey */ - public Builder sshKey(AnonymousResource sshKey) { + public Builder sshKey(NamedResource sshKey) { this.sshKey = sshKey; return this; } @@ -72,9 +72,9 @@ public class LinuxCustomization { private NetworkSettings networkSettings; @XmlElement(name = "SshKey", required = false) - private AnonymousResource sshKey; + private NamedResource sshKey; - public LinuxCustomization(@Nullable NetworkSettings networkSettings, @Nullable AnonymousResource sshKey) { + public LinuxCustomization(@Nullable NetworkSettings networkSettings, @Nullable NamedResource sshKey) { this.networkSettings = networkSettings; this.sshKey = sshKey; } @@ -87,7 +87,7 @@ public class LinuxCustomization { return networkSettings; } - public AnonymousResource getSshKey() { + public NamedResource getSshKey() { return sshKey; } diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolPerformanceStatistic.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolPerformanceStatistic.java index 8b4999b020..df066bcef4 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolPerformanceStatistic.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolPerformanceStatistic.java @@ -19,7 +19,7 @@ package org.jclouds.tmrk.enterprisecloud.domain.resource; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.AnonymousResource; +import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; import javax.xml.bind.annotation.XmlElement; @@ -40,13 +40,13 @@ public class ComputePoolPerformanceStatistic { } public static class Builder { - private AnonymousResource cpu; - private AnonymousResource memory; + private NamedResource cpu; + private NamedResource memory; /** * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolPerformanceStatistic#getCpu */ - public Builder cpu(AnonymousResource cpu) { + public Builder cpu(NamedResource cpu) { this.cpu = cpu; return this; } @@ -54,7 +54,7 @@ public class ComputePoolPerformanceStatistic { /** * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolPerformanceStatistic#getMemory */ - public Builder memory(AnonymousResource memory) { + public Builder memory(NamedResource memory) { this.memory = memory; return this; } @@ -69,12 +69,12 @@ public class ComputePoolPerformanceStatistic { } @XmlElement(name = "Cpu", required = false) - private AnonymousResource cpu; + private NamedResource cpu; @XmlElement(name = "Memory", required = false) - private AnonymousResource memory; + private NamedResource memory; - private ComputePoolPerformanceStatistic(@Nullable AnonymousResource cpu, @Nullable AnonymousResource memory) { + private ComputePoolPerformanceStatistic(@Nullable NamedResource cpu, @Nullable NamedResource memory) { this.cpu = cpu; this.memory = memory; } @@ -83,11 +83,11 @@ public class ComputePoolPerformanceStatistic { //For JAXB } - public AnonymousResource getCpu() { + public NamedResource getCpu() { return cpu; } - public AnonymousResource getMemory() { + public NamedResource getMemory() { return memory; } diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/vm/CreateVirtualMachine.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/vm/CreateVirtualMachine.java index 6d4d65a1d5..58bb464bd7 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/vm/CreateVirtualMachine.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/vm/CreateVirtualMachine.java @@ -19,9 +19,9 @@ package org.jclouds.tmrk.enterprisecloud.domain.vm; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.AnonymousResource; -import org.jclouds.tmrk.enterprisecloud.domain.layout.LayoutRequest; +import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; +import org.jclouds.tmrk.enterprisecloud.domain.layout.LayoutRequest; import org.jclouds.tmrk.enterprisecloud.domain.network.LinuxCustomization; import org.jclouds.tmrk.enterprisecloud.domain.network.WindowsCustomization; @@ -57,7 +57,7 @@ public class CreateVirtualMachine extends CreateVirtualMachineRequest { private LinuxCustomization linuxCustomization; private WindowsCustomization windowsCustomization; private boolean poweredOn; - private AnonymousResource template; + private NamedResource template; /** * @see CreateVirtualMachine#getLinuxCustomization @@ -87,7 +87,7 @@ public class CreateVirtualMachine extends CreateVirtualMachineRequest { /** * @see CreateVirtualMachine#getTemplate */ - public Builder template(AnonymousResource template) { + public Builder template(NamedResource template) { this.template = template; return this; } @@ -164,13 +164,13 @@ public class CreateVirtualMachine extends CreateVirtualMachineRequest { private boolean poweredOn; @XmlElement(name = "Template", required = false) - private AnonymousResource template; + private NamedResource template; private CreateVirtualMachine(String name, int processorCount, ResourceCapacity memory, @Nullable String description, @Nullable LayoutRequest layout, @Nullable Set tags, @Nullable LinuxCustomization linuxCustomization, @Nullable WindowsCustomization windowsCustomization, - boolean poweredOn, @Nullable AnonymousResource template) { + boolean poweredOn, @Nullable NamedResource template) { super(name,processorCount,memory,description,layout,tags); this.linuxCustomization = linuxCustomization; this.windowsCustomization = windowsCustomization; @@ -194,7 +194,7 @@ public class CreateVirtualMachine extends CreateVirtualMachineRequest { return poweredOn; } - public AnonymousResource getTemplate() { + public NamedResource getTemplate() { return template; } diff --git a/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayloadTest.java b/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayloadTest.java index 796f1360a6..7771c60112 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayloadTest.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayloadTest.java @@ -24,7 +24,6 @@ import com.google.inject.Guice; import com.google.inject.Injector; import org.jclouds.http.HttpRequest; import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.AnonymousResource; import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; import org.jclouds.tmrk.enterprisecloud.domain.layout.LayoutRequest; import org.jclouds.tmrk.enterprisecloud.domain.network.LinuxCustomization; @@ -84,11 +83,11 @@ public class BindCreateVirtualMachineKeyToXmlPayloadTest { .processorCount(2) .memory(ResourceCapacity.builder().value(1024).unit("MB").build()); - AnonymousResource group = AnonymousResource.builder().href(URI.create("/cloudapi/ecloud/layoutgroups/308")).type("application/vnd.tmrk.cloud.layoutGroup").build(); + NamedResource group = NamedResource.builder().href(URI.create("/cloudapi/ecloud/layoutgroups/308")).type("application/vnd.tmrk.cloud.layoutGroup").build(); builder.layout(LayoutRequest.builder().group(group).build()); builder.description("This is my first VM"); builder.tags(ImmutableSet.of("Web")); - AnonymousResource sshKey = AnonymousResource.builder().href(URI.create("/cloudapi/ecloud/admin/sshkeys/77")).type("application/vnd.tmrk.cloud.admin.sshKey").build(); + NamedResource sshKey = NamedResource.builder().href(URI.create("/cloudapi/ecloud/admin/sshkeys/77")).type("application/vnd.tmrk.cloud.admin.sshKey").build(); NamedResource network = NamedResource.builder() .href(URI.create("/cloudapi/ecloud/networks/3936")) @@ -111,7 +110,7 @@ public class BindCreateVirtualMachineKeyToXmlPayloadTest { .build(); builder.linuxCustomization(linuxCustomization); - AnonymousResource template = AnonymousResource.builder().href(URI.create("/cloudapi/ecloud/templates/6/computepools/89")).type("application/vnd.tmrk.cloud.template").build(); + NamedResource template = NamedResource.builder().href(URI.create("/cloudapi/ecloud/templates/6/computepools/89")).type("application/vnd.tmrk.cloud.template").build(); builder.template(template); binder.bindToRequest(request, builder.build()); assertEquals(request.getPayload().getRawContent(), expected.replaceAll("'","\"")); diff --git a/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineClientLiveTest.java b/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineClientLiveTest.java index 84999dd58f..7c8e749a21 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineClientLiveTest.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineClientLiveTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; import org.jclouds.tmrk.enterprisecloud.domain.hardware.HardwareConfiguration; -import org.jclouds.tmrk.enterprisecloud.domain.internal.AnonymousResource; import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; import org.jclouds.tmrk.enterprisecloud.domain.layout.LayoutRequest; import org.jclouds.tmrk.enterprisecloud.domain.network.*; @@ -112,11 +111,11 @@ public class VirtualMachineClientLiveTest extends BaseTerremarkEnterpriseCloudCl .processorCount(2) .memory(ResourceCapacity.builder().value(1024).unit("MB").build()); - AnonymousResource group = AnonymousResource.builder().href(URI.create("/cloudapi/ecloud/layoutgroups/308")).type("application/vnd.tmrk.cloud.layoutGroup").build(); + NamedResource group = NamedResource.builder().href(URI.create("/cloudapi/ecloud/layoutgroups/308")).type("application/vnd.tmrk.cloud.layoutGroup").build(); builder.layout(LayoutRequest.builder().group(group).build()); builder.description("This is my first VM"); builder.tags(ImmutableSet.of("Web")); - AnonymousResource sshKey = AnonymousResource.builder().href(URI.create("/cloudapi/ecloud/admin/sshkeys/77")).type("application/vnd.tmrk.cloud.admin.sshKey").build(); + NamedResource sshKey = NamedResource.builder().href(URI.create("/cloudapi/ecloud/admin/sshkeys/77")).type("application/vnd.tmrk.cloud.admin.sshKey").build(); NamedResource network = NamedResource.builder() .href(URI.create("/cloudapi/ecloud/networks/3933")) @@ -142,7 +141,7 @@ public class VirtualMachineClientLiveTest extends BaseTerremarkEnterpriseCloudCl .build(); builder.linuxCustomization(linuxCustomization); - AnonymousResource template = AnonymousResource.builder().href(URI.create("/cloudapi/ecloud/templates/6/computepools/89")).type("application/vnd.tmrk.cloud.template").build(); + NamedResource template = NamedResource.builder().href(URI.create("/cloudapi/ecloud/templates/6/computepools/89")).type("application/vnd.tmrk.cloud.template").build(); builder.template(template); VirtualMachine vm = client.createVirtualMachineFromTemplate(URI.create("/cloudapi/ecloud/virtualMachines/computePools/89/action/createVirtualMachine"), builder.build()); diff --git a/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/ComputePoolPerformanceStatisticsJAXBParsingTest.java b/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/ComputePoolPerformanceStatisticsJAXBParsingTest.java index f7731852c7..40eecbad26 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/ComputePoolPerformanceStatisticsJAXBParsingTest.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/ComputePoolPerformanceStatisticsJAXBParsingTest.java @@ -35,7 +35,7 @@ import org.jclouds.rest.BaseRestClientTest; import org.jclouds.rest.RestContextSpec; import org.jclouds.rest.internal.RestAnnotationProcessor; import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.AnonymousResource; +import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; import org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolPerformanceStatistics; import org.jclouds.tmrk.enterprisecloud.features.ResourceAsyncClient; import org.testng.annotations.BeforeClass; @@ -102,8 +102,8 @@ public class ComputePoolPerformanceStatisticsJAXBParsingTest extends BaseRestCli assertEquals(stats.getDaily().getMemory(), createResource("memory", "daily")); } - private AnonymousResource createResource(String type, String period) { - return AnonymousResource.builder().href(URI.create("/cloudapi/ecloud/computepools/89/usage/"+type+"/performancestatistics/"+period)) + private NamedResource createResource(String type, String period) { + return NamedResource.builder().href(URI.create("/cloudapi/ecloud/computepools/89/usage/"+type+"/performancestatistics/"+period)) .type("application/vnd.tmrk.cloud.performanceStatistics") .build(); }