public ServerGroupModel[] ServerGroupList() { var r = Send("servergrouplist").Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); var re = new ServerGroupModel[r.Length]; for (int i = 0; i < re.Length; i++) { re[i] = new ServerGroupModel(r[i]); } return(re); }
public async Task <JsonResult> CreateServerGroup(string groupName, bool azureBackupEnabled) { Requires.Argument <string>("groupName", groupName).NotNullOrEmpty(); try { ServerGroup groupToPost = new ServerGroup(); groupToPost.GroupName = groupName; groupToPost.AzureBackupEnabled = azureBackupEnabled; var serverGroup = await ClientFactory.VmBackupClient.CreateServerGroupAsync(groupToPost); ServerGroupModel groupModel = new ServerGroupModel(serverGroup); return(Json(groupModel)); } catch (Exception e) { throw this.HandleException(e); } }