Module: SentryApi::Client::Organizations

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

Instance Method Summary collapse

Instance Method Details

#create_team(options = {}) ⇒ SentryApi::ObjectifiedHash

Create a new team bound to an organization

Examples:

SentryApi.create_project('team-slug', {name:'team-name', slug:'team-slug'})

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :name (String)

    the name for the new team.

  • :slug (String)

    optionally a slug for the new team. If it’s not provided a slug is generated from the name.

Returns:



77
78
79
# File 'lib/sentry-api/client/organizations.rb', line 77

def create_team(options={})
  post("/organizations/#{@default_org_slug}/teams/", body: options)
end

#organizationSentryApi::ObjectifiedHash

Retrieve an Organization

Examples:

SentryApi.organization
SentryApi.organization('slug')

Returns:



33
34
35
# File 'lib/sentry-api/client/organizations.rb', line 33

def organization
  get("/organizations/#{@default_org_slug}/")
end

#organization_projectsArray<SentryApi::ObjectifiedHash>

List an Organization’s Projects

Examples:

SentryApi.organization_projects
SentryApi.organization_projects('slug')

Returns:



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

def organization_projects
  get("/organizations/#{@default_org_slug}/projects/")
end

#organization_stats(options = {}) ⇒ Array<Array>

Retrieve Event Counts for an Organization

Examples:

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

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options.

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.

Returns:

  • (Array<Array>)


64
65
66
# File 'lib/sentry-api/client/organizations.rb', line 64

def organization_stats(options={})
  get("/organizations/#{@default_org_slug}/stats/", query: options)
end

#organization_teamsArray<SentryApi::ObjectifiedHash>

Return a list of teams bound to a organization.

Examples:

SentryApi.organization_teams('team-slug')

Returns:



87
88
89
# File 'lib/sentry-api/client/organizations.rb', line 87

def organization_teams
  get("/organizations/#{@default_org_slug}/teams/")
end

#organizations(member = false) ⇒ Array<SentryApi::ObjectifiedHash>

List your Organizations.

Examples:

SentryApi.organizations

Parameters:

  • member (Boolean) (defaults to: false)

    Restrict results to organizations which you have membership

Returns:



11
12
13
# File 'lib/sentry-api/client/organizations.rb', line 11

def organizations(member=false)
  get("/organizations/", query: {member: member})
end

#update_organization(options = {}) ⇒ SentryApi::ObjectifiedHash

Update an Organization

Examples:

SentryApi.update_organization('slug')
SentryApi.update_organization('slug',{name:'new-name'})
SentryApi.update_organization('slug',{name:'new-name', slug:'new-slug'})

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :name (String)

    an optional new name for the organization.

  • :slug (String)

    an optional new slug for the organization. Needs to be available and unique.

Returns:



48
49
50
# File 'lib/sentry-api/client/organizations.rb', line 48

def update_organization(options={})
  put("/organizations/#{@default_org_slug}/", body: options)
end