MENU
      Peer Pod使用量の照会

        Peer Pod使用量の照会


        記事の要約

        VPC環境で利用できます。

        ブロックチェーンネットワーク内 Peer Podのリソース(CPU、Memory、Storage)使用量を照会します。

        リクエスト

        リクエスト形式を説明します。リクエスト形式は次の通りです。

        メソッドURI
        GET/networks/{networkId}/peers/{peerId}/usage

        リクエストヘッダ

        Blockchain Service APIで共通して使用されるヘッダの詳細は、Blockchain Serviceの共通ヘッダをご参照ください。

        リクエストパスパラメータ

        パラメータの説明は次の通りです。

        フィールドタイプ必須の有無説明
        networkIdLongRequiredネットワーク ID
        peerIdLongRequiredPeer ID

        リクエストクエリパラメータ

        パラメータの説明は次の通りです。

        フィールドタイプ必須の有無説明
        startTimeIntegerRequired使用量照会開始時刻(Unix Timestamp)
        • <例> 2024年07月30日09時00分00秒の場合、startTime=1722297600000
        endTimeIntegerRequired使用量照会終了時刻(Unix Timestamp)
        • <例> 2024年07月30日15時00分00秒の場合、endTime=1722319200000
        isCouchDbBooleanOptionalCouchDBかどうか
        • true | false
          • true: CoucbDBの場合
          • false: CouchDBではない場合(LevelDB)

        リクエスト例

        リクエストのサンプルコードは次の通りです。

        curl --location --request GET 'https://blockchainservice.apigw.ntruss.com/api/v1/networks/{networkId}/peers/{peerId}/usage?startTime=1722297600000&endTime=1722319200000&isCouchDb=false' \
        --header 'x-ncp-apigw-timestamp: {Timestamp}' \
        --header 'x-ncp-iam-access-key: {Access Key}' \
        --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
        --header 'Content-Type: application/json'
        Shell

        レスポンス

        レスポンス形式を説明します。

        レスポンスボディ

        レスポンスボディの説明は次の通りです。

        フィールドタイプ必須の有無説明
        networkIdLong-ネットワーク ID
        nodeIdString-Peerノード ID
        nodeTypeString-Peerノードタイプ
        containerNoLong-Ncloud Kubernetes Serviceコンテナ番号
        • CAは該当なし
        cpuUsageMap-イベント発生時間ごとの CPU使用量(単位: vCPU)
        • <例> "cpuUsage": {"1722306600000": 0.0077477186}
        memUsageMap-イベント発生時間ごとの Memory使用量(単位: MiB)
        • <例> "memUsage": {"1722306600000": 47}
        diskUsageMap-イベント発生時間ごとの Storage使用量(単位: %)
        • <例> "diskUsage": {"1722306600000": 0}

        レスポンスステータスコード

        Blockchain Service APIで共通して使用されるレスポンスステータスコードの詳細は、Blockchain Serviceの共通レスポンスステータスコードをご参照ください。

        レスポンス例

        レスポンスのサンプルコードは次の通りです。

        {
            "networkId": 1630,
            "nodeId": "25738634",
            "nodeType": "peer",
            "containerNo": 0,
            "cpuUsage": {
                "1722306600000": 0.0077477186,
                "1722308400000": 0.0076888553,
                "1722313800000": 0.007819935,
                "1722304800000": 0.0071446504,
                "1722315600000": 0.008204839,
                "1722299400000": 0.0074888305,
                "1722317400000": 0.007889176,
                "1722301200000": 0.0073726247,
                "1722312000000": 0.0076033045,
                "1722303000000": 0.0076380465,
                "1722310200000": 0.007312449
            },
            "memUsage": {
                "1722306600000": 47,
                "1722308400000": 47,
                "1722313800000": 48,
                "1722304800000": 47,
                "1722315600000": 48,
                "1722299400000": 47,
                "1722317400000": 48,
                "1722301200000": 47,
                "1722312000000": 47,
                "1722303000000": 47,
                "1722310200000": 47
            },
            "diskUsage": {
                "1722306600000": 0,
                "1722308400000": 0,
                "1722313800000": 0,
                "1722304800000": 0,
                "1722315600000": 0,
                "1722299400000": 0,
                "1722317400000": 0,
                "1722301200000": 0,
                "1722312000000": 0,
                "1722303000000": 0,
                "1722310200000": 0
            }
        }
        JSON

        この記事は役に立ちましたか?

        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.