File - TakayukiHoshi1984/DeviceConnect-Spec GitHub Wiki
ã¹ããŒãããã€ã¹ã«å¯ŸããŠã®ãã¡ã€ã«æäœæ©èœãæäŸããAPIã
API | æŠèŠ |
---|---|
GET /gotapi/file | ã¹ããŒãããã€ã¹ãžã®ã ããã¹ãïŒæ©æ°ãæ¶è²»ã«ããªãŒãç¡ç æéãªã©ã®ãã€ããªãŒã®ä»»æã®ããŒã¿ïŒã ç»åãé³å£°ãåç»ïŒãªãœãŒã¹ãå«ãïŒãåãåãã |
POST /gotapi/file | ã¹ããŒãããã€ã¹ã«å¯ŸããŠãããã¹ããç»åãé³å£°ãåç»ïŒãªãœãŒã¹ãå«ãïŒãæž¡ãã |
PUT /gotapi/file | ãã¡ã€ã«ãã¹ã§æå®ããããã¹ããç»åãé³å£°ãåç»ïŒãªãœãŒã¹ãå«ãïŒã®ååã å€æŽããã¡ã€ã«ã®ç§»åãããã |
DELETE /gotapi/file | ãã¡ã€ã«ãã¹ã§æå®ããããã¹ããç»åãé³å£°ãåç»ïŒãªãœãŒã¹ãå«ãïŒãåé€ããã |
GET /gotapi/file/directory | ä¿åãããŠãããã¡ã€ã«ã®äžèŠ§ãååŸããã |
POST /gotapi/file/directory | ãã£ã¬ã¯ããªã®äœæèŠæ±ãæž¡ãã |
PUT /gotapi/file/directory | ãã£ã¬ã¯ããªã®ååã®å€æŽã移åèŠæ±ãæž¡ãã |
DELETE /gotapi/file/directory | ãã£ã¬ã¯ããªã®åé€èŠæ±ãæž¡ãã |
GET /gotapi/file/list | ã¹ããŒãããã€ã¹ã«ä¿åãããŠãããã¡ã€ã«ã®äžèŠ§ãååŸããã |
one-shot
ã¹ããŒãããã€ã¹ãžã®ã ããã¹ãïŒæ©æ°ãæ¶è²»ã«ããªãŒãç¡ç æéãªã©ã®ãã€ããªãŒã®ä»»æã®ããŒã¿ïŒã ç»åãé³å£°ãåç»ïŒãªãœãŒã¹ãå«ãïŒãåãåãã
ãã®ãªã¯ãšã¹ãã®ã¬ã¹ãã³ã¹ã§URLãè¿ãã ãã®URLã«ã¢ã¯ã»ã¹ããããšã§ãªãœãŒã¹ã«ã¢ã¯ã»ã¹ã§ããããã«ããããšã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
path | string | Yes | ãã¡ã€ã«ãã¹ããã¡ã€ã«åãšãã¹ |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
MimeType | mimeType | string | Yes | URIããŒã¿ã®MimeType |
URI | uri | string | Yes | ContentProviderã®URI ãã®URIããããŒã¿ãèªã¿èŸŒã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0", "mimeType" : "image/png", "uri" : "http://localhost:4035/gotapi/files?uri=content%3A%2F%2FTest.png" }
one-shot
ã¹ããŒãããã€ã¹ã«å¯ŸããŠãããã¹ããç»åãé³å£°ãåç»ïŒãªãœãŒã¹ãå«ãïŒãæž¡ãã
ãã«ãããŒã圢åŒã§ãã¡ã€ã«ãéä¿¡ããã ãã¡ã€ã«ã®å®¹éå¶éã«é¢ããŠã¯ãã¹ããŒãããã€ã¹ããšã«ããç°ãªãã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
path | string | Yes | ãã¡ã€ã«ãã¹ããã¡ã€ã«åãšãã¹ |
mimeType | string | No | MimeTypeãéä¿¡ãããã¡ã€ã«ã®MimeType |
uri | string | No | URIããã®URIã«éä¿¡ããããŒã¿ãæ ŒçŽããã dataãšåæã«çç¥ããããšã¯ã§ããªãã äž¡æ¹æå®ããå Žåã¯dataãåªå ãããuriã¯ç¡èŠãããã |
data | file | No | ãã¡ã€ã«ã®binaryãéä¿¡ãããã¡ã€ã«ã®binaryã uriãšåæã«çç¥ããããšã¯ã§ããªãã äž¡æ¹æå®ããå Žåã¯dataãåªå ãããuriã¯ç¡èŠãããã |
forceOverwrite | boolean | No | äžæžããã©ã°ã true : æ¢ã«pathåãšåããã¡ã€ã«ãããå Žåã¯äžæžããããã false : æ¢ã«pathåãšåããã¡ã€ã«ãããå Žåã¯äžæžããããªãã |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0" }
one-shot
ãã¡ã€ã«ãã¹ã§æå®ããããã¹ããç»åãé³å£°ãåç»ïŒãªãœãŒã¹ãå«ãïŒã®ååã å€æŽããã¡ã€ã«ã®ç§»åãããã
ãã£ã¬ã¯ããªã®ç§»åãè¡ãããå Žåã¯ã åãããã¡ã€ã«ã®PUT /file/directoryã䜿çšããããšã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
oldPath | string | Yes | 移ååã®ãã¡ã€ã«åãå«ãã ãã¡ã€ã«ãã¹ã ãã¡ã€ã«åãå«ãã |
newPath | string | Yes | 移åå
ã®ãã¡ã€ã«åãå«ãã ãã¡ã€ã«ãã¹ã ãã¡ã€ã«åãå«ãŸãªããŠãè¯ãã |
forceOverwrite | boolean | No | äžæžããã©ã°ã true : æ¢ã«pathåãšåããã¡ã€ã«ãããå Žåã¯äžæžããããã false : æ¢ã«pathåãšåããã¡ã€ã«ãããå Žåã¯äžæžããããªãã |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0" }
one-shot
ãã¡ã€ã«ãã¹ã§æå®ããããã¹ããç»åãé³å£°ãåç»ïŒãªãœãŒã¹ãå«ãïŒãåé€ããã
ãã£ã¬ã¯ããªã®åé€ãè¡ãããå Žåã¯ã åãããã¡ã€ã«ã®DELETE /file/directoryã䜿çšããããšã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
path | string | Yes | ãã¡ã€ã«ãã¹ããã¡ã€ã«åãšãã¹ |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0" }
one-shot
ä¿åãããŠãããã¡ã€ã«ã®äžèŠ§ãååŸããã
/file/listãšåãåäœãããã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
path | string | No | ãã¹ãæ€çŽ¢å¯Ÿè±¡ã®ãã£ã¬ã¯ããªã çç¥ãããããã®ããã€ã¹ãã©ã°ã€ã³ã®ã¢ããªããã€ãã£ã¬ã¯ããªã®ã«ãŒããã£ã¬ã¯ããªãæå®ããã äŸ)/files/test/ |
mimeType | string | No | MimeTypeã æ å ±ãååŸãããã¡ã€ã«ã®çš®å¥ããšã«åºåãããå Žåã¯ãmimeTypeãæå®ããã äŸ)image/png |
order | array(string) | No | ååŸãã¡ã€ã«ã®äžŠã³é ã ååŸããäžèŠ§ã®ãšã³ããªã®äžŠã³é ã æé ã¯ascã§ãéé ã¯descãåŸãã«æå®ããã 䞊ã³é ãšããŠéžæããè¡ãã«ã³ãåºåãã§ã¬ã¹ãã³ã¹ã®ç©çåãéžæããã äŸ)updateDate,asc |
offset | integer | No | ååŸä»¶æ°ã®å§ãŸãã ååŸã§ãããã¡ã€ã«æ°ãå€ããšãã«ã衚瀺éå§äœçœ®ãæå®ã§ããã äŸ)4 |
limit | integer | No | ååŸä»¶æ°ã®å¶éã ååŸã§ãããã¡ã€ã«æ°ãå¶éãããšãã«ããã®ä»¶æ°ãæå®ã§ããã äŸ)30 |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ | |
---|---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
|
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã | |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã | |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã | |
æ€çŽ¢çµææ° | count | integer | Yes | æ€çŽ¢çµæã®ãã¡ã€ã«æ° | |
æ€çŽ¢ã«ããããããã¡ã€ã«ã®æ å ±ãªã¹ã | file | array(object) | Yes | æ€çŽ¢ã«ããããããã¡ã€ã«ã®æ å ±ãæã€ãªããžã§ã¯ã(object)ã®é åã | |
ãã¡ã€ã«ãã¹ | path | string | Yes | ãã¡ã€ã«åãå«ãããã¡ã€ã«ã®ååšãããã¹ã | |
MimeType | mimeType | string | Yes | fileã®ãšã³ã³ãŒãããã¿ã€ãã | |
ãã¡ã€ã«ã®çš®å¥ | fileType | integer | Yes | 0: ãã¡ã€ã« 1: ãã£ã¬ã¯ã㪠|
|
ãã¡ã€ã«ã®åå | fileName | string | Yes | æ¡åŒµåãå«ãããã£ã¬ã¯ããªåã¯å«ãŸãªãã | |
æŽæ°æé | updateDate | dateTime | Yes | RFC3339ãyyyy-MM-dd''T''HH:mm:ssZZZZZãã®åœ¢åŒã§è¿ãã | |
ãã¡ã€ã«ãµã€ãº | fileSize | integer | Yes | åäœã¯byteã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0", "count" : 2, "file" : [ { "path" : "/test/file1.txt", "fileName" : "file1.txt", "mimeType" : "text/plain", "updateDate" : "2015-05-17T10:02:20+09:00", "fileSize" : 123, "fileType" : 0 } ] }
one-shot
ãã£ã¬ã¯ããªã®äœæèŠæ±ãæž¡ãã
ãã£ã¬ã¯ããªã®äœæã¯ãã¹ããŒãããã€ã¹äžã§è¡ãã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
path | string | Yes | ãã¹ãäœæãããã£ã¬ã¯ããªã®ãã¹ |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0" }
one-shot
ãã£ã¬ã¯ããªã®ååã®å€æŽã移åèŠæ±ãæž¡ãã
移åãããã£ã¬ã¯ããªå ã«ãã¡ã€ã«ãããå Žåã«ç§»ååŠçãè¡ããã©ããã¯ã ã¹ããŒãããã€ã¹ããã³ããã€ã¹ãã©ã°ã€ã³ã®ä»æ§ã«äŸåããã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
oldPath | string | Yes | 移ååã®ãã£ã¬ã¯ããªãã¹ããã¡ã€ã«åãå«ãŸãªã |
newPath | string | Yes | 移åå ã®ãã£ã¬ã¯ããªãã¹ããã¡ã€ã«åãå«ãŸãªã |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0" }
one-shot
ãã£ã¬ã¯ããªã®åé€èŠæ±ãæž¡ãã
åé€ãããã£ã¬ã¯ããªå ã«ãã¡ã€ã«ãããå Žåã«åé€åŠçãè¡ããã©ããã¯ã ã¹ããŒãããã€ã¹ããã³ããã€ã¹ãã©ã°ã€ã³ã®ä»æ§ã«äŸåããã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
path | string | Yes | ãã¹ãåé€ãããã£ã¬ã¯ããªã®ãã¹ |
forceRemove | boolean | No | 匷å¶åé€ãã©ã°ã trueãæå®ãããå Žåã«ã¯ã空ã§ã¯ãªããã£ã¬ã¯ããªãåé€ããã falseãæå®ãããå Žåã«ã¯ã空ã§ãªããã£ã¬ã¯ããªã¯åé€ã§ããªãã çç¥ãããå Žåã«ã¯ãfalseãšåãåäœãšãªãã |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0" }
one-shot
ã¹ããŒãããã€ã¹ã«ä¿åãããŠãããã¡ã€ã«ã®äžèŠ§ãååŸããã
GET /file/directoryãšåãåäœãè¡ãã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
path | string | No | ãã¹ãæ€çŽ¢å¯Ÿè±¡ã®ãã£ã¬ã¯ããªã çç¥ãããããã®ããã€ã¹ãã©ã°ã€ã³ã®ã¢ããªããã€ãã£ã¬ã¯ããªã®ã«ãŒããã£ã¬ã¯ããªãæå®ããã äŸ)/files/test/ |
mimeType | string | No | MimeTypeã æ å ±ãååŸãããã¡ã€ã«ã®çš®å¥ããšã«åºåãããå Žåã¯ãmimeTypeãæå®ããã äŸ)image/png |
order | array(string) | No | ååŸãã¡ã€ã«ã®äžŠã³é ã ååŸããäžèŠ§ã®ãšã³ããªã®äžŠã³é ã æé ã¯ascã§ãéé ã¯descãåŸãã«æå®ããã 䞊ã³é ãšããŠéžæããè¡ãã«ã³ãåºåãã§ã¬ã¹ãã³ã¹ã®ç©çåãéžæããã äŸ)updateDate,asc |
offset | integer | No | ååŸä»¶æ°ã®å§ãŸãã ååŸã§ãããã¡ã€ã«æ°ãå€ããšãã«ã衚瀺éå§äœçœ®ãæå®ã§ããã äŸ)4 |
limit | integer | No | ååŸä»¶æ°ã®å¶éã ååŸã§ãããã¡ã€ã«æ°ãå¶éãããšãã«ããã®ä»¶æ°ãæå®ã§ãããäŸ)30 |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ | |
---|---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
|
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã | |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã | |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã | |
æ€çŽ¢çµææ° | count | integer | Yes | æ€çŽ¢çµæã®ãã¡ã€ã«æ° | |
æ€çŽ¢ã«ããããããã¡ã€ã«ã®æ å ±ãªã¹ã | file | array(object) | Yes | æ€çŽ¢ã«ããããããã¡ã€ã«ã®æ å ±ãæã€ãªããžã§ã¯ã(object)ã®é åã | |
ãã¡ã€ã«ãã¹ | path | string | Yes | ãã¡ã€ã«åãå«ãããã¡ã€ã«ã®ååšãããã¹ã | |
MimeType | mimeType | string | Yes | fileã®ãšã³ã³ãŒãããã¿ã€ãã | |
ãã¡ã€ã«ã®çš®å¥ | fileType | integer | Yes | 0: ãã¡ã€ã« 1: ãã£ã¬ã¯ã㪠|
|
ãã¡ã€ã«ã®åå | fileName | string | Yes | æ¡åŒµåãå«ãããã£ã¬ã¯ããªåã¯å«ãŸãªãã | |
æŽæ°æé | updateDate | dateTime | Yes | RFC3339ãyyyy-MM-dd''T''HH:mm:ssZZZZZãã®åœ¢åŒã§è¿ãã | |
ãã¡ã€ã«ãµã€ãº | fileSize | integer | Yes | åäœã¯byteã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0", "count" : 2, "file" : [ { "path" : "/test/file1.txt", "fileName" : "file1.txt", "mimeType" : "text/plain", "updateDate" : "2015-05-17T10:02:20+09:00", "fileSize" : 123, "fileType" : 0 } ] }