Extracting make_resource_metadata method

Dividing this method into multiple helps to reuse it in
some tools scripts for generating data.

Change-Id: I45230cd43d82e946fab394c4b6a1fe6b64cd8937
Related-Bug: #1349791
Merge "Extracting make_resource_metadata method"