Examples of NetworkServiceTypeDto


Examples of com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto

    *           Unique ID of the network service type in this datacenter.
    * @return Network Service Type with the given id or <code>null</code> if it
    *         does not exist.
    */
   public NetworkServiceType getNetworkServiceType(final Integer id) {
      NetworkServiceTypeDto nst = context.getApi().getInfrastructureApi().getNetworkServiceType(target, id);
      return wrap(context, NetworkServiceType.class, nst);
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto

         this.datacenter = datacenter;
         this.context = context;
      }

      public NetworkServiceType build() {
         NetworkServiceTypeDto dto = new NetworkServiceTypeDto();
         dto.setName(this.name);

         NetworkServiceType nst = new NetworkServiceType(context, dto);
         nst.datacenter = this.datacenter;
         return nst;
      }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto

      DatacenterDto datacenter = new DatacenterDto();
      datacenter.addLink(new RESTLink("networkservicetypes",
            "http://localhost/api/admin/datacenters/1/networkservicetypes"));

      NetworkServiceTypeDto created = api.getNetworkServiceType(datacenter, 1);
      assertNotNull(created.getId());
      assertEquals(created.getName(), "Service Network");
      assertEquals(created.isDefaultNST(), true);
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto

      DatacenterDto datacenter = new DatacenterDto();
      datacenter.addLink(new RESTLink("networkservicetypes",
            "http://localhost/api/admin/datacenters/1/networkservicetypes"));

      NetworkServiceTypeDto nst = new NetworkServiceTypeDto();
      nst.setName("Service Network");
      nst.setDefaultNST(true);

      NetworkServiceTypeDto created = api.createNetworkServiceType(datacenter, nst);
      assertNotNull(created.getId());
      assertEquals(created.getName(), "Service Network");
      assertEquals(created.isDefaultNST(), true);
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto

                  .payload(
                        payloadFromResourceWithContentType("/payloads/nst-edit.xml",
                              normalize(NetworkServiceTypeDto.MEDIA_TYPE))) //
                  .build());

      NetworkServiceTypeDto nst = new NetworkServiceTypeDto();
      RESTLink editLink = new RESTLink("edit", "http://localhost/api/admin/datacenters/1/networkservicetypes/1");
      editLink.setType(NetworkServiceTypeDto.BASE_MEDIA_TYPE);
      nst.addLink(editLink);
      nst.setId(1);
      nst.setDefaultNST(true);
      nst.setName("Service Network");

      NetworkServiceTypeDto created = api.updateNetworkServiceType(nst);
      assertNotNull(created.getId());
      assertEquals(created.getName(), "Service Network");
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto

            .endpoint(URI.create("http://localhost/api/admin/datacenters/1/networkservicetypes/1")) //
            .addHeader("Cookie", tokenAuth) //
            .build(), //
            HttpResponse.builder().statusCode(204).build());

      NetworkServiceTypeDto nst = new NetworkServiceTypeDto();
      RESTLink editLink = new RESTLink("edit", "http://localhost/api/admin/datacenters/1/networkservicetypes/1");
      editLink.setType(NetworkServiceTypeDto.BASE_MEDIA_TYPE);
      nst.addLink(editLink);

      api.deleteNetworkServiceType(nst);
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto

      DatacenterDto datacenter = new DatacenterDto();
      datacenter.addLink(new RESTLink("networkservicetypes",
            "http://localhost/api/admin/datacenters/1/networkservicetypes"));

      NetworkServiceTypeDto created = api.getNetworkServiceType(datacenter, 1);
      assertNotNull(created.getId());
      assertEquals(created.getName(), "Service Network");
      assertEquals(created.isDefaultNST(), true);
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto

      DatacenterDto datacenter = new DatacenterDto();
      datacenter.addLink(new RESTLink("networkservicetypes",
            "http://localhost/api/admin/datacenters/1/networkservicetypes"));

      NetworkServiceTypeDto nst = new NetworkServiceTypeDto();
      nst.setName("Service Network");
      nst.setDefaultNST(true);

      NetworkServiceTypeDto created = api.createNetworkServiceType(datacenter, nst);
      assertNotNull(created.getId());
      assertEquals(created.getName(), "Service Network");
      assertEquals(created.isDefaultNST(), true);
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto

                  .payload(
                        payloadFromResourceWithContentType("/payloads/nst-edit.xml",
                              normalize(NetworkServiceTypeDto.MEDIA_TYPE))) //
                  .build());

      NetworkServiceTypeDto nst = new NetworkServiceTypeDto();
      RESTLink editLink = new RESTLink("edit", "http://localhost/api/admin/datacenters/1/networkservicetypes/1");
      editLink.setType(NetworkServiceTypeDto.BASE_MEDIA_TYPE);
      nst.addLink(editLink);
      nst.setId(1);
      nst.setDefaultNST(true);
      nst.setName("Service Network");

      NetworkServiceTypeDto created = api.updateNetworkServiceType(nst);
      assertNotNull(created.getId());
      assertEquals(created.getName(), "Service Network");
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto

            .endpoint(URI.create("http://localhost/api/admin/datacenters/1/networkservicetypes/1")) //
            .addHeader("Cookie", tokenAuth) //
            .build(), //
            HttpResponse.builder().statusCode(204).build());

      NetworkServiceTypeDto nst = new NetworkServiceTypeDto();
      RESTLink editLink = new RESTLink("edit", "http://localhost/api/admin/datacenters/1/networkservicetypes/1");
      editLink.setType(NetworkServiceTypeDto.BASE_MEDIA_TYPE);
      nst.addLink(editLink);

      api.deleteNetworkServiceType(nst);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.