@Override @Consumes(MediaType.APPLICATION_JSON) public VirtualGuest expected() { return VirtualGuest .builder() .id(413348).accountId(93750).billingItemId(-1) .createDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-09-28T01:52:45-08:00")) .domain("jclouds.org").fullyQualifiedDomainName("foo-ef4.jclouds.org") .hostname("foo-ef4").maxCpu(0).maxCpuUnits("CORE").maxMemory(256) .statusId(1001).startCpus(0) //TODO: maybe powerState can be flattened like billingItemId .powerState(new PowerState(VirtualGuest.State.HALTED)).build(); }
.dedicatedAccountHostOnly(false) .domain("test.com") .fullyQualifiedDomainName("my.test.com") .hostname("my") .id(3001812)
@Override @Consumes(MediaType.APPLICATION_JSON) public VirtualGuest expected() { return VirtualGuest .builder() .id(416788).accountId(93750).billingItemId(7185261) .createDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T03:24:43-08:00")) .dedicatedAccountHostOnly(true).domain("me.org").fullyQualifiedDomainName("node1000360500.me.org") .hostname("node1000360500").maxCpu(1).maxCpuUnits("CORE").maxMemory(1024) .modifyDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T03:25:33-08:00")) .primaryBackendIpAddress("10.37.102.194").primaryIpAddress("173.192.29.186").startCpus(1).statusId(1001) .uuid("96fe22ad-8182-924d-ce51-a037e477dd83") .operatingSystem(OperatingSystem.builder().id(913960).build()) .datacenter(Datacenter.builder().id(3).name("dal01").longName("Dallas").build()) //TODO: maybe powerState can be flattened like billingItemId .powerState(new PowerState(VirtualGuest.State.HALTED)).build(); }
.dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) .domain(in.getDomain()) .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) .hostname(in.getHostname()) .id(in.getId())
.dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) .domain(in.getDomain()) .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) .hostname(in.getHostname()) .id(in.getId())
.dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) .domain(in.getDomain()) .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) .hostname(in.getHostname()) .id(in.getId())
.dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) .domain(in.getDomain()) .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) .hostname(in.getHostname()) .id(in.getId())
public T fromVirtualGuest(VirtualGuest in) { return this .accountId(in.getAccountId()) .createDate(in.getCreateDate()) .dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) .domain(in.getDomain()) .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) .hostname(in.getHostname()) .id(in.getId()) .lastVerifiedDate(in.getLastVerifiedDate()) .maxCpu(in.getMaxCpu()) .maxCpuUnits(in.getMaxCpuUnits()) .maxMemory(in.getMaxMemory()) .metricPollDate(in.getMetricPollDate()) .modifyDate(in.getModifyDate()) .notes(in.getNotes()) .privateNetworkOnly(in.isPrivateNetworkOnly()) .startCpus(in.getStartCpus()) .statusId(in.getStatusId()) .uuid(in.getUuid()) .primaryBackendIpAddress(in.getPrimaryBackendIpAddress()) .primaryIpAddress(in.getPrimaryIpAddress()) .billingItemId(in.getBillingItemId()) .operatingSystem(in.getOperatingSystem()) .datacenter(in.getDatacenter()) .powerState(in.getPowerState()); } }
public T fromVirtualGuest(VirtualGuest in) { return this .accountId(in.getAccountId()) .createDate(in.getCreateDate()) .dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) .domain(in.getDomain()) .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) .hostname(in.getHostname()) .id(in.getId()) .lastVerifiedDate(in.getLastVerifiedDate()) .maxCpu(in.getMaxCpu()) .maxCpuUnits(in.getMaxCpuUnits()) .maxMemory(in.getMaxMemory()) .metricPollDate(in.getMetricPollDate()) .modifyDate(in.getModifyDate()) .notes(in.getNotes()) .privateNetworkOnly(in.isPrivateNetworkOnly()) .startCpus(in.getStartCpus()) .statusId(in.getStatusId()) .uuid(in.getUuid()) .primaryBackendIpAddress(in.getPrimaryBackendIpAddress()) .primaryIpAddress(in.getPrimaryIpAddress()) .billingItemId(in.getBillingItemId()) .operatingSystem(in.getOperatingSystem()) .datacenter(in.getDatacenter()) .powerState(in.getPowerState()); } }
.dedicatedAccountHostOnly(false) .domain("test.com") .fullyQualifiedDomainName("my.test.com") .hostname("my") .id(3001812)
private VirtualGuest createVirtualGuest() { return VirtualGuest.builder() .domain("example.com") .hostname("host1") .fullyQualifiedDomainName("host1.example.com") .id(1301396) .maxMemory(1024) .startCpus(1) .localDiskFlag(true) .operatingSystem(OperatingSystem.builder().id("UBUNTU_LATEST") .operatingSystemReferenceCode("UBUNTU_LATEST") .softwareLicense(SoftwareLicense.builder() .softwareDescription(SoftwareDescription.builder() .version("12.04-64 Minimal for CCI") .referenceCode("UBUNTU_12_64") .longDescription("Ubuntu Linux 12.04 LTS Precise Pangolin - Minimal Install (64 bit)") .build()) .build()) .build()) .datacenter(Datacenter.builder().name("test").build()) .powerState(PowerState.builder().keyName(VirtualGuest.State.RUNNING).build()) .build(); }
@Override @Consumes(MediaType.APPLICATION_JSON) public VirtualGuest expected() { return VirtualGuest .builder() .id(416700).accountId(93750).billingItemId(7184019) .createDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-01T11:47:35-08:00")) .metricPollDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T02:32:00-08:00")) .dedicatedAccountHostOnly(true).domain("me.org").fullyQualifiedDomainName("node1703810489.me.org") .hostname("node1703810489").maxCpu(1).maxCpuUnits("CORE").maxMemory(1024) .modifyDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T03:18:12-08:00")) .primaryBackendIpAddress("10.37.102.195").primaryIpAddress("173.192.29.187").startCpus(1).statusId(1001) .uuid("02ddbbba-9225-3d54-6de5-fc603b309dd8") .operatingSystem(OperatingSystem.builder().id(913824) .passwords(Password.builder().id(729122).username("root").password("KnJqhC2l").build()) .build()) .datacenter(Datacenter.builder().id(3).name("dal01").longName("Dallas").build()) //TODO: maybe powerState can be flattened like billingItemId .powerState(new PowerState(VirtualGuest.State.PAUSED)).build(); }
@Override @Consumes(MediaType.APPLICATION_JSON) public VirtualGuest expected() { return VirtualGuest .builder() .id(416700).accountId(93750).billingItemId(7184019) .createDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-01T11:47:35-08:00")) .metricPollDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T02:32:00-08:00")) .dedicatedAccountHostOnly(true).domain("me.org").fullyQualifiedDomainName("node1703810489.me.org") .hostname("node1703810489").maxCpu(1).maxCpuUnits("CORE").maxMemory(1024) .modifyDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T02:32:40-08:00")) .primaryBackendIpAddress("10.37.102.195").primaryIpAddress("173.192.29.187").startCpus(1).statusId(1001) .uuid("02ddbbba-9225-3d54-6de5-fc603b309dd8") .operatingSystem(OperatingSystem.builder().id(913824) .passwords(Password.builder().id(729122).username("root").password("KnJqhC2l").build()) .build()) .datacenter(Datacenter.builder().id(3).name("dal01").longName("Dallas").build()) //TODO: maybe powerState can be flattened like billingItemId .powerState(new PowerState(VirtualGuest.State.RUNNING)).build(); }
@Override @Consumes(MediaType.APPLICATION_JSON) public VirtualGuest expected() { return VirtualGuest .builder() .id(416700).accountId(93750).billingItemId(7184019) .createDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-01T11:47:35-08:00")) .metricPollDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T02:32:00-08:00")) .dedicatedAccountHostOnly(true).domain("me.org").fullyQualifiedDomainName("node1703810489.me.org") .hostname("node1703810489").maxCpu(1).maxCpuUnits("CORE").maxMemory(1024) .modifyDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T03:19:43-08:00")) .primaryBackendIpAddress("10.37.102.195").primaryIpAddress("173.192.29.187").startCpus(1).statusId(1001) .uuid("02ddbbba-9225-3d54-6de5-fc603b309dd8") .operatingSystem(OperatingSystem.builder().id(913824) .passwords(Password.builder().id(729122).username("root").password("KnJqhC2l").build()) .build()) .datacenter(Datacenter.builder().id(3).name("dal01").longName("Dallas").build()) //TODO: maybe powerState can be flattened like billingItemId .powerState(new PowerState(VirtualGuest.State.HALTED)).build(); }