app/helpers/extensions_helper.rb
#
# Given asset version returns sensuctl compatible asset definition
#
# @param version [ExtensionVersion] version record of the extension
# @param format [String] format in either 'yaml' or 'json'
#
# @return [String] asset definition
#
Given asset version returns sensuctl compatible asset definition
Given asset version returns sensuctl compatible asset definition
def to_asset_definition(version, format: "yaml")
    ctrl = @_controller
    resp = ctrl.render_to_string(template: 'api/v1/release_assets/index.json.jbuilder', assigns: {version: version})
    resp = YAML.dump(JSON.parse(resp)) if format == "yaml"
    resp
  end
def to_asset_definition ( version , format : "yaml" ) ctrl = @_controller resp = ctrl . render_to_string ( template : 'api/v1/release_assets/index.json.jbuilder' , assigns : { version : version } ) resp = YAML . dump ( JSON . parse ( resp ) ) if format == "yaml" resp end
Given asset version returns sensuctl compatible asset definition
Given asset version returns sensuctl compatible asset definition
None
String
version
version record of the extension
version record of the extension
format
format in either 'yaml' or 'json'
format in either ' yaml ' or ' json '