@utils.supported_filters([])
@database.run_in_session()
@user_api.check_user_permission(
    permission.PERMISSION_LIST_METADATAS
)
@utils.wrap_to_dict(RESP_METADATA_FIELDS)
def get_flavor_os_metadata(
    flavor_id, os_id,
    user=None, session=None, **kwargs
):
    flavor = adapter_holder_api.get_flavor(
        flavor_id, user=user, session=session
    )
    adapter_id = flavor['adapter_id']
    adapter = adapter_holder_api.get_adapter(
        adapter_id, user=user, session=session
    )
    os_ids = [os['id'] for os in adapter['supported_oses']]
    if os_id not in os_ids:
        raise exception.InvalidParameter(
            'os %s is not in the supported os list of adapter %s' % (
                os_id, adapter_id
            )
        )
    metadatas = {}
    metadatas['os_config'] = _get_os_metadata(
        session, os_id
    )
    metadatas['package_config'] = _get_flavor_metadata(
        session, flavor_id
    )
    return metadatas
Get metadata by flavor and os.
dataset/ETHPy150Open openstack/compass-core/compass/db/api/metadata_holder.py/get_flavor_os_metadata