Skip to content

Instantly share code, notes, and snippets.

@cdelashmutt-pivotal
Last active August 29, 2015 14:20
Show Gist options
  • Save cdelashmutt-pivotal/64652b7f3c29ad7ed584 to your computer and use it in GitHub Desktop.
Save cdelashmutt-pivotal/64652b7f3c29ad7ed584 to your computer and use it in GitHub Desktop.
Extract all defaults from PCF product metadata
require 'yaml'
data_hash = YAML.load_file(ARGV[0])
data_hash["job_types"].each { |job|
job_name = job["name"]
resource_hash = {}
job["resource_definitions"].each { |resdef|
resource_hash[resdef["name"]] = resdef["default"]
}
print job_name, resource_hash
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment