Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions IronBoxCreateRemoveSFTContainer.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,39 @@
def main():

#--------------------------------------------------
# Create an instance of the IronBox REST class
# Create an instance of the IronBox REST class
#--------------------------------------------------
IronBoxRESTObj = IronBoxRESTClient(IronBoxEmail, IronBoxPassword, version=IronBoxAPIVersion, verbose=True)

#--------------------------------------------------
# Create the container, duplicate container names
# are supported
# Create the container, duplicate container names
# are supported
#--------------------------------------------------
ContainerConfig = IronBoxSFTContainerConfig()
ContainerConfig.Name = "New container name"
ContainerConfig.Description = "Description of the new container (optional)"
ResultContainerConfig = IronBoxRESTObj.CreateEntitySFTContainer(Context, ContainerConfig)
if ResultContainerConfig is None:
print "Unable to create container"
return
print "Unable to create container"
return

print "New container created with ID=%s" % ResultContainerConfig.ContainerID

#--------------------------------------------------
# Remove the container
# Set the easy access settings
#--------------------------------------------------
result = IronBoxRESTObj.SetEntityContainerEasyAccess(ResultContainerConfig.ContainerID,
2, 'iampassword')
print "Easy Access URL(s)", result

#--------------------------------------------------
# Remove the container
#--------------------------------------------------
if IronBoxRESTObj.RemoveEntityContainer(ResultContainerConfig.ContainerID) is False:
print "Unable to remove container"
return
print "Unable to remove container"
return

print "New container was successfully removed"
print "New container was successfully removed"

#---------------------------------------------------
import string, datetime
Expand Down
18 changes: 9 additions & 9 deletions IronBoxDownloadReadyFiles.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Website: www.goironbox.com
#
# Usage:
# python IronBoxDownloadReadyFiles.py
# python IronBoxDownloadReadyFiles.py
#
#---------------------------------------------------
import sys
Expand All @@ -19,9 +19,9 @@
# Your IronBox authentication parameters, you could
# also pass these in as command arguments
#---------------------------------------------------
ContainerID = 100777
ContainerID = 100777
IronBoxEmail = "email@email.com"
IronBoxPassword = "password"
IronBoxPassword = "password123"
IronBoxAPIServerURL = "https://api.goironcloud.com/latest/"
IronBoxAPIVersion = "latest"

Expand All @@ -48,12 +48,12 @@ def main():
# where 0 = blob ID and 1 = blob name
result = IronBoxRESTObj.GetContainerBlobInfoListByState(ContainerID, BlobState)
for item in result:
# Download and save the file locally
DestFilePath = join(OutputDir,item[1])
if IronBoxRESTObj.DownloadBlobFromContainer(ContainerID,item[0],DestFilePath) is True:
# Optionally you can delete the blob after download
#IronBoxRESTObj.RemoveEntityContainerBlob(ContainerID,item[0])
pass
# Download and save the file locally
DestFilePath = join(OutputDir,item[1])
if IronBoxRESTObj.DownloadBlobFromContainer(ContainerID,item[0],DestFilePath) is True:
# Optionally you can delete the blob after download
#IronBoxRESTObj.RemoveEntityContainerBlob(ContainerID,item[0])
pass

#---------------------------------------------------
if __name__ == "__main__":
Expand Down
8 changes: 4 additions & 4 deletions IronBoxGetBlobInfoListByState.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Website: www.goironbox.com
#
# Usage:
# python IronBoxGetBlobInfoListByState.py
# python IronBoxGetBlobInfoListByState.py
#
#---------------------------------------------------
import sys
Expand All @@ -21,9 +21,9 @@
# Your IronBox authentication parameters, you could
# also pass these in as command arguments
#---------------------------------------------------
ContainerID = 100777
ContainerID = 100777
IronBoxEmail = "email@email.com"
IronBoxPassword = "password"
IronBoxPassword = "password123"
IronBoxAPIServerURL = "https://api.goironcloud.com/latest/"
IronBoxAPIVersion = "latest"

Expand All @@ -49,7 +49,7 @@ def main():
# where 0 = blob ID and 1 = blob name
result = IronBoxRESTObj.GetContainerBlobInfoListByState(ContainerID, BlobState)
for item in result:
print "%s -> %s" % (item[0],item[1])
print "%s -> %s" % (item[0],item[1])

#---------------------------------------------------
if __name__ == "__main__":
Expand Down
8 changes: 4 additions & 4 deletions IronBoxGetContextContainers.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# or server that an entity logs into. For example,
# an entity might log into the following:
#
# Context1: secure.goironcloud.com
# Context2: test.goironcloud.com
# Context1: secure.goironcloud.com
# Context2: test.goironcloud.com
#
# This demo shows you how to the retrieve the
# IronBox containers that the entity has access to
Expand All @@ -19,7 +19,7 @@
# Website: www.goironbox.com
#
# Usage:
# python IronBoxGetContextContainers.py
# python IronBoxGetContextContainers.py
#
#---------------------------------------------------
from IronBoxREST import IronBoxRESTClient
Expand All @@ -46,7 +46,7 @@
def main():

#----------------------------
# Create an instance of the IronBox REST class
# Create an instance of the IronBox REST class
#----------------------------
IronBoxRESTObj = IronBoxRESTClient(IronBoxEmail, IronBoxPassword, version=IronBoxAPIVersion, verbose=True)

Expand Down
4 changes: 2 additions & 2 deletions IronBoxGetContextSetting.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
def main():

#----------------------------
# Create an instance of the IronBox REST class
# Create an instance of the IronBox REST class
#----------------------------
IronBoxRESTObj = IronBoxRESTClient(IronBoxEmail, IronBoxPassword, version=IronBoxAPIVersion, verbose=True)

#----------------------------
# Get some public information about the context
# Get some public information about the context
#----------------------------
print "Company Name: %s" % IronBoxRESTObj.GetContextSetting(Context, "CompanyName")
print "Company Logo URL: %s" % IronBoxRESTObj.GetContextSetting(Context, "CompanyLogoUrl")
Expand Down
Loading