투케이2K

164. (Aws/Amazon) [Aws Iot Core] Aws Iot Core Thing Group 사물 그룹 메타 데이터 수정 UpdateThingGroup API 설명 정리 본문

Aws (Amazon)

164. (Aws/Amazon) [Aws Iot Core] Aws Iot Core Thing Group 사물 그룹 메타 데이터 수정 UpdateThingGroup API 설명 정리

투케이2K 2026. 1. 5. 08:46
728x90

[개발 환경 설정]

개발 환경 : Aws / Amazon Web Services

 

[설명 정리]

 

// --------------------------------------------------------------------------------------
[개발 및 환경]
// --------------------------------------------------------------------------------------

- 인프라 : Aws / Amazon Web Services


- 기술 구분 : Aws / Aws Iot Core / Thing / Group


- 사전) Aws Iot Core 간략 설명 : 

  >> AWS IoT 는 IoT 디바이스를 다른 디바이스 및 AWS 클라우드 서비스에 연결하는 클라우드 서비스를 제공합니다.

  >> 디바이스가에 연결할 수 있는 경우 AWS IoT는 AWS 가 제공하는 클라우드 서비스에 디바이스를 AWS IoT 연결할 수 있습니다.

  >> AWS IoT Core 메시지 브로커는 MQTT 및 MQTT over WSS 프로토콜을 사용하여 메시지를 게시하고 구독하는 디바이스 및 클라이언트를 지원합니다. 
  
    - HTTPS 프로토콜을 사용하여 메시지를 게시하는 디바이스와 클라이언트도 지원합니다.

// --------------------------------------------------------------------------------------






// --------------------------------------------------------------------------------------
[설 명]
// --------------------------------------------------------------------------------------

1. UpdateThingGroup 는 AWS IoT에서 기존 Thing Group(사물 그룹)의 메타데이터를 수정하는 REST API 입니다

  >> ✅ 이미 만들어진 Thing Group 의 설명(description)이나 속성(attributes)을 변경할 때 사용


2. UpdateThingGroup 의 주요 역할 : 

  >> Thing Group의 설명(description)을 바꾸기

  >> Thing Group에 연관된 속성(attributes)을 추가/수정/병합하기

  >> ❌ 그룹 이름 자체나 부모 그룹(parent) 등 구조적인 것은 변경할 수 없음 

    - 부모 그룹 변경은 CreateThingGroup 시에만 가능


3. UpdateThingGroup API 호출 Request , Response 전문 예시 : 

    // ✅ Request 전문 예시
    PATCH /thing-groups/thingGroupName HTTP/1.1
    Content-type: application/json

    {
    "expectedVersion": number, // --------------> 선택) 현재 서버에 저장된 버전과 일치해야만 업데이트가 적용됩니다
    "thingGroupProperties": { // ---------------> 필수) Thing Group 의 속성을 포함하는 객체
        "attributePayload": { // Thing Group의 속성(attributes) 설정/병합 정보
            "attributes": { 
                "string" : "string" 
            },
            "merge": boolean // merge=true 면 기존 항목 유지 + 새 항목 추가/업데이트, false면 기존 속성 모두 덮어쓰기
        },
        "thingGroupDescription": "string" // 그룹에 대한 설명
    }
    }


    // ✅ Response 전문 예시
    HTTP/1.1 200
    Content-type: application/json

    {
    "version": number // 업데이트된 Thing Group의 버전 번호
    }


4. UpdateThingGroup 호출 오류 종류 : 

  >> ResourceNotFoundException : 지정한 그룹이 존재하지 않을 때

  >> VersionConflictException : expectedVersion이 현재 버전과 다름

  >> InvalidRequestException : 요청 형식/값 오류

  >> ThrottlingException : API 호출 한도 초과

  >> InternalFailureException : 서버 내부 오류


5. CLI 명령어를 통한 UpdateThingGroup 호출 방법 : 

    aws iot update-thing-group \
    --thing-group-name "MyGroup" \
    --thing-group-properties "thingGroupDescription='desc',attributePayload={attributes={key1=value1}}"
    ``` :contentReference[oaicite:11]{index=11}

// --------------------------------------------------------------------------------------






// --------------------------------------------------------------------------------------
[참고 사이트]
// --------------------------------------------------------------------------------------

[AWS 사이트 : UpdateThingGroup 설명]

https://docs.aws.amazon.com/iot/latest/apireference/API_UpdateThingGroup.html


[Web/JavaScript] paho-mqtt 라이브러리 사용해 AWS IOT Core 플릿 프로비저닝 Thing 사물 등록 수행

https://kkh0977.tistory.com/8491

https://blog.naver.com/kkh0977/224109136460?trackingCode=blog_bloghome_searchlist


[AWS] [Lambda] 런타임 Python 3.13 - boto3 모듈 사용해 AWS 특정 사물 Thing Shadow Json 페이로드 확인

https://blog.naver.com/kkh0977/223968287258?trackingCode=blog_bloghome_searchlist


[간단 소스] Aws Iot Core 사물 그룹 리스트 목록 확인 - Aws Thing Group List

https://blog.naver.com/kkh0977/223834350431?trackingCode=blog_bloghome_searchlist


[Aws Iot Core] Aws Iot Core Thing 사물 에 대한 정보 업데이트 UpdateThing API 설명 정리

https://blog.naver.com/kkh0977/224121363964?trackingCode=blog_bloghome_searchlist

// --------------------------------------------------------------------------------------
 
728x90
반응형
Comments