https://github.com/fog/fog-oraclecloud
Fog library for the Oracle Cloud
https://github.com/fog/fog-oraclecloud
Last synced: about 1 year ago
JSON representation
Fog library for the Oracle Cloud
- Host: GitHub
- URL: https://github.com/fog/fog-oraclecloud
- Owner: fog
- License: mit
- Created: 2016-07-13T06:15:24.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-05-27T20:44:04.000Z (about 5 years ago)
- Last Synced: 2025-06-30T20:50:07.249Z (about 1 year ago)
- Language: Ruby
- Size: 189 KB
- Stars: 5
- Watchers: 6
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fog::OracleCloud
Module for the 'fog' gem to support the Oracle Cloud (IaaS and PaaS)
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'fog-oraclecloud'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install fog-oraclecloud
## Usage
Before you can use fog-oraclecloud, you must require it in your application:
```ruby
require 'fog/oraclecloud'
```
Since it's a bad practice to have your credentials in source code, you should load them from default fog configuration file: ```~/.fog```. This file could look like this:
```
default:
oracle_username:
oracle_password:
oracle_domain:
oracle_region:
oracle_compute_api:
oracle_storage_api:
```
### Example: Java Cloud Service
Get all Java Instances
```ruby
instances = Fog::OracleCloud[:java].instances
```
Create a Java Instance
```ruby
instance = Fog::OracleCloud[:java].instances.create(
:service_name => 'TestWLS',
:description => 'A new weblogic instance',
:dba_name => 'SYS',
:dba_password => 'password',
:db_service_name => 'TestDB',
:admin_password => 'Welcome1$',
:admin_username => 'weblogic',
:shape => 'oc3',
:version => '12.2.1',
:ssh_key => 'ssh-rsa AAAAB3NzaC1yc2...',
)
```
Delete an instance
```ruby
instance = Fog::OracleCloud[:java].instances.get('TestWLS')
# Have to add the database details in so that the tables in the database can be removed
instance.dba_name = 'Admin'
instance.dba_password = 'password'
instance.destroy()
```
## Supported Services
The following services are supported:
* Java Cloud Service
* create_instance
* delete_instance
* get_instance
* get_server
* list_instances
* list_servers
* SOA Cloud Service
* create_instance
* delete_instance
* get_instance
* list_instances
* Database Cloud Service
* backup_instance
* create_instance
* create_snapshot
* delete_instance
* delete_snapshot
* get_instance
* get_snapshot
* list_backups
* list_instances
* list_patches
* list_recoveries
* list_servers
* list_snapshots
* recover_instance
* scale_instance
* Compute Cloud Servcice
* create_image
* create_image_list
* create_instance
* create_orchestration
* create_security_application
* create_security_rule
* create_ssh_key
* create_volume
* delete_image_list
* delete_instance
* delete_orchestration
* delete_security_application
* delete_ssh_key
* get_image
* get_image_list
* get_instance
* get_orchestration
* get_security_application
* get_security_rule
* get_ssh_key
* list_image_lists
* list_images
* list_instances
* list_orchestrations
* list_security_applications
* list_security_lists
* list_security_rules
* list_ssh_keys
* list_volumes
* start_orchestration
* stop_orchestration
* update_image
* update_image_list
* update_orchestration
* update_ssh_key
* Storage Cloud Service
* create_container
* delete_container
* get_container
* list_containers
These basically align with the REST API documentation on docs.oracle.com. Check there for particulars around parameters, types etc.
**Note**: The APIs above are slightly modified from the Oracle cloud to provide consistency across requests. Keep in mind the following:
* All parameters are given in lower camel case (ie: service_name, not ServiceName)
* For IaaS services you don't need to provide the fully qualified names (ie: Compute//). The system will prepend the configured user when necessary
* The Java and Database configuration has all the parameters as top level attributes (ie: don't configure parameters/content_port, use content_port)
* Smart defaults are included where possible. Check the code to see.
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/fog/fog-oraclecloud.