module SentryApi::Client::Projects

Public Instance Methods

client_keys(project_slug) click to toggle source

List a Project’s Client Keys.

@example

SentryApi.client_keys('project-slug')

@param project_slug [String] the slug of the project the client keys belong to. @return [Array<SentryApi::ObjectifiedHash>]

# File lib/sentry-api/client/projects.rb, line 99
def client_keys(project_slug)
  get("/projects/#{@default_org_slug}/#{project_slug}/keys/")
end
create_client_key(project_slug, options={}) click to toggle source

Create a new Client Key.

@example

SentryApi.create_client_key('project-slug','new-name')

@param project_slug [String] the slug of the project the client keys belong to. @param [Hash] options A customizable set of options. @option options [String] :name the name for the new key. @return [SentryApi::ObjectifiedHash]

# File lib/sentry-api/client/projects.rb, line 112
def create_client_key(project_slug, options={})
  post("/projects/#{@default_org_slug}/#{project_slug}/keys/", body: options)
end
delete_client_key(project_slug, key_id) click to toggle source

Delete a Client Key.

@example

SentryApi.delete_client_key('project-slug','87c990582e07446b9907b357fc27730e')

@param project_slug [String] the slug of the project the client keys belong to. @param key_id [String] the ID of the key to delete.

# File lib/sentry-api/client/projects.rb, line 123
def delete_client_key(project_slug, key_id)
  delete("/projects/#{@default_org_slug}/#{project_slug}/keys/#{key_id}/")
end
delete_project(project_slug) click to toggle source

Delete a Project.

@example

SentryApi.delete_project('project-slug')

@param project_slug [String] the slug of the project to delete.

# File lib/sentry-api/client/projects.rb, line 47
def delete_project(project_slug)
  delete("/projects/#{@default_org_slug}/#{project_slug}/")
end
project(project_slug) click to toggle source

Retrieve a Project

@example

SentryApi.project('project-slug')

@param project_slug [String] the slug of the project to retrieve. @return [SentryApi::ObjectifiedHash]

# File lib/sentry-api/client/projects.rb, line 21
def project(project_slug)
  get("/projects/#{@default_org_slug}/#{project_slug}/")
end
project_dsym_files(project_slug) click to toggle source

List a Project’s DSym Files.

@example

SentryApi.project_dsym_files('project-slug')

@param project_slug [String] the slug of the project to list the dsym files of. @return [Array<SentryApi::ObjectifiedHash>]

# File lib/sentry-api/client/projects.rb, line 88
def project_dsym_files(project_slug)
  get("/projects/#{@default_org_slug}/#{project_slug}/files/dsyms/")
end
project_event(project_slug, event_id) click to toggle source

Return a list of issues (groups) bound to a project. All parameters are supplied as query string parameters.

@example

SentryApi.project_event('project-slug', 'event-id')

@param project_slug [String] the slug of the project the client keys belong to. @param event_id [String] the hexadecimal ID of the event to retrieve (as reported by the raven client) @return [SentryApi::ObjectifiedHash]

# File lib/sentry-api/client/projects.rb, line 160
def project_event(project_slug, event_id)
  get("/projects/#{@default_org_slug}/#{project_slug}/events/#{event_id}/")
end
project_events(project_slug) click to toggle source

Return a list of sampled events bound to a project.

@example

SentryApi.project_events('project-slug')

@param project_slug [String] the slug of the project the client keys belong to. @return [Array<SentryApi::ObjectifiedHash>]

# File lib/sentry-api/client/projects.rb, line 148
def project_events(project_slug)
  get("/projects/#{@default_org_slug}/#{project_slug}/events/")
end
project_issues(project_slug, options={}) click to toggle source

List a Project’s Issues

@example

SentryApi.project_issues('project-slug', {'query': 'is:unresolved Build-version:6.5.0'})

@param project_slug [String] the slug of the project the client keys belong to. @param [Hash] options A customizable set of options. @option options [String] :statsPeriod an optional stat period (can be one of “24h”, “14d”, and “”). @option options [String] :query an optional Sentry structured search query. If not provided an implied “is:resolved” is assumed.) @return [Array<SentryApi::ObjectifiedHash>]

# File lib/sentry-api/client/projects.rb, line 174
def project_issues(project_slug, options={})
  get("/projects/#{@default_org_slug}/#{project_slug}/issues/", query: options)
end
project_stats(project_slug, options={}) click to toggle source

Retrieve Event Counts for an Project

@example

SentryApi.project_stats('slug')
SentryApi.project_stats('slug', {stat:'received', since:'1472158800'})

@param project_slug [String] the slug of the project. @param [Hash] options A customizable set of options. @option options [String] :stat the name of the stat to query (“received”, “rejected”, “blacklisted”) @option options [Timestamp] :since a timestamp to set the start of the query in seconds since UNIX epoch. @option options [Timestamp] :until a timestamp to set the end of the query in seconds since UNIX epoch. @option options [String] :resolution an explicit resolution to search for (eg: 10s). This should not be used unless you are familiar with Sentry’s internals as it’s restricted to pre-defined values. @return [Array<Array>]

# File lib/sentry-api/client/projects.rb, line 64
def project_stats(project_slug, options={})
  get("/projects/#{@default_org_slug}/#{project_slug}/stats/", query: options)
end
projects() click to toggle source

List your Projects

@example

SentryApi.projects

@return [Array<SentryApi::ObjectifiedHash>]

# File lib/sentry-api/client/projects.rb, line 10
def projects
  get("/projects/")
end
update_client_key(project_slug, key_id, options={}) click to toggle source

Update a Client Key

@example

SentryApi.update_client_key('project-slug','87c990582e07446b9907b357fc27730e',{name:'new-name'})

@param project_slug [String] the slug of the project the client keys belong to. @param key_id [String] the ID of the key to update. @param [Hash] options A customizable set of options. @option options [String] :name the new name for the client key. @return [Array<SentryApi::ObjectifiedHash>]

# File lib/sentry-api/client/projects.rb, line 137
def update_client_key(project_slug, key_id, options={})
  put("/projects/#{@default_org_slug}/#{project_slug}/keys/#{key_id}/", body: options)
end
update_project(project_slug, options={}) click to toggle source

Update a Project

@example

SentryApi.update_project('project-slug', {name:'new-name', slug:'new-slug', is_bookmarked:false})

@param project_slug [String] the slug of the project to retrieve. @param [Hash] options A customizable set of options. @option options [String] :name the new name for the project. @option options [String] :slug the new slug for the project. @option options [String] :isBookmarked in case this API call is invoked with a user context this allows changing of the bookmark flag. @option options [Hash] optional options to override in the project settings. @return [SentryApi::ObjectifiedHash]

# File lib/sentry-api/client/projects.rb, line 37
def update_project(project_slug, options={})
  put("/projects/#{@default_org_slug}/#{project_slug}/", body: options)
end
upload_dsym_files(project_slug, file_path) click to toggle source

Upload a new dsym file for the given release

@example

SentryApi.upload_dsym_files('project-slug','/path/to/file')

@param project_slug [String] the slug of the project to list the dsym files of. @param file_path [String] the absolute file path of the dsym file. @param organization_slug [String] the slug of the organization. @return [Array<SentryApi::ObjectifiedHash>]

# File lib/sentry-api/client/projects.rb, line 77
def upload_dsym_files(project_slug, file_path)
  upload("/projects/#{@default_org_slug}/#{project_slug}/files/dsyms/", body: {file: File.new(file_path)})
end