class CachetComponents

Inherits CachetClient and handles all Components API Calls

Public Instance Methods

create(options) click to toggle source

Create Component.

@option options [string] :name Required Component name @option options [int] :status Required Numeric status of the component; 1-4 @option options [string] :description Description of the component @option options [string] :link A hyperlink to the component @option options [int] :order Numeric order of the component @option options [int] :group_id Numeric group id component is within @option options [boolean] :enabled True/False to enable/disable component @return object

# File lib/cachet.rb, line 131
def create(options)
  request method:  :post,
          url:     @base_url + 'components',
          payload: options
end
delete(options) click to toggle source

Delete Component.

@option options [string] :id Required Numeric component id @return object

# File lib/cachet.rb, line 161
def delete(options)
  request method:  :delete,
          url:     @base_url + 'components/' + options['id'].to_s
end
groups_create(options) click to toggle source

Create Component Group.

@option options [string] :name Required Component group name @option options [int] :order Numeric order of the component group @option options [int] :collapsed Whether to collapse the group by default @return object

# File lib/cachet.rb, line 195
def groups_create(options)
  request method:  :post,
          url:     @base_url + 'components/groups',
          payload: options
end
groups_delete(options) click to toggle source

Delete Component Group.

@option options [string] :id Required Numeric component group id @return object

# File lib/cachet.rb, line 222
def groups_delete(options)
  request method:  :delete,
          url:     @base_url + 'components/groups/' + options['id'].to_s
end
groups_list() click to toggle source

List all Component Groups.

@return object

# File lib/cachet.rb, line 171
def groups_list
  request method:  :get,
          url:     @base_url + 'components/groups'
end
groups_list_id(options) click to toggle source

List Component Group by ID.

@option options [string] :id Required Numeric component group id @return object

# File lib/cachet.rb, line 182
def groups_list_id(options)
  request method:  :get,
          url:     @base_url + 'components/groups/' + options['id'].to_s
end
groups_update(options) click to toggle source

Update Component Group.

@option options [string] :id Required Numeric component group id @option options [string] :name Component group name @option options [int] :order Numeric order of the component group @option options [boolean] :collapsed Whether to collapse the group by default @return object

# File lib/cachet.rb, line 210
def groups_update(options)
  request method:  :put,
          url:     @base_url + 'components/groups/' + options['id'].to_s,
          payload: options
end
list(options = nil) click to toggle source

List all Components.

@return object

# File lib/cachet.rb, line 103
def list(options = nil)
  request method:  :get,
          url:     @base_url + 'components',
          headers: {params: options}
end
list_id(options) click to toggle source

List Component by ID. @option options [string] :id Numeric component id @return object

# File lib/cachet.rb, line 114
def list_id(options)
  request method:  :get,
          url:     @base_url + 'components/' + options['id'].to_s
end
update(options) click to toggle source

Update Component.

@option options [string] :id Required Numeric component id @option options [int] :status Required Numeric status of the component; 1-4 @option options [string] :name Required Component name @option options [string] :link A hyperlink to the component @option options [int] :order Numeric order of the component @option options [int] :group_id Numeric group id component is within @option options [boolean] :enabled True/False to enable/disable component @return object

# File lib/cachet.rb, line 149
def update(options)
  request method:  :put,
          url:     @base_url + 'components/' + options['id'].to_s,
          payload: options
end