+def get_asset(asset_type, uuid):
+ resource = "/sdc/v1/catalog/{assetType}/{uuid}/metadata".format(assetType=asset_type, uuid=uuid)
+ ret = call_sdc(resource, "GET")
+ if ret[0] != 0:
+ logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
+ raise GenericparserException("Failed to get asset(%s, %s) from sdc." % (asset_type, uuid))
+ asset = json.JSONDecoder().decode(ret[1])
+ if asset.get("distributionStatus", None) != DISTRIBUTED:
+ raise GenericparserException("The asset (%s,%s) is not distributed from sdc." % (asset_type, uuid))
+ else:
+ return asset
+
+