GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - pat/render_api: Ruby interface for the render.com API.

BranchesTags
Open more actions menu

Latest commit

 

History

26 Commits
26 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
bin
bin
 
 
lib
lib
 
 
spec
spec
 
 
.gitignore
.gitignore
 
 
.rspec
.rspec
 
 
.rubocop.yml
.rubocop.yml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
Gemfile
Gemfile
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
render_api.gemspec
render_api.gemspec
 
 

Repository files navigation

Render API

A Ruby interface for the render.com API.

At this point in time all known API endpoints are supported.

Installation

Add this line to your application's Gemfile:

gem "render_api"

And then execute:

$ bundle install

Or install it yourself as:

$ gem install render_api

Usage

Returned response objects can be enumerated upon when a list of records are returned, and also can provide rate-limit details via rate_limit, rate_limit_remaining, and rate_limit_reset methods.

The response objects respond to underscored versions of the attribute names - e.g. a service responds to auto_deploy with the value from the underlying hash for the key autoDeploy. Timestamp strings are automatically converted to Time objects, and nested hashes are also provided as these utility objects.

Also: when the response objects are from a list, they respond to cursor, for use with pagination.

Creating a client

client = RenderAPI.client(api_key)

Services

client.services.list(limit: nil, cursor: nil, filters: nil)
client.services.find(service_id)
services = client.services.list(limit: 20)

puts services.rate_limit, services.rate_limit_remaining

services.each do |service|
  puts service.id
  puts service.cursor
  puts service.service_details.build_command
end

# https://api-docs.render.com/reference/create-service
client.services.create(name: "my-new-service", ...)
# https://api-docs.render.com/reference/update-service
client.services.update(service_id, name: "my-new-service", ...)
client.services.restart(service_id)
client.services.delete(service_id)

client.services.suspend(service_id)
client.services.resume(service_id)
client.services.scale(service_id, num_instances: 5)

client.services.list_headers(service_id, limit: nil, cursor: nil, filters: nil)
client.services.list_routes(service_id, limit: nil, cursor: nil, filters: nil)
client.services.list_variables(service_id, limit: nil, cursor: nil)
# Note that updating variables requires all variables to be provided.
# https://api-docs.render.com/reference/update-env-vars-for-service
# (i.e. a full update, not a partial update)
client.services.update_variables(
  service_id,
  [
    { key: "RAILS_ENV", value: "production" },
    { key: "RAILS_SESSION_SECRET", generate_value: "yes" }
  ]
)

Deploys

client.deploys.list(service_id, limit: nil, cursor: nil, filters: nil)
client.deploys.create(service_id, clear_cache: "do_not_clear")
client.deploys.find(service_id, deploy_id)

Domains

client.domains.list(service_id, limit: nil, cursor: nil, filters: nil)
client.domains.create(service_id, name: "example.com")
client.domains.find(service_id, domain_id)
client.domains.verify(service_id, domain_id)
client.domains.delete(service_id, domain_id)

Owners

client.owners.list(limit: nil, cursor: nil, filters: nil)
client.owners.find(owner_id)

Jobs

client.jobs.list(service_id, limit: nil, cursor: nil, filters: nil)
client.jobs.create(service_id, start_command: "whoami")
client.jobs.find(service_id, job_id)

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bundle exec rspec to run the tests, and bundle exec rubocop to confirm linting and code structure. You can also run bin/console for an interactive prompt that will allow you to experiment.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/pat/render_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Render API project's codebase and other repository features is expected to follow the code of conduct.

About

Ruby interface for the render.com API.

Resources

Readme
MIT license

Code of conduct

Code of conduct
Activity

Stars

19 stars

Watchers

1 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.