Get a history element

        :param resource_id: ...
426493
def get(self, resource_id):
        
        response = self.requester.get(
            '/{endpoint}/{entity}/{id}',
            endpoint=self.endpoint, entity=self.entity, id=resource_id,
            paginate=False
        )
        return response.json()
1041797
public function history($id)
    {
        $page = $this->repository->find($id);

        return view('cms::modules.pages.history')
            ->with('page', $page);
    }
577496
public function history($id)
    {
        $event = $this->repository->find($id);

        return view('cms::modules.events.history')
            ->with('event', $event);
    }
74464
def get_resource(self, resource_id):
        
        # resource_id could be a path such as '/asset/123' so quote
        uri = self._get_resource_uri(guid=resource_id)
        return self.service._get(uri)
1166934
def namedb_get_history_rows( cur, history_id, offset=None, count=None, reverse=False ):
    
    ret = []
    if not reverse:
        select_query = "SELECT * FROM history WHERE history_id = ? ORDER BY block_id ASC, vtxindex ASC"
    else:
        select_query = "SELECT * FROM history WHERE history_id = ? ORDER BY block_id DESC, vtxindex DESC"

    args = (history_id,)

    if count is not None:
        select_query += " LIMIT ?"
        args += (count,)

        if offset is not None:
            select_query += " OFFSET ?"
            args += (offset,)

    select_query += ";"

    history_rows = namedb_query_execute( cur, select_query, args)
    for r in history_rows:
        rd = dict(r)
        ret.append(rd)

    return ret
36472
def get_resource_by_id(resource_id, api_version, extract_value=None):
    '''
    
    '''
    ret = {}

    try:
        resconn = get_conn(client_type='resource')
        resource_query = resconn.resources.get_by_id(
            resource_id=resource_id,
            api_version=api_version
        )
        resource_dict = resource_query.as_dict()
        if extract_value is not None:
            ret = resource_dict[extract_value]
        else:
            ret = resource_dict
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('resource', exc.message)
        ret = {'Error': exc.message}

    return ret
1161416
public Response fetchHistoryAsOf(@PathParam("id") URI_ID id,
                                     @PathParam("asof") final Timestamp asOf) throws Exception {
        final MODEL_ID mId = tryConvertId(id);
        matchedFetchHistoryAsOf(mId, asOf);
        final Query<MODEL> query = server.find(modelType);

        defaultFindOrderBy(query);

        Object entity = executeTx(t -> {
            configDefaultQuery(query);
            configFetchHistoryAsOfQuery(query, mId, asOf);
            applyUriQuery(query, false);
            MODEL model = query.asOf(asOf).setId(mId).findOne();
            return processFetchedHistoryAsOfModel(mId, model, asOf);
        });

        if (isEmptyEntity(entity)) {
            return Response.noContent().build();
        }
        return Response.ok(entity).build();
    }
1207706
def resource(resource_id):
    """"""
    resource_obj = app.db.resource(resource_id)

    if 'raw' in request.args:
        return send_from_directory(os.path.dirname(resource_obj.path),
                                   os.path.basename(resource_obj.path))

    return render_template('resource.html', resource=resource_obj)
663396
def get_resource_ids(self):
        
        resids = []
        if self.dutinformations:
            for info in self.dutinformations:
                resids.append(info.resource_id)
            return resids
        return "unknown"
297048
def _resource(self, resource_id):
        
        resource = self.__model__.query.get(resource_id)
        if not resource:
            raise NotFoundException()
        return resource
1189236
def history_ids(amount, before_id = nil, after_id = nil, around_id = nil)
      logs = API::Channel.messages(@bot.token, @id, amount, before_id, after_id, around_id)
      JSON.parse(logs).map { |message| message['id'].to_i }
    end
677365
def _get_next_resource(self, resource, next_resource_name, selectors):
        
        # don't fetch twice
        if 'id_perms' not in resource:
            resource.fetch()

        res = None
        for res_list in (getattr(resource.refs, next_resource_name),
                         getattr(resource.back_refs, next_resource_name),
                         getattr(resource.children, next_resource_name)):
            res = self._select_next_resource(res_list, selectors)
            if res is not None:
                break

        if res is None:
            raise CommandError("Resource '%s' is not linked to resource type '%s'" %
                               (self.current_path(resource), next_resource_name))

        return (res.type, res)
960135
def _get_history_id(self, connection, agent_id, instance_id):
        '''
        
        '''
        cache_key = (agent_id, instance_id, )
        if cache_key in self._history_id_cache:
            history_id = self._history_id_cache[cache_key]
            return history_id
        else:
            command = text_helper.format_block("""
            SELECT id FROM histories WHERE agent_id = ? AND instance_id = ?
            """)
            cursor = connection.cursor()
            cursor.execute(command, (agent_id, instance_id, ))
            res = cursor.fetchall()
            if res:
                history_id = res[0][0]
                self._history_id_cache[cache_key] = history_id
                return history_id
            else:
                command = 'INSERT INTO histories VALUES (NULL, ?, ?)'
                cursor.execute(command, (agent_id, instance_id, ))
                history_id = cursor.lastrowid
                self._history_id_cache[cache_key] = history_id
                return history_id
1092710
public static String getHistoryResourceURI(String uri, ServletRequest req) {

        String histUri = uri;
        if (CmsHistoryResourceHandler.isHistoryRequest(req)) {
            String version = req.getParameter(CmsHistoryResourceHandler.PARAM_VERSION);
            histUri = CmsRequestUtil.appendParameter(uri, CmsHistoryResourceHandler.PARAM_VERSION, version);
        }
        return histUri;
    }
348137
def history(self):
        
        history = self.history_class
        if history:
            return self.session.query(history).filter(history.id == self.id)
        else:
            return None
924113
def get_history(self):
        """"""
        if hasattr(self, '_history'):
            return self._history
        try:
            self._history = APICallDayHistory.objects.get(
                user=self.user, creation_date=now().date())
        except APICallDayHistory.DoesNotExist:
            self._history = APICallDayHistory(user=self.user)
            self._history.amount_api_calls = 0
        return self._history
325659
public History getHistoryForID(int id) {
        History history = null;
        PreparedStatement query = null;
        ResultSet results = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            query = sqlConnection.prepareStatement("SELECT * FROM " + Constants.DB_TABLE_HISTORY +
                                                       " WHERE " + Constants.GENERIC_ID + "=?");
            query.setInt(1, id);

            logger.info("Query: {}", query.toString());
            results = query.executeQuery();
            if (results.next()) {
                history = historyFromSQLResult(results, true, ScriptService.getInstance().getScripts(Constants.SCRIPT_TYPE_HISTORY));
            }
            query.close();
        } catch (Exception e) {
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
            } catch (Exception e) {
            }
            try {
                if (query != null) {
                    query.close();
                }
            } catch (Exception e) {
            }
        }
        return history;
    }