-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathIronBoxUploadFile.py
45 lines (40 loc) · 1.46 KB
/
IronBoxUploadFile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/python
#---------------------------------------------------
#
# Demonstrates how to upload a file to
# an IronBox secure package or container
#
# Written by [email protected]
# Website: www.goironbox.com
#
#---------------------------------------------------
from IronBoxREST import IronBoxRESTClient
#---------------------------------------------------
# Your IronBox authentication parameters, you could
# also pass these in as command arguments
#---------------------------------------------------
ContainerID = 100777
IronBoxEmail = "[email protected]"
IronBoxPassword = "password123"
IronBoxAPIServerURL = "https://api.goironcloud.com/latest/"
IronBoxAPIVersion = "latest"
InFile = "test.txt"
IronBoxFileName = "testFileOnIronBox.txt"
#---------------------------------------------------
# Main
#---------------------------------------------------
def main():
#----------------------------
# Create an instance of the IronBox REST class
#----------------------------
IronBoxRESTObj = IronBoxRESTClient(IronBoxEmail, IronBoxPassword, version=IronBoxAPIVersion, verbose=True)
#----------------------------
# Upload the file to IronBox
# Duplicate file names will automatically
# get renamed
#----------------------------
IronBoxRESTObj.UploadFileToContainer(ContainerID, InFile, IronBoxFileName)
#---------------------------------------------------
import string, datetime
if __name__ == "__main__":
main()