Tabnine Logo
GuestOSApi.listOSTypes
Code IndexAdd Tabnine to your IDE (free)

How to use
listOSTypes
method
in
org.jclouds.cloudstack.features.GuestOSApi

Best Java code snippets using org.jclouds.cloudstack.features.GuestOSApi.listOSTypes (Showing top 6 results out of 315)

origin: apache/jclouds

@Override
public Map<String, OSType> get() {
 GuestOSApi guestOSClient = client.getGuestOSApi();
 return Maps.uniqueIndex(guestOSClient.listOSTypes(), new Function<OSType, String>() {
   @Override
   public String apply(OSType arg0) {
    return arg0.getId();
   }
 });
}
@Override
origin: apache/jclouds

@Inject
public OSCategoryIn(CloudStackApi client) {
 this(Suppliers.ofInstance(checkNotNull(client, "client").getGuestOSApi().listOSCategories()), Suppliers
    .ofInstance(client.getGuestOSApi().listOSTypes()));
}
origin: apache/jclouds

public void testListOSTypes() throws Exception {
 Set<OSType> response = client.getGuestOSApi().listOSTypes();
 assert null != response;
 assertTrue(response.size() > 0);
 for (OSType type : response) {
   OSType newDetails = getOnlyElement(client.getGuestOSApi().listOSTypes(
      ListOSTypesOptions.Builder.id(type.getId())));
   assertEquals(type.getId(), newDetails.getId());
   checkOSType(type);
 }
}
origin: apache/jclouds

public void testRegisterISO() throws Exception {
 Optional<OSType> guestOSTypeOptional = Iterables.tryFind(client.getGuestOSApi().listOSTypes(), Predicates.notNull());
 Optional<Zone> zoneOptional = Iterables.tryFind(client.getZoneApi().listZones(available(true)), Predicates.notNull());
 if (guestOSTypeOptional.isPresent() && zoneOptional.isPresent()) {
   String osTypeId = guestOSTypeOptional.get().getId();
   String zoneId = zoneOptional.get().getId();
   ISO iso = client.getISOApi().registerISO(isoName, "", url, zoneId, RegisterISOOptions.Builder.isPublic(true).osTypeId(osTypeId));
     assertNotNull(iso);
     assertNotNull(iso.getId());
     assertEquals(iso.getName(), isoName);
 } else {
   String skipMessage = String.format("Cannot register the iso with url: %s", url);
   if (zoneOptional.isPresent())
     skipMessage += " without a valid zone";
   else
     skipMessage += " without a valid guest OS type";
   throw new SkipException(skipMessage);
 }
}
origin: apache/jclouds

@BeforeMethod
public void setUp() {
 client = createMock(CloudStackApi.class);
 guestOSClient = createMock(GuestOSApi.class);
 expect(client.getGuestOSApi()).andReturn(guestOSClient).times(2);
 Map<String, String> osCategories = Maps.newHashMap();
 osCategories.put("1", "Ubuntu");
 osCategories.put("2", "CentOS");
 osCategories.put("3", "RHEL");
 expect(guestOSClient.listOSCategories()).andReturn(osCategories);
 Set<OSType> osTypes = ImmutableSet.of(
   OSType.builder().id("10").OSCategoryId("1").description("Ubuntu 10.04 LTS").build(),
   OSType.builder().id("20").OSCategoryId("2").description("CentOS 5.4").build(),
   OSType.builder().id("30").OSCategoryId("3").description("RHEL 6").build()
 );
 expect(guestOSClient.listOSTypes()).andReturn(osTypes);
 replay(client, guestOSClient);
}
origin: apache/jclouds

Network network = Iterables.getOnlyElement(networks, null);
assertNotNull(network);
Set<OSType> osTypes = client.getGuestOSApi().listOSTypes();
OSType osType = Iterables.getFirst(osTypes, null);
org.jclouds.cloudstack.featuresGuestOSApilistOSTypes

Javadoc

Lists all supported OS types for this cloud.

Popular methods of GuestOSApi

  • listOSCategories
    Lists all supported OS categories for this cloud.
  • getOSCategory
    get a specific os category by id
  • getOSType
    get a specific os type by id

Popular in Java

  • Making http requests using okhttp
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now