Exemplo n.º 1
0
        /// <summary>
        /// Creates api client if not exists.
        /// </summary>
        /// <returns></returns>
        private static void CreateClientIfNotExists()
        {
            if (_client != null)
            {
                return;
            }
            if (!IsKubernetes)
            {
                return;
            }

            ApiClient client = new ApiClient($"https://{Host}:{Port}/");

            Configuration.DefaultApiClient = client;
            try
            {
                KubernetesConfiguration.ConfigureWithPodEnvironment();
            }
            catch (NotKubernetesPodException)
            {
                return;
            }
            _client = client;
            client.AddDefaultHeader("Authorization", "Bearer " + Configuration.Password);

            // Initialize APIs
            APIApi        = new ApiApi(client);
            APIsApi       = new ApisApi(client);
            ExtensionsApi = new ExtensionsApi(client);
            V1Api         = new VApi(client);
            VBetaApi      = new VbetaApi(client);
            VersionApi    = new VersionApi(client);
        }
Exemplo n.º 2
0
 public void Init()
 {
     instance = new ApisApi();
 }