Information Query URI

OPTIONS and HEAD requests are supported, both of which can use the functions supported by the Flask framework by default.

  • Query inference server information.
    1
    GET /v2
    
    or
    1
    GET /v2/
    

    Parameter

    Description

    Data Type

    serverName

    Inference service name

    String

    Response example:
    1
    {'errorCode': 0, 'errorMsg': 'Succeeded!', 'isSuccess': true, 'outputs': [{'server_name': 'StreamServer'}]}
    
  • Check whether the inference server is running.
    1
    GET /v2/live
    
    or
    1
    GET /v2/live/
    

    Parameter

    Description

    Data Type

    isLive

    Indicates whether the inference service is running.

    Boolean

    Response example:
    1
    {'errorCode': 0, 'errorMsg': 'Succeeded!', 'isSuccess': true, 'outputs': [{'isLive': True}]}
    
  • Check whether the inference server is ready to accept inference requests.
    GET /v2/ready
    or
    GET /v2/ready/

    Parameter

    Description

    Data Type

    isReady

    Indicates whether the inference server is ready to accept inference requests.

    Boolean

  • Check whether a model or stream is ready to accept inference requests.

    GET v2/streams/${STREAM_NAME}/ready

    GET v2/models/${MODEL_NAME}/ready

    Parameter

    Description

    Data Type

    isReady

    Indicates whether a model or stream is ready to accept inference requests.

    Boolean

    Response example:
    1
    {'errorCode': 0, 'errorMsg': 'Succeeded!', 'isSuccess': true, 'outputs': [{'isReady': True}]}
    

    ${MODEL_NAME} and ${STREAM_NAME} must be character strings, which consist of letters, digits, and special characters (+-_).

  • Query the configuration of a model or stream.

    GET v2/streams/${STREAM_NAME}/config

    GET v2/models/${MODEL_NAME}/config

    Parameter

    Description

    Data Type

    streamsConfig/modelsConfig

    Inference configuration of a model or stream

    JSON string

    Response example:
    1
    {'errorCode': 0, 'errorMsg': 'Succeeded!', 'isSuccess': true, 'outputs': [{'ModelSample': {'deviceId': 1, 'dynamicBatching': {'dynamicStrategy': 'Nearest', 'preferredBatchSize': [1, 2, 4, 8], 'singleBatchInfer': 0, 'waitingTime': 100}, 'inferType': 'models', 'inputs': [{'dataType': 'UINT8', 'format': 'FORMAT_NHWC', 'id': 0, 'name': 'Placeholder', 'shape': [-1, 224, 224, 3]}], 'name': 'resnet50', 'outputs': [{'dataType': 'FLOAT32', 'format': 'FORMAT_NONE', 'id': 0, 'name': 'fp32_vars/dense/BiasAdd:0', 'shape': [-1, 1001]}], 'timeoutMs': 3000}}]}
    

    ${MODEL_NAME} and ${STREAM_NAME} must be character strings, which consist of letters, digits, and special characters (+-_).