using System.Collections.Generic;
public static void Main()
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
RestClient client = new RestClient("https://basestack-crz-dev.ocp.rnd.pncint.net");
RootObject myObject = new RootObject();
RestRequest request = new RestRequest(Method.GET);
request.Resource = $"/stacks?pageToken={myObject?.next_page_token}";
var response = client.Execute<RootObject>(request);
var data = response.Data;
if (data != null && data.stacks?.Count > 0)
myObject.stacks.AddRange(data.stacks);
myObject.next_page_token = data.next_page_token;
if (string.IsNullOrEmpty(data.next_page_token))
Console.WriteLine(JsonConvert.SerializeObject(myObject.stacks.Select(x => new { Name = x.name, Display = x.display_name })));
public string filesys { get; set; }
public string path { get; set; }
public int size_gb { get; set; }
public class StorageDetails
public List<object> disks { get; set; }
public List<Mount> mounts { get; set; }
public string zone { get; set; }
public string compute { get; set; }
public int node_count { get; set; }
public string storage { get; set; }
public string subnet { get; set; }
public string security_zone { get; set; }
public int? cpu { get; set; }
public int? mem { get; set; }
public StorageDetails storage_details { get; set; }
public class PackageParams
public string SQL_Size { get; set; }
public string SQL_Version { get; set; }
public string version { get; set; }
public bool? ssl { get; set; }
public bool? Deploy_SSL_Certificate { get; set; }
public bool? installuDeploy { get; set; }
public int? port { get; set; }
public List<string> Addl_Installation_Packages { get; set; }
public bool? installDB2Connect { get; set; }
public bool? installMQclient { get; set; }
public string sw_version { get; set; }
public string db_driver { get; set; }
public string db_name { get; set; }
public int? db_port { get; set; }
public string db_user { get; set; }
public string mattermost_version { get; set; }
public string name { get; set; }
public InfraParams infra_params { get; set; }
public PackageParams package_params { get; set; }
public List<string> environments { get; set; }
public List<string> tags { get; set; }
public string name { get; set; }
public string display_name { get; set; }
public List<Package> packages { get; set; }
public Labels labels { get; set; }
stacks = new List<Stack>();
public List<Stack> stacks { get; set; }
public string next_page_token { get; set; }