예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
        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);
        }