congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ServerInfoToNodeMetadata
Code IndexAdd Tabnine to your IDE (free)

How to use
ServerInfoToNodeMetadata
in
org.jclouds.cloudsigma2.compute.functions

Best Java code snippets using org.jclouds.cloudsigma2.compute.functions.ServerInfoToNodeMetadata (Showing top 3 results out of 315)

origin: jclouds/jclouds-labs

@Override
public NodeMetadata apply(ServerInfo serverInfo) {
 NodeMetadataBuilder builder = new NodeMetadataBuilder();
 builder.ids(serverInfo.getUuid());
 builder.name(serverInfo.getName());
 builder.group(groupNamingConventionWithoutPrefix.extractGroup(serverInfo.getName()));
 builder.location(getOnlyElement(locations.get()));
 builder.hardware(new HardwareBuilder().ids(serverInfo.getUuid()).processor(new Processor(1, serverInfo.getCpu()))
    .ram(serverInfo.getMemory().intValue())
    .volumes(Iterables.transform(serverInfo.getDrives(), serverDriveToVolume)).build());
 builder.tags(readTags(serverInfo));
 builder.userMetadata(serverInfo.getMeta());
 builder.imageId(extractImageId(serverInfo));
 builder.status(serverStatusToNodeStatus.get(serverInfo.getStatus()));
 builder.publicAddresses(filter(transform(serverInfo.getNics(), nicToAddress), notNull()));
 // CloudSigma does not provide a way to get the credentials.
 // Try to return them from the credential store
 Credentials credentials = credentialStore.get("node#" + serverInfo.getUuid());
 if (credentials instanceof LoginCredentials) {
   builder.credentials(LoginCredentials.class.cast(credentials));
 }
 return builder.build();
}
origin: jclouds/jclouds-labs

ServerInfoToNodeMetadata function = new ServerInfoToNodeMetadata(new ServerDriveToVolume(api), new NICToAddress(),
   serverStatusToNodeStatus, namingConvention, credentialStore, justProvider, api);
NodeMetadata converted = function.apply(input);
assertEquals(converted, expected);
assertEquals(converted.getName(), expected.getName());
origin: org.apache.jclouds.labs/cloudsigma2

@Override
public NodeMetadata apply(ServerInfo serverInfo) {
 NodeMetadataBuilder builder = new NodeMetadataBuilder();
 builder.ids(serverInfo.getUuid());
 builder.name(serverInfo.getName());
 builder.group(groupNamingConventionWithoutPrefix.extractGroup(serverInfo.getName()));
 builder.location(getOnlyElement(locations.get()));
 builder.hardware(new HardwareBuilder().ids(serverInfo.getUuid()).processor(new Processor(1, serverInfo.getCpu()))
    .ram(serverInfo.getMemory().intValue())
    .volumes(Iterables.transform(serverInfo.getDrives(), serverDriveToVolume)).build());
 builder.tags(readTags(serverInfo));
 builder.userMetadata(serverInfo.getMeta());
 builder.imageId(extractImageId(serverInfo));
 builder.status(serverStatusToNodeStatus.get(serverInfo.getStatus()));
 builder.publicAddresses(filter(transform(serverInfo.getNics(), nicToAddress), notNull()));
 // CloudSigma does not provide a way to get the credentials.
 // Try to return them from the credential store
 Credentials credentials = credentialStore.get("node#" + serverInfo.getUuid());
 if (credentials instanceof LoginCredentials) {
   builder.credentials(LoginCredentials.class.cast(credentials));
 }
 return builder.build();
}
org.jclouds.cloudsigma2.compute.functionsServerInfoToNodeMetadata

Most used methods

  • <init>
  • apply
  • extractImageId
  • readTags

Popular in Java

  • Making http requests using okhttp
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Option (scala)
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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