{"id":28478195,"url":"https://github.com/seanhandley/datacentred-api-ruby","last_synced_at":"2026-06-01T03:31:22.991Z","repository":{"id":62556774,"uuid":"99701057","full_name":"seanhandley/datacentred-api-ruby","owner":"seanhandley","description":"Ruby client library for automating DataCentred account management.","archived":false,"fork":false,"pushed_at":"2017-10-02T09:28:03.000Z","size":166,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-13T12:50:45.658Z","etag":null,"topics":["api-client","datacentred","openstack","ruby"],"latest_commit_sha":null,"homepage":"https://my.datacentred.io/api","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/seanhandley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-08T14:19:36.000Z","updated_at":"2017-10-24T11:26:45.000Z","dependencies_parsed_at":"2022-11-03T06:00:50.975Z","dependency_job_id":null,"html_url":"https://github.com/seanhandley/datacentred-api-ruby","commit_stats":null,"previous_names":["datacentred/datacentred-api-ruby"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/seanhandley/datacentred-api-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanhandley%2Fdatacentred-api-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanhandley%2Fdatacentred-api-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanhandley%2Fdatacentred-api-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanhandley%2Fdatacentred-api-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seanhandley","download_url":"https://codeload.github.com/seanhandley/datacentred-api-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanhandley%2Fdatacentred-api-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33759178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api-client","datacentred","openstack","ruby"],"created_at":"2025-06-07T17:09:35.916Z","updated_at":"2026-06-01T03:31:22.966Z","avatar_url":"https://github.com/seanhandley.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Datacentred](https://assets-cdn.datacentred.io/assets/DC_Mono_B-903aac5ca4f5c6887193d880dbd1196deb8a978027eef5cb32de78b66d085935.png)\n\nRuby client library for automating DataCentred account management.\n\n[www.datacentred.co.uk](https://www.datacentred.co.uk)\n\n[![CircleCI](https://circleci.com/gh/datacentred/datacentred-api-ruby.svg?style=svg\u0026circle-token=c284db6421742dcfe8c50f52945c31d9b976effb)](https://circleci.com/gh/datacentred/datacentred-api-ruby)\n[![Gem Version](https://badge.fury.io/rb/datacentred.png)](http://badge.fury.io/rb/datacentred) [![Code Climate](https://codeclimate.com/github/datacentred/datacentred-api-ruby/badges/gpa.svg)](https://codeclimate.com/github/datacentred/datacentred-api-ruby) [![Coverage Status](https://coveralls.io/repos/github/datacentred/datacentred-api-ruby/badge.svg?branch=master)](https://coveralls.io/github/datacentred/datacentred-api-ruby?branch=master)\n\n# Installation\n\n```\ngem install datacentred\n```\n\nor\n\n(in Gemfile or .gemspec)\n```ruby\ngem 'datacentred'\n```\n\nthen\n\n```ruby\nrequire 'datacentred'\n```\n\n# Usage\n\nThis API allows you to automate operations against your DataCentred account.\n\nOperations include:\n\n* Creating and managing users;\n* Creating and managing roles for users;\n* Managing OpenStack Project creation, quota adjustments, and user assignments;\n* Viewing detailed usage/billing information for your account.\n\n## Authentication\n\nThe API uses two pieces of information to authenticate access.\n\nA unique access key specific to your DataCentred account, and a secret key which is generated once.\n\nTo get started:\n\n1. Find your API access key and secret key at [my.datacentred.io](https://my.datacentred.io)\n\n![API Credentials](https://user-images.githubusercontent.com/98526/30334767-79f4617c-97d8-11e7-962c-ec3115d13896.png)\n\n2. Set your credentials by exporting your access key and secret key as environment variables:\n\n```\nexport DATACENTRED_ACCESS=\"my_access\"\nexport DATACENTRED_SECRET=\"my_secret\"\n```\n\nOr setting your keys manually using the following methods:\n\n```ruby\nDatacentred.access_key = 'my_access'\nDatacentred.secret_key = 'my_secret'\n```\n\nNOTE: If you use this approach, the gem will ignore any values assigned to the environment variables.\n\n## Usage Examples\n\nThe `User`, `Project`, and `Role` entities all support CRUD operations via the following methods:\n\n* `.all` - returns an index of all entities of this type.\n* `.create params` - creates a new entity where `params` is a hash of properties.\n* `.find id` - finds the entity via the unique identifier `id`.\n\nreturned objects can be edited and deleted:\n\n* `object.name = \"Foo\"` - changes the `name` property to `Foo`.\n* `object.save` - saves any object changes so they persist on the server.\n* `object.destroy` - removes the object from the server.\n\nHere are some worked examples:\n\n### List all available users\n\n```ruby\nDatacentred::User.all\n# =\u003e [#\u003cDatacentred::Model::User id=\"2bd21ee25cde40fdb9454954e4fbb4b5\", ...\u003e, ...]\n```\n\n### Find a user by id\n\n```ruby\nuser = Datacentred::User.find \"2bd21ee25cde40fdb9454954e4fbb4b5\"\n# =\u003e #\u003cDatacentred::Model::User id=\"2bd21ee25cde40fdb9454954e4fbb4b5\", ...\u003e\n```\n\n### Update a project\n\n```ruby\nproject      = Datacentred::Project.find \"6d5277716c4b10d2177814af50b77175\"\nproject.name = \"Foo\"\nproject.save\n# =\u003e #\u003cDatacentred::Model::Project id=\"6d5277716c4b10d2177814af50b77175\", name= \"Foo\", ...\u003e\n```\n\n### Create a role\n\nAcceptable permissions are: 'api.read', 'cloud.read', 'roles.modify', 'roles.read', 'storage.read', 'tickets.modify', 'usage.read'.\n\n```ruby\nrole = Datacentred::Role.create name: \"foo\", permissions: [\"usage.read\"]\n# =\u003e #\u003cDatacentred::Model::Role id=\"654f423e-646a-4742-849d-d8c9ab9b4f39\", name=\"foo\", admin=false, permissions=[\"usage.read\"] ...\u003e\n```\n\n### Add a user to a role\n\n```ruby\nrole = Dataentred::Role.find  \"654f423e-646a-4742-849d-d8c9ab9b4f39\"\nuser = Datacentred::User.find \"2bd21ee25cde40fdb9454954e4fbb4b5\"\nrole.add_user user\n# =\u003e true\n```\n\n### Remove a user from a project\n\n```ruby\nuser    = Datacentred::User.find    \"2bd21ee25cde40fdb9454954e4fbb4b5\"\nproject = Datacentred::Project.find \"6d5277716c4b10d2177814af50b77175\"\nproject.remove_user user\n# =\u003e true\n```\n\n### Get usage data for a given year and month\n\nUsage data is returned simply by supplying a year and a month. If the year/month are current then the data will be as recent as the time contained within the `last_updated_at` property.\n\n```ruby\n@usage = Datacentred::Usage.find 2017, 6\n# =\u003e #\u003cDatacentred::Model::Usage last_updated_at=2017-07-12 09:46:54 UTC, projects=[{:id=\u003e\"37033518a4514f12adeb8346ac3f188c\"\n@usage.projects.first.name\n# =\u003e \"wyld_stallyns\"\n@usage.projects.first.usage.instances.first.current_flavor.name\n=\u003e \"dc1.1x1\"\n```\n\n## Errors\n\nThe gem may raise the following standard errors:\n\n* `Unauthorized` - Your credentials are incorrect or your account isn't authorized for API access.\n* `NotFound` - The entity you referred to can't be found with the ID you supplied.\n* `UnprocessableEntity` - There was a validation issue with your request (only applies to create/delete/update operations)\n\n## Documentation\n\nFull documentation is also available via https://datacentred.github.io/datacentred-api-ruby/\n\n## API Reference Manual\n\nPlease check out the [DataCentred API Documentation](https://my.datacentred.io/api/docs/v1) for a comprehensive description of the API itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseanhandley%2Fdatacentred-api-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseanhandley%2Fdatacentred-api-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseanhandley%2Fdatacentred-api-ruby/lists"}