Difference between revisions of "File Upload Plugin"

From ESS-WIKI
Jump to: navigation, search
(Created page with "== Introduction == *'''FileUpload – Auto sync files, in the folder, with Cloud Storage server.''' Advantages:")
 
 
(9 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
Advantages:
 
Advantages:
 +
 +
*Sync files automatically.
 +
*Support various Cloud Storage or FTP Server
 +
*Report Status/Progress to RMM Server
 +
*Send Event to notify file upload result 
 +
 +
[[File:FileUpload.png|778x600px|FileUpload.png]]
 +
 +
= Use Case =
 +
 +
= Architecture =
 +
 +
== Capability ==
 +
 +
 +
<syntaxhighlight lang="java">{
 +
  "FileUpload": {
 +
    "info": {
 +
      "e": [
 +
        {"n": "name","sv": "FileUpload","asm": "r"},
 +
        {"n": "description","sv": "This service is FileUpload Service","asm": "r"},
 +
        {"n": "version","sv": "1.0.1","asm": "r"},
 +
        {"n": "functionList","sv": "upload,resync","asm": "r"},
 +
        {"n": "functionCode","v": 3,"asm": "r"}
 +
      ],
 +
      "nonSensorData": true,
 +
      "bn": "info"
 +
    },
 +
    "action": {
 +
      "e": [
 +
        {
 +
          "msg": "Re-synchronous files in target folder",
 +
          "bv": true,
 +
          "asm": "w",
 +
          "n": "resync"
 +
        },
 +
        {
 +
          "msg": "Upload target file in target folder",
 +
          "sv": "",
 +
          "asm": "w",
 +
          "n": "upload"
 +
        }
 +
      ],
 +
      "bn": "action"
 +
    },
 +
    "bn": "FileUpload"
 +
  }
 +
}
 +
</syntaxhighlight>
 +
 +
== Event Notify ==
 +
 +
 +
<syntaxhighlight lang="java">{ 
 +
  "commCmd":2059,
 +
  "agentID":" 00000001-0000-0000-0000-305A3A77B1DA ",
 +
  "handlerName":"general",
 +
  "content":{
 +
    "eventnotify":{"subtype":"FILE_UPLAD_INFO","msg":"File 'test' upload success","severity":5,"handler":"RuleEngine"},
 +
    "opTS":{"$date":1494308768000}
 +
  },
 +
  "sendTS":{"$date":1522457629328}
 +
}
 +
</syntaxhighlight>
 +
 +
<syntaxhighlight lang="java">{ 
 +
  "commCmd":2059,
 +
  "agentID":" 00000001-0000-0000-0000-305A3A77B1DA ",
 +
  "handlerName":"general",
 +
  "content":{
 +
    "eventnotify":{"subtype":"FILE_UPLAD_ERROR","msg":"File 'test' upload failed! Error Code:XXX ","severity":5,"handler":"RuleEngine"},
 +
    "opTS":{"$date":1494308768000}
 +
  },
 +
  "sendTS":{"$date":1522457629328}
 +
}
 +
</syntaxhighlight>
 +
 +
subtype:&nbsp;FILE_UPLAD_INFO or&nbsp;FILE_UPLAD_ERROR

Latest revision as of 08:12, 10 January 2019

Introduction

  • FileUpload – Auto sync files, in the folder, with Cloud Storage server.

Advantages:

  • Sync files automatically.
  • Support various Cloud Storage or FTP Server
  • Report Status/Progress to RMM Server
  • Send Event to notify file upload result 

FileUpload.png

Use Case

Architecture

Capability

{
  "FileUpload": {
    "info": {
      "e": [
        {"n": "name","sv": "FileUpload","asm": "r"},
        {"n": "description","sv": "This service is FileUpload Service","asm": "r"},
        {"n": "version","sv": "1.0.1","asm": "r"},
        {"n": "functionList","sv": "upload,resync","asm": "r"},
        {"n": "functionCode","v": 3,"asm": "r"}
      ],
      "nonSensorData": true,
      "bn": "info"
    },
    "action": {
      "e": [
        {
          "msg": "Re-synchronous files in target folder",
          "bv": true,
          "asm": "w",
          "n": "resync"
        },
        {
          "msg": "Upload target file in target folder",
          "sv": "",
          "asm": "w",
          "n": "upload"
        }
      ],
      "bn": "action"
    },
    "bn": "FileUpload"
  }
}

Event Notify

{ 
  "commCmd":2059,
  "agentID":" 00000001-0000-0000-0000-305A3A77B1DA ",
  "handlerName":"general",
  "content":{
    "eventnotify":{"subtype":"FILE_UPLAD_INFO","msg":"File 'test' upload success","severity":5,"handler":"RuleEngine"},
    "opTS":{"$date":1494308768000} 
  },
  "sendTS":{"$date":1522457629328}
}
{ 
  "commCmd":2059,
  "agentID":" 00000001-0000-0000-0000-305A3A77B1DA ",
  "handlerName":"general",
  "content":{
    "eventnotify":{"subtype":"FILE_UPLAD_ERROR","msg":"File 'test' upload failed! Error Code:XXX ","severity":5,"handler":"RuleEngine"},
    "opTS":{"$date":1494308768000} 
  },
  "sendTS":{"$date":1522457629328}
}

subtype: FILE_UPLAD_INFO or FILE_UPLAD_ERROR