Server Data
    • PDF

    Server Data

    • PDF

    Article summary

    Available in VPC

    View the list of top-level metadata categories associated with a server instance, and view the query value for each category.

    Note

    See Using Metadata v2 for more information on how Metadata v2 is called.

    Request

    The following describes the request format for the endpoint. The request format is as follows:

    Call pathDescription
    /{version}/meta-data/View the list of top-level metadata categories associated with a server instance provided in the applicable version
    /{version}/meta-data/{field-1}/{field-2}/..If any of the provided metadata has sub items, use them as sub paths to query
    • List of indices are provided as a subsection to the list type data, and you can use the index value as a sub path

    Examples

    See below for an example.

    Metadata v1

    The following is an example of Metadata v1.

    # View the top-level metadata category
    [root@test-server ~]# curl http://169.254.169.254/latest/meta-data/
    serverInstanceNo
    serverName
    serverDescription
    cpuCount
    memorySize
    platformType
    loginKeyName
    publicIpInstanceNo
    publicIp
    serverInstanceStatus
    serverInstanceOperation
    serverInstanceStatusName
    createDate
    uptime
    serverImageProductCode
    serverProductCode
    isProtectServerTermination
    zoneCode
    regionCode
    vpcNo
    subnetNo
    networkInterfaceNoList
    initScriptNo
    serverInstanceType
    baseBlockStorageDiskType
    baseBlockStorageDiskDetailType
    placementGroupNo
    placementGroupName
    iam
    
    # Server instance name query example
    [root@test-server ~]# curl http://169.254.169.254/latest/meta-data/serverName/
    test-server
    
    # Server instance status query example
    [root@test-server ~]# curl http://169.254.169.254/latest/meta-data/serverInstanceStatus/
    code
    codeName
    
    # View code, a sub item of server instance status (serverInstanceStatus)
    [root@test-server ~]# curl http://169.254.169.254/latest/meta-data/serverInstanceStatus/code
    RUN
    
    # View network interface items assigned to a server instance
    [root@test-server ~]# curl http://169.254.169.254/latest/meta-data/networkInterfaceNoList/
    0
    1
    
    # View network interface ID by the index number that is the result of a network interface entry query (networkInterfaceNoList)
    [root@test-server ~]# curl http://169.254.169.254/latest/meta-data/networkInterfaceNoList/0
    ***531
    [root@test-server ~]#
    

    Metadata v2

    The following is an example of Metadata v2.
    The second and subsequent requests in the example use the token generated by the first request, assuming it hasn't expired.

    # View the top-level metadata category
    [root@test-server ~]# TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-NCP-METADATA-TOKEN-TTL-SECONDS: 21600"` \
    && curl -H "X-NCP-METADATA-TOKEN: $TOKEN" http://169.254.169.254/latest/meta-data/
    serverInstanceNo
    serverName
    serverDescription
    cpuCount
    memorySize
    platformType
    loginKeyName
    publicIpInstanceNo
    publicIp
    serverInstanceStatus
    serverInstanceOperation
    serverInstanceStatusName
    createDate
    uptime
    serverImageProductCode
    serverProductCode
    isProtectServerTermination
    zoneCode
    regionCode
    vpcNo
    subnetNo
    networkInterfaceNoList
    initScriptNo
    serverInstanceType
    baseBlockStorageDiskType
    baseBlockStorageDiskDetailType
    placementGroupNo
    placementGroupName
    iam
    
    # Server instance name query example
    [root@test-server ~]# curl -H "X-NCP-METADATA-TOKEN: $TOKEN" http://169.254.169.254/latest/meta-data/serverName/
    test-server
    
    # Server instance status query example
    [root@test-server ~]# curl -H "X-NCP-METADATA-TOKEN: $TOKEN" http://169.254.169.254/latest/meta-data/serverInstanceStatus/
    code
    codeName
    
    # View code, a sub item of server instance status (serverInstanceStatus)
    [root@test-server ~]# curl -H "X-NCP-METADATA-TOKEN: $TOKEN" http://169.254.169.254/latest//meta-data/serverInstanceStatus/code
    RUN
    
    # View network interface ID by the index number that is the result of a network interface entry query (networkInterfaceNoList)
    [root@test-server ~]# curl -H "X-NCP-METADATA-TOKEN: $TOKEN" http://169.254.169.254/latest/meta-data/networkInterfaceNoList/
    0
    1
    
    # View network interface ID by the index number that is the result of a network interface entry query (networkInterfaceNoList)
    [root@test-server ~]# curl -H "X-NCP-METADATA-TOKEN: $TOKEN" http://169.254.169.254/latest/meta-data/networkInterfaceNoList/0
    ***531
    [root@test-server ~]#
    

    List of top-level metadata categories

    The following describes the list of top-level categories of instance metadata.
    If you release a metadata category in NAVER Cloud Platform, metadata for the new category may not be available on existing instances.

    Top-level categoryDescription
    serverInstanceNoServer instance number
    serverNameServer instance name
    serverDescriptionDescription of the server instance
    cpuCountNumber of CPUs for the server instance
    memorySizeMemory size of the server instance
    platformTypeOperating system code and code name of the server instance
    loginKeyNameLogin key name
    publicIpInstanceNoAssigned public IP instance number
    publicIpAssigned public IP address
    serverInstanceStatusOperation status code and code name of the server instance
    serverInstanceOperationOperation code and code name of the server instance
    serverInstanceStatusNameServer instance operation status
    createDateServer instance creation date
    uptimeServer instance update date
    serverImageProductCodeServer image product code
    serverProductCodeServer product code
    isProtectServerTerminationTermination protection status
    zoneCodeZone code
    regionCodeRegion code
    vpcNoNumber of VPC in which the server instance is created
    subnetNoSubnet number of the primary network interface being used by the server instance
    networkInterfaceNoListList of assigned network interfaces
    initScriptNoInitialization script number
    serverInstanceTypeServer specification type code and code name
    baseBlockStorageDiskTypeBlock storage disk type
    baseBlockStorageDiskDetailTypeBlock storage disk type details
    placementGroupNoPhysical placement group number
    placementGroupNamePhysical placement group number name
    iamIAM role and security credentials for the server instance

    Was this article helpful?

    What's Next
    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.