{"id":28477890,"url":"https://github.com/fog/fog-digitalocean","last_synced_at":"2025-07-02T18:31:49.844Z","repository":{"id":56847361,"uuid":"55074074","full_name":"fog/fog-digitalocean","owner":"fog","description":"Fog for DigitalOcean Platform — Edit","archived":false,"fork":false,"pushed_at":"2019-06-25T22:43:16.000Z","size":113,"stargazers_count":17,"open_issues_count":7,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-07T17:10:20.292Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fog.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-30T15:21:23.000Z","updated_at":"2022-12-20T10:34:49.000Z","dependencies_parsed_at":"2022-09-09T06:21:33.576Z","dependency_job_id":null,"html_url":"https://github.com/fog/fog-digitalocean","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/fog/fog-digitalocean","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fog%2Ffog-digitalocean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fog%2Ffog-digitalocean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fog%2Ffog-digitalocean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fog%2Ffog-digitalocean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fog","download_url":"https://codeload.github.com/fog/fog-digitalocean/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fog%2Ffog-digitalocean/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263193699,"owners_count":23428564,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-07T17:08:50.909Z","updated_at":"2025-07-02T18:31:49.833Z","avatar_url":"https://github.com/fog.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fog::DigitalOcean\n\n[![Gem Version](https://badge.fury.io/rb/fog-digitalocean.svg)](https://badge.fury.io/rb/fog-digitalocean) [![Build Status](https://travis-ci.org/fog/fog-digitalocean.svg?branch=master)](https://travis-ci.org/fog/fog-digitalocean) [![Dependency Status](https://gemnasium.com/fog/fog-digitalocean.svg)](https://gemnasium.com/fog/fog-digitalocean) [![Coverage Status](https://coveralls.io/repos/github/fog/fog-digitalocean/badge.svg?branch=master)](https://coveralls.io/github/fog/fog-digitalocean?branch=master) [![Code Climate](https://codeclimate.com/github/fog/fog-digitalocean/badges/gpa.svg)](https://codeclimate.com/github/fog/fog-digitalocean) [![Join the chat at https://gitter.im/fog/fog-digitalocean](https://badges.gitter.im/fog/fog-digitalocean.svg)](https://gitter.im/fog/fog-digitalocean?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nThis is the plugin Gem to talk to [Digitalocean](http://digitalocean.org) clouds via fog.\n\nThe main maintainers for the Digitalocean sections are @jjasghar and @h0lyalg0rithm. Please send CC them on pull requests.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'fog-digitalocean'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install fog-digitalocean\n\n## Usage\n\n### Initial Setup\n\n\n# Getting started: the compute service\n\nYou'll need a DigitalOcean account and an API token to use this provider.\n\nGet one from https://cloud.digitalocean.com/settings/tokens/new\n\nWrite down the Access Token.\n\n## Connecting, retrieving and managing server objects\n\nBefore we start, I guess it will be useful to the reader to know\nthat Fog servers are 'droplets' in DigitalOcean's parlance.\n'Server' is the Fog way to name VMs, and we have\nrespected that in the DigitalOcean's Fog provider.\n\nFirst, create a connection to the host:\n\n```ruby\nrequire 'fog'\n\ndocean = Fog::Compute.new({\n  :provider =\u003e 'DigitalOcean',\n  :digitalocean_token   =\u003e 'poiuweoruwoeiuroiwuer', # your Access Token here\n})\n```\n\n## SSH Key Management\n\nAccess to DigitalOcean servers can be managed with SSH keys. These can be assigned to servers at creation time so you can access them without having to use a password.\n\nCreating a key:\n\n```ruby\ndocean.ssh_keys.create(\n  :name        =\u003e 'Default SSH Key',\n  :ssh_pub_key =\u003e File.read('~/.ssh/id_rsa.pub'))\n)\n```\n\nListing all keys:\n\n```ruby\ndocean.ssh_keys.each do | key |\n  puts key.name\n  puts key.public_key\n  puts key.id\nend\n```\n\nDestroying a key:\n\n```ruby\ndocean.ssh_keys.destroy(:id =\u003e '27100')\n```\n## Listing servers\n\nListing servers and attributes:\n\n```ruby\ndocean.servers.each do |server|\n  # remember, servers are droplets\n  puts server.id\n  puts server.name\n  puts server.status\n  puts (server.image['slug'] || server.image['name']) # slug is only for public images, private images use name\n  puts server.size['slug']\n  puts server.region['slug']\nend\n```\n\n## Server creation and life-cycle management\n\nCreating a new server (droplet):\n\n```ruby\nserver = docean.servers.create :name =\u003e 'foobar',\n                               # use the last image listed\n                               :image  =\u003e docean.images.last.id,\n                               # use the first flavor (aka size) listed\n                               :size =\u003e docean.flavors.first.slug,\n                               # use the first region listed\n                               :region =\u003e docean.regions.first.slug\n```\n\nThe server is automatically started after that.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/fog/fog-digitalocean. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffog%2Ffog-digitalocean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffog%2Ffog-digitalocean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffog%2Ffog-digitalocean/lists"}