Ejemplo n.º 1
0
        private static SQTotalUsed GetSQTotalUsed()
        {
            try {
                SQTotalUsed sqtotalused = new SQTotalUsed();
                string hash = Crypto.GetHMACbase64(Credential.SecretKey,Credential.PublicKey, true);

                string uri = string.Format("https://my.greenqloud.com/qloudsync/metrics/?username={0}&hashValue={1}", Credential.Username, hash);
                JObject data = JSONHelper.GetInfo (uri);
                if(data != null && data ["usage"] != null && data ["usage"]["storageqloud_size"] != null){
                    sqtotalused.Spent = (string) data ["usage"]["storageqloud_size"];
                }
                return sqtotalused;
            } catch {
                return null;
            }
        }
Ejemplo n.º 2
0
 static void UpdateVariables()
 {
     versionAvailable = GetVersionAvaliable ();
     savings = GetCO2Statistics ();
     usedup = GetSQTotalUsed ();
 }