Get Disk Usage from Third Party Storage Introduction
This API allows you to get Disk Usage from the third party Storage.
Note: You need to configure Third Party Storage with Aspose Cloud before using this example. Please follow the instructions at this page to configure your required storage.
API Explorer
Aspose.Storage Cloud API Reference lets you try out Get Disk Usage API right away in your browser! It allows you to effortlessly interact and try out every single operation our APIs exposes. Please check this article to learn how to get your App Key and SID.
cURL Example
SDKs
Our API is completely independent of your operating system, database system or development language. You can use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone and time-consuming. Therefore, we have provided and support API SDKs in many development languages in order to make it easier to integrate with us. If you use SDK , it hides the REST API calls and lets you use Aspose.Platform features in a native way for your preferred language.
SDK Examples
C#
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-dotnet
// Get App Key and App SID from https://dashboard.aspose.cloud/
var configuration = new Configuration { AppSid = "xxxxxxxx", AppKey = "xxxxxxxx" };
StorageApi storageApi = new StorageApi(configuration);
GetDiscUsageRequest request = new GetDiscUsageRequest();
request.Storage = "MyDropboxStorage";
var response = storageApi.GetDiscUsage(request);
Java
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-java/
// Get App Key and App SID from https://dashboard.aspose.cloud/
StorageApi api = new StorageApi("https://api.aspose.cloud/v1.1", "xxxxx", "xxxxx");
String storage = "MyDropboxStorage";
DiscUsageResponse response = api.GetDiscUsage(storage);
PHP
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-php
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
use Aspose\Storage\Configuration;
use Aspose\Storage\Api\StorageApi;
use Aspose\Storage\Model\Requests;
class DiskUsage {
public $storageApi;
public function __construct() {
$config = new Configuration();
// Get App Key and App SID from https://dashboard.aspose.cloud/
$config->setAppKey('')->setAppSid('');
$this->storageApi = new StorageApi($config);
}
public function getDiskUsage() {
$storage = "MyDropboxStorage";
$request = new Requests\GetDiscUsageRequest($storage);
$result = $this->storageApi->getDiscUsage($request);
print_r($result);
}
}
$diskUsage = new DiskUsage();
$diskUsage->getDiskUsage();
?>
Ruby
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-ruby
require 'aspose_storage_cloud'
class Storage
include AsposeStorageCloud
def initialize
#TODO: Get your AppSID and Appkey from https://dashboard.aspose.cloud
AsposeStorageCloud.configure do |config|
config.api_key['api_key'] = ''
config.api_key['app_sid'] = ''
end
@storage_api = StorageApi.new
end
def get_disc_usage
storage = 'MyDropboxStorage'
request = GetDiscUsageRequest.new(storage)
result = @storage_api.get_disc_usage(request)
end
end
storage = Storage.new()
puts storage.get_disc_usage
Python
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()