View virtual device mirror
    • PDF

    View virtual device mirror

    • PDF

    Article Summary

    Summary

    View virtual device mirror.

    Request

    Request URL

    GET {CLOUD_IOT_CORE_API_URL}/devices/{deviceName}/mirror
    
    Content-Type: application/json; charset=utf-8
    x-ncp-apigw-timestamp: {Timestamp}
    x-ncp-iam-access-key: {Sub Account Access Key}
    x-ncp-apigw-signature-v2: {API Gateway Signature}
    

    Path Variables

    ItemRequirement statusTypeDescription
    deviceNameYesstringVirtual device name

    Request parameters

    Parameter nameRequirement statusTypeRestrictionsDescription
    nameNostringVirtual device mirror name (operate as default mirror when null)

    Request body

    {
        "clientToken" : "string"
    }
    
    ItemRequirement statusTypeDescriptionLimitations
    clientTokenNostringWhen clientToken is included in the request, the clientToken gets displayed in the response as is.Up to 64 bytes

    Response

    Response body

    {
        "metadata": {
            "desired" : {
                "key" : {
                    "timstamp" : "long"
                }
            },
            "reported" : {
                "key" : {
                    "timstamp" : "long"
                }
            }
        },
        "state": {
            "desired": {
                "key": "value"
            },
            "reported": {
                "key": "value"
            }
        },
        "clientToken" : "string",
        "version": "long",
        "timestamp": "long"
    }
    
    ItemTypeDescription
    metadataJSON ObjectObject that expresses the time when the key was updated in desired and reported state
    metadata.desired.{keyName}.timestamptimestampTime when the key was updated in desired state
    metadata.reported.{keyName}.timestamplongTime when the key was updated in reported state
    stateJSON ObjectState of the virtual device mirror
    state.desiredJSONObjectState properties and values requested as desired to the virtual device mirror
    state.reportedJSONObjectState properties and values reported as reported to the virtual device mirror
    clientTokenstringclientToken of the request body
    versionlongVersion of the virtual device mirror
    timestamplongTime when the virtual device search response was created

    Example

    Request body

    {
        "clientToken": "ABVS111"
    }
    

    Response body

    {
        "metadata": {
            "desired": {
                "temperature": {
                    "timestamp": 1631097617
                },
                "isOn": {
                    "timestamp": 1631097617
                },
                "id": {
                    "timestamp": 1631097617
                }
            }
        },
        "clientToken": "ABVS111",
        "state": {
            "desired": {
                "temperature": 33,
                "isOn": true,
                "id": "abc1"
            },
            "reported": {
                "temperature": 35,
                "isOn": false,
                "id": "abc1"
            }
        },
        "version": 5,
        "timestamp": 1631097617
    }
    

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.