INTERACTING WITH THE ORACLE CLOUD JAVA SDK WITH GRADLE ANDRES ALMIRAY @AALMIRAY
@aalmiray
@aalmiray ORACLE OPEN SOURCE HTTPS://GITHUB.COM/ORACLE
@aalmiray
@aalmiray JAVA SDK FOR ORACLE CLOUD INFRASTRUCTURE HTTPS://GITHUB.COM/ORACLE/OCI-JAVA-SDK
@aalmiray LICENSED UNDER UNIVERSAL PERMISSIVE LICENSE V1.0 APACHE SOFTWARE LICENSE V2.0
@aalmiray
@aalmiray
@aalmiray FILE STRUCTURE oci-java-sdk ├── addons ├── apidocs ├── examples ├── lib ├── shaded │ ├── lib │ └── third-party └── third-party └── lib
@aalmiray
@aalmiray
@aalmiray CONFIGURATION
@aalmiray CONFIGURATION FILE https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/javasdkgett ingstarted.htm Easiest way is to create a configuration file that follows a specific format [DEFAULT] user=<user_id> tenancy=<tenancy_id> region=eu-frankfurt-1 fingerprint=<ssh_fingerprint> pass_phrase=<secret> key_file=~/.oci/oci_api_key.pem
@aalmiray CONFIGURATION FILE String config = “~/.oci/config”; String profile = “DEFAULT”; ConfigFileReader.ConfigFile configFile = ConfigFileReader.parse(config, profile) AuthenticationDetailsProvider provider = new ConfigFileAuthenticationDetailsProvider(configFile) ResourceSearch client = ResourceSearchClient.builder().build(provider);
@aalmiray
@aalmiray USER ID
@aalmiray
@aalmiray
@aalmiray TENANCY ID
@aalmiray
@aalmiray
@aalmiray
@aalmiray SSH KEY
@aalmiray SSH KEYS https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigning key.htm • Provides instruction for creating an uploading SSH keys. • Service supports keys that are protected with a passphrase. • You can upload multiple keys and manage them at the OCI console.
@aalmiray
@aalmiray GRADLE PLUGIN HTTPS://GITHUB.COM/AALMIRAY/OCI-GRADLE-PLUGIN
@aalmiray RATIONALITY • Build tools allow us to compile, test, assemble, and deploy applications. • Gradle has excellent support for speeding up build times. • Gradle supports multiple languages and platforms, such as Java and Go. • The Oracle Cloud supports running applications in Java and Go.
@aalmiray
@aalmiray ONCE RELEASED (OLD WAY) buildscript { repositories { jcenter() gradlePluginPortal() } dependencies { classpath 'org.kordamp.gradle:oci-gradle-plugin:0.1.0' } } apply plugin: 'org.kordamp.gradle.oci'
@aalmiray ONCE RELEASED (NEW WAY) plugins { id 'org.kordamp.gradle.oci' version '0.1.0' }
@aalmiray
@aalmiray
@aalmiray
@aalmiray
BUILD-SCANS
@aalmiray X-RAY YOUR BUILDS • Capture build data on the go. • Analyze problems on the spot. • Deep linking enables better sharing. • Works for both Maven and Gradle.
@aalmiray https://scans.gradle.com/s/nde2zxpa4xb5w
@aalmiray https://scans.gradle.com/s/sr5y2ufwamkb2
@aalmiray FUTURE
@aalmiray ROADMAP • Provide a task for every major service in the OCI Java SDK. • Ability to configure credentials as task inputs. • Keep releases in sync when new OCI Java SDK releases come up. • Provide examples with popular microservice friendly frameworks.
@aalmiray OTHER POSSIBILITIES • If there’s a Gradle plugin then perhaps a Maven plugin is not that far away. • What about IDE integrations? • Or a JavaFX application/container manager paired with graphs and visualizations?
@aalmiray
@aalmiray HTTP://ANDRESALMIRAY.COM/NEWSLETTER HTTP://ANDRESALMIRAY.COM/EDITORIAL
THANK YOU! ANDRES ALMIRAY @AALMIRAY

Interacting with the Oracle Cloud Java SDK with Gradle