Module: Cyclid::Client::Stage
- Included in:
- Tilapia
- Defined in:
- lib/cyclid/client/stage.rb
Overview
Stage related methods
Instance Method Summary collapse
-
#stage_create(organization, stage) ⇒ Hash
Create a stage.
-
#stage_get(organization, name) ⇒ Hash
Get details of a stage.
-
#stage_list(organization) ⇒ Array
Retrieve the list of stages from a server.
-
#stage_modify(organization, stage) ⇒ Hash
Modify a stage.
Instance Method Details
#stage_create(organization, stage) ⇒ Hash
Create a stage
58 59 60 61 62 63 64 |
# File 'lib/cyclid/client/stage.rb', line 58 def stage_create(organization, stage) uri = server_uri("/organizations/#{organization}/stages") res_data = api_json_post(uri, stage) @logger.debug res_data return res_data end |
#stage_get(organization, name) ⇒ Hash
Get details of a stage
42 43 44 45 46 47 48 |
# File 'lib/cyclid/client/stage.rb', line 42 def stage_get(organization, name) uri = server_uri("/organizations/#{organization}/stages/#{name}") res_data = api_get(uri) @logger.debug res_data return res_data end |
#stage_list(organization) ⇒ Array
Retrieve the list of stages from a server
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cyclid/client/stage.rb', line 25 def stage_list(organization) uri = server_uri("/organizations/#{organization}/stages") res_data = api_get(uri) @logger.debug res_data stages = [] res_data.each do |item| stages << { name: item['name'], version: item['version'] } end return stages end |
#stage_modify(organization, stage) ⇒ Hash
Note:
Stages are immutable; this actually creates a new version of an existing stage.
Modify a stage.
72 73 74 75 76 77 78 |
# File 'lib/cyclid/client/stage.rb', line 72 def stage_modify(organization, stage) uri = server_uri("/organizations/#{organization}/stages") res_data = api_json_post(uri, stage) @logger.debug res_data return res_data end |