/// <summary> /// 获取云硬盘列表 /// </summary> /// <returns></returns> public async Task <List <StorageInfo> > GetStorageList() { SetApiUri("/v1/block/list"); ClearHeader(); AddApiKeyHeader(); string strResult = await GetAsync(); List <StorageInfo> infoRes = JsonHandle.StorageListJson(strResult); return(infoRes); }
/// <summary> /// 获取快照列表 /// </summary> /// <returns></returns> public async Task <List <SnapInfo> > GetSnapList() { SetApiUri("/v1/snapshot/list"); ClearHeader(); AddApiKeyHeader(); string strResult = await GetAsync(); List <SnapInfo> infoRes = JsonHandle.SnapListJson(strResult); return(infoRes); }
/// <summary> /// 获取ISO列表 /// </summary> /// <returns></returns> public async Task <List <IsoInfo> > GetIsoList() { SetApiUri("/v1/iso/list"); ClearHeader(); AddApiKeyHeader(); string strResult = await GetAsync(); List <IsoInfo> infoRes = JsonHandle.IsoListJson(strResult); return(infoRes); }
/// <summary> /// 获取账号信息 /// </summary> /// <returns></returns> public async Task <AccountInfo> GetAccountInfo() { string strAccount = null; string strUser = null; SetApiUri("/v1/account/info"); ClearHeader(); AddApiKeyHeader(); strAccount = await GetAsync(); SetApiUri("/v1/auth/info"); ClearHeader(); AddApiKeyHeader(); strUser = await GetAsync(); AccountInfo infoRes = JsonHandle.AccountInfoJson(strAccount, strUser); return(infoRes); }