def save_load(jid, load, minions=None):
    '''
    Save the load to the specified jid id

    .. versionadded:: 2015.8.1
    '''
    options = _get_options()

    index = options['master_job_cache_index']
    doc_type = options['master_job_cache_doc_type']

    if options['index_date']:
        index = '{0}-{1}'.format(index,
            datetime.date.today().strftime('%Y.%m.%d'))

    _ensure_index(index)

    # addressing multiple types (bool, string, dict, ...) issue in master_job_cache index for return key (#20826)
    if not load.get('return', None) is None:
        # if load.return is not a dict, moving the result to load.return.<job_fun_escaped>.return
        if not isinstance(load['return'], dict):
            job_fun_escaped = load['fun'].replace('.', '_')
            load['return'] = {job_fun_escaped: {'return': load['return']}}
        # rename load.return to load.data in order to have the same key in all indices (master_job_cache, job)
        load['data'] = load.pop('return')

    data = {
        'jid': jid,
        'load': load,
    }

    ret = __salt__['elasticsearch.document_create'](index=index,
                                                    doc_type=doc_type,
                                                    id=jid,
                                                    body=salt.utils.json.dumps(data))
def save_load ( jid , load , minions = None ) : options = _get_options ( ) index = options [ 'master_job_cache_index' ] doc_type = options [ 'master_job_cache_doc_type' ] if options [ 'index_date' ] : index = '{0}-{1}' . format ( index , datetime . date . today ( ) . strftime ( '%Y.%m.%d' ) ) _ensure_index ( index ) if not load . get ( 'return' , None ) is None : if not isinstance ( load [ 'return' ] , dict ) : job_fun_escaped = load [ 'fun' ] . replace ( '.' , '_' ) load [ 'return' ] = { job_fun_escaped : { 'return' : load [ 'return' ] } } load [ 'data' ] = load . pop ( 'return' ) data = { 'jid' : jid , 'load' : load , } ret = __salt__ [ 'elasticsearch.document_create' ] ( index = index , doc_type = doc_type , id = jid , body = salt . utils . json . dumps ( data ) )
Save the load to the specified jid id

    .. versionadded:: 2015.8.1