{"id":18091421,"url":"https://github.com/rivsc/ruby_ovh","last_synced_at":"2025-04-06T02:43:21.934Z","repository":{"id":143096536,"uuid":"190593794","full_name":"rivsc/ruby_ovh","owner":"rivsc","description":"Ruby Ovh API","archived":false,"fork":false,"pushed_at":"2021-03-19T14:51:28.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T08:56:02.693Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rivsc.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-06T14:16:55.000Z","updated_at":"2021-03-19T14:51:30.000Z","dependencies_parsed_at":"2023-03-23T04:03:00.881Z","dependency_job_id":null,"html_url":"https://github.com/rivsc/ruby_ovh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rivsc%2Fruby_ovh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rivsc%2Fruby_ovh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rivsc%2Fruby_ovh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rivsc%2Fruby_ovh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rivsc","download_url":"https://codeload.github.com/rivsc/ruby_ovh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247426985,"owners_count":20937197,"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":"2024-10-31T18:11:49.892Z","updated_at":"2025-04-06T02:43:21.917Z","avatar_url":"https://github.com/rivsc.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RubyOvh\n\n## Install\n\nAdd this in your Gemfile :\n\n```ruby\ngem 'ruby_ovh'\n```\n\n## Prerequisites\n\n1. Create your app at Ovh : [https://eu.api.ovh.com/createApp/](https://eu.api.ovh.com/createApp/) and get an application_key (ak) and an application_secret (as).\n2. The first time you need a consumer_key (ck). You can generate as follow (thanks to your application_key and application_secret) :\n\n#### Create a consumer_key with default AccessRules (GET/POST/PUT)\n\n```ruby\nclient = RubyOvh::Client.new({application_key: 'XXXX', application_secret: 'YYYY' })\nresponse = client.generate_consumer_key\nputs \"You need to memorize your consumer_key : #{response[:consumer_key]}\"\nputs \"You need visit this address in your browser in order to activate your consumer key #{response[:validation_url]}\"\n```\n\n### OR\n\n#### create a consumer_key with specific AccessRules (here GET/POST/PUT/DELETE)\n\n```ruby\nclient = RubyOvh::Client.new({application_key: 'XXXX', application_secret: 'YYYY' })\nresponse = client.generate_consumer_key({ access_rules: [\n                {\n                    \"method\": \"GET\",\n                    \"path\": \"/*\"\n                },{\n                    \"method\": \"POST\",\n                    \"path\": \"/*\"\n                },{\n                    \"method\": \"PUT\",\n                    \"path\": \"/*\"\n                },{\n                    \"method\": \"DELETE\",\n                    \"path\": \"/*\"\n                }\n            ] })\nputs \"You need to memorize your consumer_key : #{response[:consumer_key]}\"\nputs \"You need visit this address in your browser in order to activate your consumer key #{response[:validation_url]}\"\n```\n\n## Usage\n\nAfter that, thanks to your consumer key, you can call Ovh API as follow :\n\nGET request :\n\n```ruby\nclient = RubyOvh::Client.new({application_key: 'XXXX', application_secret: 'YYYY', consumer_key: 'ZZZZZ' })\nputs client.query({ method: 'GET', url: \"/me\", query: {} })\n```\n\nAnother GET request with params :\n\n```ruby\nputs client.query({ url: \"/domain/zone/mydomain.org/record?fieldType=A\" , method: \"GET\", query: {} })\n```\n\nPOST request :\n\n```ruby\nclient.query({ url: \"/domain/zone/mydomain.org/record\" , method: \"POST\", query: {\n  \"subDomain\": \"blog\",\n  \"target\": \"XX.X.X.XXX\",\n  \"fieldType\": \"A\"\n}})\n```\n\nList Ovh API : [https://eu.api.ovh.com/console/#/](https://eu.api.ovh.com/console/#/)\n\nRivsc.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frivsc%2Fruby_ovh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frivsc%2Fruby_ovh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frivsc%2Fruby_ovh/lists"}