Last active
June 20, 2018 06:11
-
-
Save aspose-cloud/fbcea75cc30950ed47a4259fd2467130 to your computer and use it in GitHub Desktop.
The GIST contains Python Examples of Aspose.Storage Cloud APIs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The GIST contains Python Examples of Aspose.Storage Cloud APIs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class File(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def checkFilePresence(self): | |
response = self.api.get_is_exist('testfile.txt') | |
file = File() | |
file.checkFilePresence() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class File(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def copyFile(self): | |
path = "testfile.txt" | |
newdest = os.path.join("My Documents", "testfile.txt") | |
response = self.api.put_copy(path, newdest) | |
file = File() | |
file.copyFile() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class Folder(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def createFolder(self): | |
folderName = "My Documents" | |
response = self.api.put_create_folder(folderName) | |
folder = Folder() | |
folder.createFolder() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class Folder(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def createFolder(self): | |
folderName = "My Documents" | |
response = self.api.put_create_folder(folderName, storage = "MyDropboxStorage") | |
folder = Folder() | |
folder.createFolder() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class File(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def deleteFile(self): | |
fileName = 'testfile.txt' | |
response = self.api.delete_file(fileName) | |
file = File() | |
file.deleteFile() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class File(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def deleteFile(self): | |
fileName = 'testfile.txt' | |
response = self.api.delete_file(fileName, storage = "MyDropboxStorage") | |
file = File() | |
file.deleteFile() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class Folder(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def deleteFolder(self): | |
folderName = 'Pictures' | |
response = self.api.delete_folder(folderName) | |
folder = Folder() | |
folder.deleteFolder() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class Folder(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def deleteFolder(self): | |
folderName = 'Pictures' | |
response = self.api.delete_folder(folderName, storage = "MyDropboxStorage") | |
folder = Folder() | |
folder.deleteFolder() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class File(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def downloadFile(self): | |
fileName = 'testfile.txt' | |
response = self.api.get_download(fileName) | |
file = File() | |
file.downloadFile() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class DiskUsage(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def getDiskUsage(self): | |
response = self.api.get_disc_usage() | |
diskUsage = DiskUsage() | |
diskUsage.getDiskUsage() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class DiskUsage(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def getDiskUsage(self): | |
response = self.api.get_disc_usage(storage = "MyDropboxStorage") | |
diskUsage = DiskUsage() | |
diskUsage.getDiskUsage() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class File(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def getListFiles(self): | |
response = self.api.get_list_files() | |
file = File() | |
file.getListFiles() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class File(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def getListFiles(self): | |
response = self.api.get_list_files(storage = "MyDropboxStorage") | |
file = File() | |
file.getListFiles() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class File(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def moveFile(self): | |
src = "testfile.txt" | |
dest = os.path.join("Documents", "testfile.txt") | |
response = self.api.post_move_file(src, dest) | |
file = File() | |
file.moveFile() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class File(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def uploadFile(self): | |
fileName = "testfile.txt" | |
filePath = os.path.join(self.dataFolder, fileName) | |
with open(filePath, 'rb') as fp: | |
fileData = fp.read() | |
response = self.api.put_create(fileName, fileData) | |
file = File() | |
file.uploadFile() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-storage-cloud/aspose-storage-cloud-python | |
import os | |
import asposestoragecloud | |
from asposestoragecloud.apis.storage_api import StorageApi | |
from asposestoragecloud.api_client import ApiClient | |
class File(object): | |
def __init__(self): | |
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..") | |
self.dataFolder = os.path.join(ABSPATH, "Data") | |
# Get App Key and App SID from https://dashboard.aspose.cloud/ | |
self.apiClient = ApiClient(apiKey='xxxxxxxx', appSid='xxxx-xxxx-xxxx-xxxx-xxxx') | |
self.api = asposestoragecloud.apis.storage_api.StorageApi(self.apiClient) | |
def uploadFile(self): | |
fileName = "testfile.txt" | |
filePath = os.path.join(self.dataFolder, fileName) | |
with open(filePath, 'rb') as fp: | |
fileData = fp.read() | |
response = self.api.put_create(fileName, fileData, storage = "MyDropboxStorage") | |
file = File() | |
file.uploadFile() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment