首页 > 其他分享 >iDirect IQ200 REST API

iDirect IQ200 REST API

时间:2024-10-13 14:11:24浏览次数:6  
标签:led api REST terminal url API device iDirect 1.0

iDirect IQ200 REST API

 

################################

###### HTTP 基本认证方式 ( 命令行参数中直接输入用户名和密码 ) 获取 Modem LED 状态信息
### 请求命令 curl -u admin:P@55w0rd! -isk 'https://172.28.170.217/api/1.0/terminal/device/led' # 响应头数据 HTTP/1.1 200 OK Connection: close Content-Type: application/json Content-Length: 509 # 响应体数据 { "data": [ { "id": 0, "name": "rx", "color": "yellow", "flash": "", "url": "/api/1.0/terminal/device/led/0" }, { "id": 2, "name": "tx", "color": "yellow", "flash": "", "url": "/api/1.0/terminal/device/led/2" }, { "id": 3, "name": "net", "color": "yellow", "flash": "0.5/0.5", "url": "/api/1.0/terminal/device/led/3" }, { "id": 4, "name": "power", "color": "green", "flash": "", "url": "/api/1.0/terminal/device/led/4" }, { "id": 5, "name": "status", "color": "green", "flash": "", "url": "/api/1.0/terminal/device/led/5" } ], "meta": { "url": "/api/1.0/terminal/device/led" } } ################################ ###### HTTP 基本认证方式 ( HTTP请求头中添加编码后的用户名和密码 ) 获取 Modem LED 状态信息
### 请求命令 curl -isk 'https://172.28.170.217/api/1.0/terminal/device/led' -H 'Authorization: Basic YWRtaW46UEA1NXcwcmQh' # 响应头数据 HTTP/1.1 200 OK Connection: close Content-Type: application/json Content-Length: 509 # 响应体数据 { "data": [ { "id": 0, "name": "rx", "color": "yellow", "flash": "", "url": "/api/1.0/terminal/device/led/0" }, { "id": 2, "name": "tx", "color": "yellow", "flash": "", "url": "/api/1.0/terminal/device/led/2" }, { "id": 3, "name": "net", "color": "yellow", "flash": "0.5/0.5", "url": "/api/1.0/terminal/device/led/3" }, { "id": 4, "name": "power", "color": "green", "flash": "", "url": "/api/1.0/terminal/device/led/4" }, { "id": 5, "name": "status", "color": "green", "flash": "", "url": "/api/1.0/terminal/device/led/5" } ], "meta": { "url": "/api/1.0/terminal/device/led" } } ################################

 

################################

###### Session Cookie 认证方式 ( HTTP请求头中Cookie添加session )

### 请求命令 ( 获取 csrf_token )
curl -isk 'https://172.28.170.217/' 

# 响应头数据
HTTP/1.1 302 Found
Set-Cookie: csrf_token=D5nuvGEcWxZnwXorSuHeXk0FVN1Zgng6m9yenRQZ9aI; SameSite; secure
Location: /login.html
Connection: close
Content-Length: 0


--------------------------------
### 请求命令 ( 获取 session )
curl -isk 'https://172.28.170.217/authorize?success=&fail=' -H 'Cookie: csrf_token=D5nuvGEcWxZnwXorSuHeXk0FVN1Zgng6m9yenRQZ9aI' -d $'user=admin&password=P@55w0rd\u0021&csrf_token=D5nuvGEcWxZnwXorSuHeXk0FVN1Zgng6m9yenRQZ9aI'

# 响应头数据
HTTP/1.1 200 OK
Set-Cookie: session=ca3bf7d95e86c149b404f3f29e34b4e6; http-only; secure
Connection: close
Content-Length: 5


--------------------------------
### 请求命令 ( 获取 Modem LED 状态信息 )
curl -isk 'https://172.28.170.217/api/1.0/terminal/device/led' -H 'Cookie: csrf_token=D5nuvGEcWxZnwXorSuHeXk0FVN1Zgng6m9yenRQZ9aI; session=ca3bf7d95e86c149b404f3f29e34b4e6'

# 响应头数据
HTTP/1.1 200 OK
Connection: close
Content-Type: application/json
Content-Length: 509

# 响应体数据
{
    "data": [
        {
            "id": 0,
            "name": "rx",
            "color": "yellow",
            "flash": "",
            "url": "/api/1.0/terminal/device/led/0"
        },
        {
            "id": 2,
            "name": "tx",
            "color": "yellow",
            "flash": "",
            "url": "/api/1.0/terminal/device/led/2"
        },
        {
            "id": 3,
            "name": "net",
            "color": "yellow",
            "flash": "0.5/0.5",
            "url": "/api/1.0/terminal/device/led/3"
        },
        {
            "id": 4,
            "name": "power",
            "color": "green",
            "flash": "",
            "url": "/api/1.0/terminal/device/led/4"
        },
        {
            "id": 5,
            "name": "status",
            "color": "green",
            "flash": "",
            "url": "/api/1.0/terminal/device/led/5"
        }
    ],
    "meta": {
        "url": "/api/1.0/terminal/device/led"
    }
}


