From 5b5d49ade693a7cbd0f9bcaf65776208432abe21 Mon Sep 17 00:00:00 2001 From: Oleksandr Grytsov Date: Wed, 25 Mar 2026 14:44:34 +0200 Subject: [PATCH] Revert "common: cloudprotocol: rename "item" to "identity" desired status" This reverts commit a2b2b659053a8695205d9265e462f10f772d5874. --- src/common/cloudprotocol/desiredstatus.cpp | 20 +++++++++---------- .../cloudprotocol/tests/desiredstatus.cpp | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/common/cloudprotocol/desiredstatus.cpp b/src/common/cloudprotocol/desiredstatus.cpp index 43e0dd51..e3d47633 100644 --- a/src/common/cloudprotocol/desiredstatus.cpp +++ b/src/common/cloudprotocol/desiredstatus.cpp @@ -45,15 +45,15 @@ void UpdateItemInfoFromJSON(const common::utils::CaseInsensitiveObjectWrapper& j { AosIdentity identity; - auto err = ParseAosIdentity(json.GetObject("identity"), identity); + auto err = ParseAosIdentity(json.GetObject("item"), identity); AOS_ERROR_CHECK_AND_THROW(err, "can't parse item"); if (!identity.mID.has_value()) { - AOS_ERROR_THROW(ErrorEnum::eNotFound, "item ID is missing"); + AOS_ERROR_THROW(ErrorEnum::eNotFound, "item id is missing"); } err = updateItemInfo.mItemID.Assign(identity.mID->c_str()); - AOS_ERROR_CHECK_AND_THROW(err, "can't parse item ID"); + AOS_ERROR_CHECK_AND_THROW(err, "can't parse itemID"); if (!identity.mType.has_value()) { AOS_ERROR_THROW(ErrorEnum::eNotFound, "item type is missing"); @@ -72,11 +72,11 @@ void UpdateItemInfoFromJSON(const common::utils::CaseInsensitiveObjectWrapper& j AOS_ERROR_CHECK_AND_THROW(err, "can't parse owner"); if (!identity.mID.has_value()) { - AOS_ERROR_THROW(ErrorEnum::eNotFound, "owner ID is missing"); + AOS_ERROR_THROW(ErrorEnum::eNotFound, "owner id is missing"); } err = updateItemInfo.mOwnerID.Assign(identity.mID->c_str()); - AOS_ERROR_CHECK_AND_THROW(err, "can't parse owner ID"); + AOS_ERROR_CHECK_AND_THROW(err, "can't parse ownerID"); } err = updateItemInfo.mIndexDigest.Assign(json.GetValue("indexDigest").c_str()); @@ -92,11 +92,11 @@ void DesiredInstanceInfoFromJSON(const common::utils::CaseInsensitiveObjectWrapp AOS_ERROR_CHECK_AND_THROW(err, "can't parse item"); if (!identity.mID.has_value()) { - AOS_ERROR_THROW(ErrorEnum::eNotFound, "item ID is missing"); + AOS_ERROR_THROW(ErrorEnum::eNotFound, "item id is missing"); } err = instance.mItemID.Assign(identity.mID->c_str()); - AOS_ERROR_CHECK_AND_THROW(err, "can't parse item ID"); + AOS_ERROR_CHECK_AND_THROW(err, "can't parse itemID"); } { @@ -106,11 +106,11 @@ void DesiredInstanceInfoFromJSON(const common::utils::CaseInsensitiveObjectWrapp AOS_ERROR_CHECK_AND_THROW(err, "can't parse subject"); if (!identity.mID.has_value()) { - AOS_ERROR_THROW(ErrorEnum::eNotFound, "subject ID is missing"); + AOS_ERROR_THROW(ErrorEnum::eNotFound, "subject id is missing"); } err = instance.mSubjectID.Assign(identity.mID->c_str()); - AOS_ERROR_CHECK_AND_THROW(err, "can't parse subject ID"); + AOS_ERROR_CHECK_AND_THROW(err, "can't parse subjectID"); } instance.mPriority = json.GetValue("priority"); @@ -191,7 +191,7 @@ Poco::JSON::Object::Ptr UpdateItemInfoToJSON(const UpdateItemInfo& updateItemInf identity.mID = updateItemInfo.mItemID.CStr(); identity.mType = updateItemInfo.mType; - object->set("identity", CreateAosIdentity(identity)); + object->set("item", CreateAosIdentity(identity)); } object->set("version", updateItemInfo.mVersion.CStr()); diff --git a/src/common/cloudprotocol/tests/desiredstatus.cpp b/src/common/cloudprotocol/tests/desiredstatus.cpp index df3a1952..8815e6da 100644 --- a/src/common/cloudprotocol/tests/desiredstatus.cpp +++ b/src/common/cloudprotocol/tests/desiredstatus.cpp @@ -231,7 +231,7 @@ TEST_F(CloudProtocolDesiredStatus, Items) "messageType": "desiredStatus", "items": [ { - "identity": { + "item": { "id": "item1", "type": "service" }, @@ -242,7 +242,7 @@ TEST_F(CloudProtocolDesiredStatus, Items) "indexDigest": "sha256:36f028580bb02cc8272a9a020f4200e346e276ae664e45ee80745574e2f5ab80" }, { - "identity": { + "item": { "id": "item2", "type": "component" },