1 /*
2  * Copyright (C) 2015-2021 Alibaba Group Holding Limited
3  */
4 
5 #if AOS_COMP_CLI
6 #include "aos/cli.h"
7 #endif
8 #include "stdio.h"
9 #include "oss_app.h"
10 
11 //从阿里云平台购买OSS服务获取,替换成自己的就可以
12 char AccessKey_ID[] = "Access Key ID";
13 char AccessKey_Secret[] = "Access Key Secret";
14 char Endpoint[] = "End point";
15 char Bucket[] = "Bucket";
16 
example_oss_local_upload(int argc,char ** argv)17 static void example_oss_local_upload(int argc, char **argv)
18 {
19     printf("oss upload begin %s...\r\n",argv[1]);
20     if(0 == strcmp(argv[1],"0")){
21         oss_upload_local_content(AccessKey_ID, AccessKey_Secret, Endpoint, Bucket, argv[2]);
22     }
23     else if(0 == strcmp(argv[1],"1")){
24         oss_upload_local_file(AccessKey_ID, AccessKey_Secret, Endpoint, Bucket, argv[2]);
25     }
26 
27     printf("oss upload end !!!\r\n");
28     return;
29 }
30 
31 #if AOS_COMP_CLI
32 /* reg args: fun, cmd, description*/
33 ALIOS_CLI_CMD_REGISTER(example_oss_local_upload, oss_test, oss upload test example)
34 #endif
35