Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcelod/codeigniter-digitalocean
A CodeIgniter library for using the DigitalOcean API
https://github.com/marcelod/codeigniter-digitalocean
Last synced: 3 months ago
JSON representation
A CodeIgniter library for using the DigitalOcean API
- Host: GitHub
- URL: https://github.com/marcelod/codeigniter-digitalocean
- Owner: marcelod
- License: gpl-3.0
- Fork: true (jacobtomlinson/codeigniter-digitalocean)
- Created: 2016-11-10T19:44:13.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2014-06-01T08:06:32.000Z (over 10 years ago)
- Last Synced: 2024-04-17T03:13:02.353Z (9 months ago)
- Language: PHP
- Size: 164 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
CodeIgniter DigitalOcean Library
========================A CodeIgniter library for using the DigitalOcean API. All methods supported.
A port of the [DigitalOcean PHP Class](https://github.com/tuefekci/DigitalOcean-PHP-Class) by [Giacomo Tüfekci](https://github.com/tuefekci).
Documentation for the [Digital Ocean API](https://www.digitalocean.com/api) can be found here.
Installation
---------------------
To install simply copy the contents of the **config**, **helper** and **library** folders into the same folders in your CodeIgniter project application folder.Config
---------------------
To configure this library you must enter your DigitalOcean **Client ID** and **API Key** into `config/digitalocean.php`.Instructions on how to generate this information can be found on the [DigitalOcean website](https://www.digitalocean.com/community/articles/how-to-use-the-digitalocean-api).
Example Usage
---------------------
```PHP
load->library('digitalocean');
$query = $this->digitalocean->getDroplets();
print 'Status: ' . $query->status . '
';
foreach ($query->droplets as $droplet){
print 'Name: ' . $droplet->name . '
';
print 'IP: ' . $droplet->ip_address . '
';
print '
';
}
}
}/* End of file example.php */
/* Location: ./application/controllers/example.php */
```
The above will result in something like this:
```
Status: OKName: your-droplet-name
IP: your-droplet-ipName: your-droplet-name
IP: your-droplet-ipetc.
```