コード例 #1
0
 public static VirtualDatacenterDto virtualDatacenterPost() {
   VirtualDatacenterDto virtualDatacenter = new VirtualDatacenterDto();
   virtualDatacenter.setName("VDC");
   virtualDatacenter.setHypervisorType(HypervisorType.KVM);
   virtualDatacenter.setVlan(NetworkResources.vlanPost());
   return virtualDatacenter;
 }
コード例 #2
0
 public static VirtualDatacenterDto virtualDatacenterPut() {
   VirtualDatacenterDto virtualDatacenter = virtualDatacenterPost();
   virtualDatacenter.setId(1);
   virtualDatacenter.addLink(
       new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
   virtualDatacenter.addLink(
       new RESTLink("disks", "http://localhost/api/cloud/virtualdatacenters/1/disks"));
   virtualDatacenter.addLink(
       new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
   virtualDatacenter.addLink(
       new RESTLink("edit", "http://localhost/api/cloud/virtualdatacenters/1"));
   virtualDatacenter.addLink(
       new RESTLink("tiers", "http://localhost/api/cloud/virtualdatacenters/1/tiers"));
   virtualDatacenter.addLink(
       new RESTLink(
           "virtualappliances",
           "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances"));
   virtualDatacenter.addLink(
       new RESTLink("volumes", "http://localhost/api/cloud/virtualdatacenters/1/volumes"));
   virtualDatacenter.addLink(
       new RESTLink(
           "privatenetworks", "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks"));
   virtualDatacenter.addLink(
       new RESTLink(
           "defaultnetwork", "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1"));
   virtualDatacenter.addLink(
       new RESTLink(
           "defaultvlan", "http://localhost/api/cloud/virtualdatacenters/1/action/defaultvlan"));
   virtualDatacenter.addLink(
       new RESTLink(
           "topurchase", "http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase"));
   virtualDatacenter.addLink(
       new RESTLink(
           "purchased", "http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased"));
   virtualDatacenter.addLink(
       new RESTLink(
           "templates", "http://localhost/api/cloud/virtualdatacenters/1/action/templates"));
   return virtualDatacenter;
 }