@handle(methods.get_param, param_id='id', env='tid')
async def get_param(self, env: data.Environment, param_id: str, resource_id: Optional[str]=None) -> Apireturn:
    if (resource_id is None):
        params = (await data.Parameter.get_list(environment=env.id, name=param_id))
    else:
        params = (await data.Parameter.get_list(environment=env.id, name=param_id, resource_id=resource_id))
    if (len(params) == 0):
        if (resource_id is not None):
            out = (await self.agentmanager.request_parameter(env.id, resource_id))
            return out
        return 404
    param = params[0]
    now = datetime.datetime.now().astimezone()
    if ((resource_id is None) or ((param.updated + datetime.timedelta(0, self._fact_expire)) > now)):
        return (200, {'parameter': params[0]})
    LOGGER.info('Parameter %s of resource %s expired.', param_id, resource_id)
    out = (await self.agentmanager.request_parameter(env.id, resource_id))
    return out
@handle(methods.get_param, param_id='id', env='tid')
async def get_param(self, env: data.Environment, param_id: str, resource_id: Optional[str]=None) -> Apireturn:
    if (resource_id is None):
        params = (await data.Parameter.get_list(environment=env.id, name=param_id))
    else:
        params = (await data.Parameter.get_list(environment=env.id, name=param_id, resource_id=resource_id))
    if (len(params) == 0):
        if (resource_id is not None):
            out = (await self.agentmanager.request_parameter(env.id, resource_id))
            return out
        return 404
    param = params[0]
    now = datetime.datetime.now().astimezone()
    if ((resource_id is None) or ((param.updated + datetime.timedelta(0, self._fact_expire)) > now)):
        return (200, {'parameter': params[0]})
    LOGGER.info('Parameter %s of resource %s expired.', param_id, resource_id)
    out = (await self.agentmanager.request_parameter(env.id, resource_id))
    return out