--------------------------------
### 请求命令 ( 获取 session )
curl curl -isk 'https://172.28.170.217/authorize?logout' -H 'Cookie: csrf_token=D5nuvGEcWxZnwXorSuHeXk0FVN1Zgng6m9yenRQZ9aI; session=ca3bf7d95e86c149b404f3f29e34b4e6'

# 响应头数据
HTTP/1.1 302 Found
Set-Cookie: session=; Max-Age=0; secure
Set-Cookie: csrf_token=YEd0k7LcWd6cbC5XPoy39TBrmuPXjvuEh6bEZQF98mE; SameSite; secure
Location: /login.html
Connection: close
Content-Length: 0


################################

 

============= End

 

标签:led,api,REST,terminal,url,API,device,iDirect,1.0
From: https://www.cnblogs.com/lsgxeva/p/18462246

相关文章

  • 【Azure Cloud Service】使用RESTAPI更新Cloud Service(Extended Support) 中所配置的
    问题描述当根据CloudService(ExtendedSupport)文档更新证书(https://docs.azure.cn/zh-cn/cloud-services-extended-support/certificates-and-key-vault)时,如果遇见旧的证书(如中间证书,根证书)信息保存在KeyVaultSecret中,而更新的时候,只能从KeyVault证书中匹配到服务......
  • [Paper Reading] TouchInsight: Uncertainty-aware Rapid Touch and Text Input for M
    目录TouchInsight:Uncertainty-awareRapidTouchandTextInputforMixedRealityfromEgocentricVisionTL;DRMethod模型中的数据流touchlocalizationLossProbabilisticcommandpredictExperimentAblation打字速度模型部署效果可视化总结与发散资料查询TouchInsight:Unc......
  • 【Azure Cloud Service】使用RESTAPI更新Cloud Service(Extended Support) 中所配置的
    问题描述当根据CloudService(ExtendedSupport)文档更新证书(https://docs.azure.cn/zh-cn/cloud-services-extended-support/certificates-and-key-vault)时,如果遇见旧的证书(如中间证书,根证书)信息保存在KeyVaultSecret中,而更新的时候,只能从KeyVault证书中匹配到服务......
  • C#通用文档API接口集成示例-合同识别-智能文档识别
    在数字化转型的时代,企业面临着海量的文档数据,这些数据的处理不仅影响工作效率,还对企业的业务决策产生重要影响。然而,手工处理和管理这些文档,不仅效率低下,还可能因为人为错误导致数据的丢失或处理延误。面对这种挑战,智能文档识别技术成为解决企业文档管理难题的关键利器。......
  • 优化Capital许可管理
    在快节奏的商业环境中,软件许可管理对于确保企业合规性和控制成本至关重要。Capital作为一款领先的软件许可解决方案,为企业提供了强大的工具来优化许可管理。本文将介绍如何优化Capital许可,以提升效率并降低成本。一、了解许可需求与现状首先,企业需要全面了解自身的软件许可需求......
  • RESTful 接口设计规范 笔记
    协议:API与用户的通信协议,http,https协议域名:eg:http://example.com版本:如果接口有版本的迭代的话,可以在域名后面拼接版本标识,eg:http://example.com/v1路径又称终点endpoint,表示api的具体网址在restful架构中,每个网址代表一种资源,所以网址中不能有动词,只使用名词且往往......
  • OpenAPI 简介
    本文分享自天翼云开发者社区《OpenAPI简介》,作者:蔡****钊一、什么是openAPIAPI的全称是应用编程接口(ApplicationProgrammingInterface),而所谓的openAPI其实就是一种面向客户的开放接口能力,而对应的客户,从我们以往常规认知的个人产品直接使用用户,变为技术用户。正如很多SaaS......
  • 一文详述:AI 网关与 API 网关到底有什么区别?
    近年来AI发展火热,大模型已经成为推动各行各业业务创新和增长的关键力量。随之而来问题是“企业该如何安全管理和部署AI应用的挑战?”AI基础架构的设计不仅要支持现有的业务需求,还要能够适应未来技术的快速发展。在这样的背景下,AI网关的概念应运而生,AI网关在AI应用的集成、管理和......
  • Newtec MDM2510 REST API
    NewtecMDM2510RESTAPI SatOct1214:37:112024<--L10SatOct1214:37:112024<--A15SatOct1214:37:112024<--W15SatOct1214:37:112024<--S172.0000000.0000000.000000SatOct1214:37:112024......
  • fastapi请求豆包流式传输接口
    #main.pyfromfastapiimportFastAPI,BackgroundTasks,HTTPException,Bodyfromfastapi.responsesimportStreamingResponseimportasyncioimportjsonfromvolcenginesdkarkruntimeimportArkfromstarlette.middleware.corsimportCORSMiddlewareapp=Fa......