Modern Developer, Oracle News | March 1, 2017

Introducing Open Source SDKs for Oracle Bare Metal Cloud Services

By: Joe Levy


By now, you've probably already heard of Oracle's awesome new Bare Metal Cloud Services, which delivers on-demand access to secure, high-performance physical machines at the click of a button. But what you may not have heard of is the various software development kits (SDKs) the Bare Metal Cloud Services team delivers, which allow you to automate all the frequent, time-consuming, and error-prone tasks you'd usually perform manually. And what you almost certainly haven't heard—these SDKs are now going open source!

You heard that right—all of the operations you can perform via the Bare Metal Cloud Services console can also be easily automated from JavaPythonRuby, and even the command line. For example, here's how you'd create a Bare Metal instance, with internet connectivity and SSH access, in its own virtual network and subnet, using the Java SDK:

  public static void main(String[] args) throws Exception {
  String compartmentId = "SOME OCID";
  String instanceDisplayName = "SOME NAME";
  String networkCidrBlock = "";
  String sshPublicKey =
  "ssh-rsa AAAAB3NzaC1y...key shortened for example...fdK/ABqxgH7sy3AWgBjfj some description";
  String subnetDisplayName = instanceDisplayName + "-subnet";
  String vcnDisplayName = instanceDisplayName + "-vcn";
  String internetGatewayDisplayName = instanceDisplayName + "-internet-gateway";
  String configurationFilePath = "~/.oraclebmc/config";
  String profile = "DEFAULT";
  AuthenticationDetailsProvider provider =
  new ConfigFileAuthenticationDetailsProvider(configurationFilePath, profile);
  ComputeClient computeClient = new ComputeClient(provider);
  VirtualNetworkClient vcnClient = new VirtualNetworkClient(provider);
  List<AvailabilityDomain> availabilityDomains =
  getAvailabilityDomains(provider, compartmentId);
  AvailabilityDomain adToUse = availabilityDomains.get(0);
  List<Image> images = getImages(provider, computeClient, compartmentId);
  List<Shape> shapes = getShapes(provider, computeClient, compartmentId);
  Vcn vcn = createVcn(vcnClient, compartmentId, vcnDisplayName, networkCidrBlock);
  InternetGateway internetGateway =
  vcnClient, compartmentId, internetGatewayDisplayName, vcn.getId());
  vcnClient, compartmentId, vcn.getDefaultRouteTableId(), internetGateway);
  Subnet subnet =
  Instance instance =
  System.out.println("Instance is provisioning...");
  instance = waitForInstanceProvisioningToComplete(computeClient, instance.getId());
  System.out.println("Instance is provisioned:");

(You can find many more examples in the documentation and downloads for each SDK.)

We know developers in this day and age have a multitude of programming languages to choose from, and some languages work better than others for certain projects. That's why a core tenet of Bare Metal Cloud Services is to support integration via a variety of programming languages, with support for even more coming soon. (Side note: Are there any languages you're looking for, specifically? Let us know in the comments.)

But sometimes support for your favorite programming language isn't enough. Sometimes you want to look at the underlying code, to figure out how it works, for educational or troubleshooting purposes. Sometimes you want to improve the projects you depend on in your day to day—to fix bugs, add new functionality, or even just make something more elegant. And sometimes you want a platform to engage with the engineering team and fellow users of projects, to help shape their future.

That's why I'm so excited to announce the open sourcing of the Java and Python SDKs for Oracle Bare Metal Cloud Services, on GitHub! Now that these SDKs are open source, learning, troubleshooting, contributing, and collaborating around the Oracle Bare Metal Cloud Services platform just reached a whole new level. And these two projects are just the beginning—expect the rest of our current and upcoming developer tools to get the same treatment soon.

So check us out on GitHub—we're eagerly awaiting your feedback and contributions. And if you're just getting started with Bare Metal Cloud Services, take a peek at our Getting Started Guide and head over to cloud.oracle.com/tryit to get a cloud account with free credits.

Until next time—keep calm and bare metal!

Joe Levy is principal technical program manager for Oracle Bare Metal Cloud Services.

This is a syndicated post, view the original post here