Module: SentryApi::Client::Projects

Included in:
SentryApi::Client
Defined in:
lib/sentry-api/client/projects.rb

Instance Method Summary collapse

Instance Method Details

#client_keys(project_slug, organization_slug = "") ⇒ Array<SentryApi::ObjectifiedHash>

List a Project’s Client Keys.

Examples:

SentryApi.client_keys('project-slug')


105
106
107
108
# File 'lib/sentry-api/client/projects.rb', line 105

def client_keys(project_slug, organization_slug="")
  organization_slug = @default_org_slug if organization_slug == ""
  get("/projects/#{organization_slug}/#{project_slug}/keys/")
end

#create_client_key(project_slug, options = {}, organization_slug = @default_org_slug) ⇒ SentryApi::ObjectifiedHash

Create a new Client Key.

Examples:

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

Options Hash (options):

  • :name (String)

    the name for the new key.



120
121
122
# File 'lib/sentry-api/client/projects.rb', line 120

def create_client_key(project_slug, options={}, organization_slug=@default_org_slug)
  post("/projects/#{organization_slug}/#{project_slug}/keys/", body: options)
end

#delete_client_key(project_slug, key_id, organization_slug = @default_org_slug) ⇒ Object

Delete a Client Key.

Examples:

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


132
133
134
# File 'lib/sentry-api/client/projects.rb', line 132

def delete_client_key(project_slug, key_id, organization_slug=@default_org_slug)
  delete("/projects/#{organization_slug}/#{project_slug}/keys/#{key_id}/")
end

#delete_project(project_slug, organization_slug = @default_org_slug) ⇒ Object

Delete a Project.

Examples:

SentryApi.delete_project('project-slug')


50
51
52
# File 'lib/sentry-api/client/projects.rb', line 50

def delete_project(project_slug, organization_slug=@default_org_slug)
  delete("/projects/#{organization_slug}/#{project_slug}/")
end

#project(project_slug, organization_slug = @default_org_slug) ⇒ SentryApi::ObjectifiedHash

Retrieve a Project

Examples:

SentryApi.project('project-slug')


22
23
24
# File 'lib/sentry-api/client/projects.rb', line 22

def project(project_slug, organization_slug=@default_org_slug)
  get("/projects/#{organization_slug}/#{project_slug}/")
end

#project_dsym_files(project_slug, organization_slug = @default_org_slug) ⇒ Array<SentryApi::ObjectifiedHash>

List a Project’s DSym Files.

Examples:

SentryApi.project_dsym_files('project-slug')


93
94
95
# File 'lib/sentry-api/client/projects.rb', line 93

def project_dsym_files(project_slug, organization_slug=@default_org_slug)
  get("/projects/#{organization_slug}/#{project_slug}/files/dsyms/")
end

#project_event(project_slug, event_id, organization_slug = @default_org_slug) ⇒ SentryApi::ObjectifiedHash

Retrieve an Event for a Project

Examples:

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


172
173
174
# File 'lib/sentry-api/client/projects.rb', line 172

def project_event(project_slug, event_id, organization_slug=@default_org_slug)
  get("/projects/#{organization_slug}/#{project_slug}/events/#{event_id}/")
end

#project_events(project_slug, organization_slug = @default_org_slug) ⇒ Array<SentryApi::ObjectifiedHash>

Return a list of sampled events bound to a project.

Examples:

SentryApi.project_events('project-slug')


159
160
161
# File 'lib/sentry-api/client/projects.rb', line 159

def project_events(project_slug, organization_slug=@default_org_slug)
  get("/projects/#{organization_slug}/#{project_slug}/events/")
end

#project_issues(project_slug, organization_slug = @default_org_slug) ⇒ Array<SentryApi::ObjectifiedHash>

Return a list of aggregates bound to a project

Examples:

SentryApi.project_issues('project-slug')


182
183
184
# File 'lib/sentry-api/client/projects.rb', line 182

def project_issues(project_slug, organization_slug=@default_org_slug)
  get("/projects/#{organization_slug}/#{project_slug}/issues/")
end

#project_stats(project_slug, options = {}, organization_slug = @default_org_slug) ⇒ Array<Array>

Retrieve Event Counts for an Project

Examples:

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

Options Hash (options):

  • :stat (String)

    the name of the stat to query (“received”, “rejected”, “blacklisted”)

  • :since (Timestamp)

    a timestamp to set the start of the query in seconds since UNIX epoch.

  • :until (Timestamp)

    a timestamp to set the end of the query in seconds since UNIX epoch.

  • :resolution (String)

    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.



68
69
70
# File 'lib/sentry-api/client/projects.rb', line 68

def project_stats(project_slug, options={}, organization_slug=@default_org_slug)
  get("/projects/#{organization_slug}/#{project_slug}/stats/", query: options)
end

#projectsArray<SentryApi::ObjectifiedHash>

List your Projects

Examples:

SentryApi.projects


10
11
12
# File 'lib/sentry-api/client/projects.rb', line 10

def projects
  get("/projects/")
end

#update_client_key(project_slug, key_id, options = {}, organization_slug = @default_org_slug) ⇒ Array<SentryApi::ObjectifiedHash>

Update a Client Key

Examples:

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

Options Hash (options):

  • :name (String)

    the new name for the client key.



147
148
149
# File 'lib/sentry-api/client/projects.rb', line 147

def update_client_key(project_slug, key_id, options={}, organization_slug=@default_org_slug)
  put("/projects/#{organization_slug}/#{project_slug}/keys/#{key_id}/", body: options)
end

#update_project(project_slug, options = {}, organization_slug = @default_org_slug) ⇒ SentryApi::ObjectifiedHash

Update a Project

Examples:

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

Options Hash (options):

  • :name (String)

    the new name for the project.

  • :slug (String)

    the new slug for the project.

  • :isBookmarked (String)

    in case this API call is invoked with a user context this allows changing of the bookmark flag.

  • optional (Hash)

    options to override in the project settings.



39
40
41
# File 'lib/sentry-api/client/projects.rb', line 39

def update_project(project_slug, options={}, organization_slug=@default_org_slug)
  put("/projects/#{organization_slug}/#{project_slug}/", body: options)
end

#upload_dsym_files(project_slug, file_path, organization_slug = @default_org_slug) ⇒ Array<SentryApi::ObjectifiedHash>

Upload a new dsym file for the given release

Examples:

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


81
82
83
# File 'lib/sentry-api/client/projects.rb', line 81

def upload_dsym_files(project_slug, file_path, organization_slug=@default_org_slug)
  upload("/projects/#{organization_slug}/#{project_slug}/files/dsyms/", body: {file: File.new(file_path)})
end