Method: Morpheus::Cli::LibraryHelper#find_container_type_by_id

Defined in:
lib/morpheus/cli/mixins/library_helper.rb

#find_container_type_by_id(layout_id, id) ⇒ Object



137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/morpheus/cli/mixins/library_helper.rb', line 137

def find_container_type_by_id(layout_id, id)
  begin
    json_response = @library_container_types_interface.get(layout_id, id.to_i)
    return json_response['containerType']
  rescue RestClient::Exception => e
    if e.response && e.response.code == 404
      print_red_alert "Instance Type not found by id #{id}"
    else
      raise e
    end
  end
end