Project

sentry-api

0.02
No release in over 3 years
Low commit activity in last 3 years
A Ruby wrapper for the Sentry API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 10.0
>= 3.5.0, ~> 3.5.0
>= 2.1.0, ~> 2.1.0
~> 0.9.5

Runtime

~> 0.3.16
 Project Readme

Sentry Ruby API

Build Status Gem Version License

Sentry Ruby API is a Ruby wrapper for the getsentry/sentry API.

Installation

Install it from rubygems:

gem install sentry-api

Or add to a Gemfile:

gem 'sentry-api'

Usage

Configuration example:

SentryApi.configure do |config|
  config.endpoint = 'http://example.com/api/0'
  config.auth_token = 'your_auth_token'
  config.default_org_slug = 'sentry-sc'
end

(Note: If you are using getsentry.com's hosted service, your endpoint will be https://sentry.io/api/0/)

Usage examples:

# set an API endpoint
SentryApi.endpoint = 'http://example.com/api/0'
# => "http://example.com/api/0"

# set a user private token
SentryApi.auth_token = 'your_auth_token'
# => "your_auth_token"

# configure a proxy server
SentryApi.http_proxy('proxyhost', 8888)
# proxy server w/ basic auth
SentryApi.http_proxy('proxyhost', 8888, 'user', 'pass')

# list projects
SentryApi.projects

# initialize a new client
s = SentryApi.client(endpoint: 'https://api.example.com', auth_token: 'your_auth_token', default_org_slug: 'sentry-sc')

# a paginated response
projects = SentryApi.projects

# check existence of the next page
projects.has_next_page?

# retrieve the next page
projects.next_page

# iterate all projects
projects.auto_paginate do |project|
  # do something
end

# retrieve all projects as an array
projects.auto_paginate

Development

After 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.

License

Released under the BSD 2-clause license. See LICENSE.txt for details.

Special Thank

Thanks to NARKOZ's gitlab ruby wrapper which really gives me a lot of inspiration.