Module: BWStatusBoardAPI::Client::Boards

Includes:
Environments::Services, Helpers
Included in:
BWStatusBoardAPI::Client, Metrics
Defined in:
lib/bw_status_board_api/client/boards.rb

Overview

Boards module for boards endpoints

Instance Method Summary collapse

Methods included from Environments::Services

#create_service, #delete_service, #failing_services, #patch_service, #service, #services, #services_summary, #successful_services, #update_service

Methods included from Helpers

#filter

Instance Method Details

#board(board_id) ⇒ Hash

Get board

Parameters:

  • board_id (Integer)

    board id

Returns:

  • (Hash)

    board



35
36
37
# File 'lib/bw_status_board_api/client/boards.rb', line 35

def board(board_id)
  get "boards/#{board_id}"
end

#boards(opts = {}) ⇒ Hash

Get boards

Parameters:

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

    options hash of parameters

Options Hash (opts):

  • page (Integer)

    the page

  • pageSize (Integer)

    the page size

  • orderBy (String)

    the parameter to order by

  • orderDirection (String)

    the direction to order

  • fields (String)

    the fields to return

Returns:

  • (Hash)

    boards



20
21
22
# File 'lib/bw_status_board_api/client/boards.rb', line 20

def boards(opts = {})
  get 'boards', opts
end

#boards_summaryArray

Returns boards name list

Returns:

  • (Array)

    environments



27
28
29
# File 'lib/bw_status_board_api/client/boards.rb', line 27

def boards_summary
  filter(boards['results'], true)
end

#create_board(opts = {}) ⇒ Hash

Create board

Parameters:

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

    options hash of parameters

Options Hash (opts):

  • name (String)

    name of the board

  • environments (Array)

    environments within the board

  • enabled (Boolean)

    board enabled flag

Returns:

  • (Hash)

    board



46
47
48
# File 'lib/bw_status_board_api/client/boards.rb', line 46

def create_board(opts = {})
  post 'boards', opts
end

#delete_board(board_id) ⇒ Hash

Delete board

Parameters:

  • board_id (Integer)

    board id

Returns:

  • (Hash)

    board



78
79
80
# File 'lib/bw_status_board_api/client/boards.rb', line 78

def delete_board(board_id)
  delete "boards/#{board_id}"
end

#patch_board(board_id, opts = {}) ⇒ Hash

Patch board

Parameters:

  • board_id (Integer)

    board id

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

    options hash of parameters

Options Hash (opts):

  • name (String)

    name of the board

  • environments (Array)

    environments within the board

  • enabled (Boolean)

    board enabled flag

Returns:

  • (Hash)

    board



70
71
72
# File 'lib/bw_status_board_api/client/boards.rb', line 70

def patch_board(board_id, opts = {})
  patch "boards/#{board_id}", opts
end

#update_board(board_id, opts = {}) ⇒ Hash

Update board

Parameters:

  • board_id (Integer)

    board id

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

    options hash of parameters

Options Hash (opts):

  • name (String)

    name of the board

  • environments (Array)

    environments within the board

  • enabled (Boolean)

    board enabled flag

Returns:

  • (Hash)

    board



58
59
60
# File 'lib/bw_status_board_api/client/boards.rb', line 58

def update_board(board_id, opts = {})
  put "boards/#{board_id}", opts
end