コード例 #1
0
ファイル: getEntityType.cpp プロジェクト: JJ/fiware-orion
/* ****************************************************************************
*
* getEntityType -
*
* GET /v2/type/<entityType>
*
* Payload In:  None
* Payload Out: EntityTypeAttributesResponse
*/
std::string getEntityType
(
  ConnectionInfo*            ciP,
  int                        components,
  std::vector<std::string>&  compV,
  ParseData*                 parseDataP
)
{
  EntityTypeAttributesResponse  response;
  std::string                   entityTypeName = compV[2];
  std::string                   answer;

  mongoAttributesForEntityType(entityTypeName, &response, ciP->tenant, ciP->servicePathV, ciP->uriParam);

  answer = response.toJson(ciP);
  response.release();

  return answer;
}
コード例 #2
0
/* ****************************************************************************
*
* getAttributesForEntityType -
*/
std::string getAttributesForEntityType
(
  ConnectionInfo*            ciP,
  int                        components,
  std::vector<std::string>&  compV,
  ParseData*                 parseDataP
)
{
  EntityTypeAttributesResponse  response;
  std::string                   entityTypeName = compV[2];

  response.statusCode.fill(SccOk);
  mongoAttributesForEntityType(entityTypeName, &response, ciP->tenant, ciP->servicePathV, ciP->uriParam);

  std::string rendered = response.render(ciP, "");
  response.release();

  return rendered;
}