import asposetaskscloud
from asposetaskscloud.TasksApi import TasksApi
from asposetaskscloud.TasksApi import ApiException

import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
from asposestoragecloud.StorageApi import ResponseMessage

apiKey = "XXXXX" #sepcify App Key
appSid = "XXXXX" #sepcify App SID
apiServer = "http://api.aspose.com/v1.1"
data_folder = "../../data/"

#Instantiate Aspose Storage API SDK
storage_apiClient = asposestoragecloud.ApiClient.ApiClient(apiKey, appSid, True)
storageApi = StorageApi(storage_apiClient)
#Instantiate Aspose Tasks API SDK
api_client = asposetaskscloud.ApiClient.ApiClient(apiKey, appSid, True)
tasksApi = TasksApi(api_client);

#set input file name
name = "sample-project.mpp"

try:
    #upload file to aspose cloud storage
    response = storageApi.PutCreate(name, data_folder + name)

    #invoke Aspose.Tasks Cloud SDK API to retrieve project properties
    response = tasksApi.GetDocumentProperties(name)

    if response.Status == "OK":
        for docProp in response.Properties.List:
            print str(docProp.Name) + " :: " + str(docProp.Value)

except ApiException as ex:
            print "ApiException:"
            print "Code:" + str(ex.code)
            print "Message:" + ex.message
