Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thierryxing/sentry-ruby-api
Ruby wrapper for getsentry/Sentry REST API
https://github.com/thierryxing/sentry-ruby-api
getsentry ruby-wrapper sentry
Last synced: about 1 month ago
JSON representation
Ruby wrapper for getsentry/Sentry REST API
- Host: GitHub
- URL: https://github.com/thierryxing/sentry-ruby-api
- Owner: thierryxing
- License: bsd-2-clause
- Created: 2016-08-27T08:43:25.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-06-24T13:31:36.000Z (about 1 year ago)
- Last Synced: 2024-07-19T21:00:52.900Z (2 months ago)
- Topics: getsentry, ruby-wrapper, sentry
- Language: Ruby
- Homepage:
- Size: 89.8 KB
- Stars: 19
- Watchers: 5
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Sentry Ruby API
[![Build Status](https://travis-ci.org/thierryxing/sentry-ruby-api.svg?branch=master)](https://travis-ci.org/thierryxing/sentry-ruby-api)
[![Gem Version](https://badge.fury.io/rb/sentry-api.svg)](https://badge.fury.io/rb/sentry-api)
[![License](https://img.shields.io/badge/license-BSD-red.svg?style=flat)](https://github.com/thierryxing/sentry-ruby-api/blob/master/LICENSE.txt)Sentry Ruby API is a Ruby wrapper for the [getsentry/sentry API](https://docs.sentry.io/hosted/api/).
## Installation
Install it from rubygems:```sh
gem install sentry-api
```Or add to a Gemfile:
```ruby
gem 'sentry-api'
```## Usage
Configuration example:
```ruby
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:
```ruby
# 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](https://github.com/NARKOZ/gitlab) ruby wrapper which really gives me a lot of inspiration.