public RegionList GetRegionList(string regionId = "") //tested { RegionList list = new RegionList(); string resource = "/geography/Region"; if (regionId != "") { regionId = "/" + regionId; } resource += regionId; IEnumerable <string> json = GetJson(resource, 500, "", ""); foreach (string s in json) { var l = new JsonToList <RegionList>().GetList(s); if (list.regions != null) { list.regions.AddRange(l.regions); } else { list.regions = l.regions; } } return(list); }
public CloudList GetCloudList(string id = "") //tested { CloudList list = new CloudList(); IEnumerable <string> json = GetJson("/geography/Cloud", 500, id); foreach (string s in json) { var l = new JsonToList <CloudList>().GetList(s); if (list.clouds != null) { list.clouds.AddRange(l.clouds); } else { list.clouds = l.clouds; } } return(list); }
public ServerList GetServerList() //tested { ServerList list = new ServerList(); IEnumerable <string> serversJson = GetJson("/infrastructure/Server"); foreach (string s in serversJson) { var l = new JsonToList <ServerList>().GetList(s); if (list.servers != null) { list.servers.AddRange(l.servers); } else { list.servers = l.servers; } } return(list); }
public DeploymentList GetDeploymentList(string id = "") //tested { DeploymentList list = new DeploymentList(); IEnumerable <string> json = GetJson("/automation/Deployment", 500, id); foreach (string s in json) { var l = new JsonToList <DeploymentList>().GetList(s); if (list.deployments != null) { list.deployments.AddRange(l.deployments); } else { list.deployments = l.deployments; } } return(list); }
public AccountList GetAccountList(string id = "") //tested { AccountList list = new AccountList(); IEnumerable <string> json = GetJson("/admin/Account", 500, id); foreach (string s in json) { var l = new JsonToList <AccountList>().GetList(s); if (list.accounts != null) { list.accounts.AddRange(l.accounts); } else { list.accounts = l.accounts; } } return(list); }
public DataCenterList GetDataCenterList(string regionId) //tested { DataCenterList list = new DataCenterList(); IEnumerable <string> json = GetJson("/geography/DataCenter", 500, "", "regionId=" + regionId + "&activeOnly=true"); foreach (string s in json) { var l = new JsonToList <DataCenterList>().GetList(s); if (list.dataCenters != null) { list.dataCenters.AddRange(l.dataCenters); } else { list.dataCenters = l.dataCenters; } } return(list); }
public CustomerList GetCustomerList(string id = "") // tested { CustomerList list = new CustomerList(); DetailsEnum det = Details; Details = DetailsEnum.extended; IEnumerable <string> json = GetJson("/admin/Customer", 500, id); Details = det; foreach (string s in json) { var l = new JsonToList <CustomerList>().GetList(s); if (list.customers != null) { list.customers.AddRange(l.customers); } else { list.customers = l.customers; } } return(list); }
public BillingCodeList GetBillingCodeList(string id = "") //tested { BillingCodeList list = new BillingCodeList(); DetailsEnum det = Details; Details = DetailsEnum.extended; IEnumerable <string> json = GetJson("/admin/BillingCode", 500, id); Details = det; foreach (string s in json) { var l = new JsonToList <BillingCodeList>().GetList(s); if (list.billingCodes != null) { list.billingCodes.AddRange(l.billingCodes); } else { list.billingCodes = l.billingCodes; } } return(list); }