Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="apiClientConfiguration"></param>
        internal KubernetesClient(Configuration apiClientConfiguration)
        {
            //Configuration apiClientConfiguration = new Configuration(apiClient);
            if (null == apiClientConfiguration)
            {
                throw new ApplicationException(string.Format("Missing required argument {0})", nameof(apiClientConfiguration)));
            }

            // Initialize endpoints
            this.ApiRegistrationApi   = new Apiregistration_v1beta1Api(apiClientConfiguration);
            this.AppsApi              = new Apps_v1beta1Api(apiClientConfiguration);
            this.AuthenticationApi    = new Authentication_v1Api(apiClientConfiguration);
            this.AuthorizationApi     = new Authorization_v1Api(apiClientConfiguration);
            this.AutoscalingApi       = new Autoscaling_v1Api(apiClientConfiguration);
            this.BatchApi             = new Batch_v1Api(apiClientConfiguration);
            this.CertificatesApi      = new Certificates_v1beta1Api(apiClientConfiguration);
            this.CoreApi              = new Core_v1Api(apiClientConfiguration);
            this.ExtensionsApi        = new Extensions_v1beta1Api(apiClientConfiguration);
            this.LogsApi              = new LogsApi(apiClientConfiguration);
            this.NetworkingApi        = new Networking_v1Api(apiClientConfiguration);
            this.PolicyApi            = new Policy_v1beta1Api(apiClientConfiguration);
            this.RbacAuthorizationApi = new RbacAuthorization_v1beta1Api(apiClientConfiguration);
            this.StorageApi           = new Storage_v1Api(apiClientConfiguration);
            this.VersionApi           = new VersionApi(apiClientConfiguration);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
 public Version(object nuGetVersion, IVersionApi api)
 {
     NuGetVersion = nuGetVersion;
     _api         = api;
 }
Ejemplo n.º 4
0
 public VersionRangeLogic(IVersionApi versionApi, IVersionRangeApi api)
 {
     _versionApi = versionApi;
     _api        = api;
 }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
 public VersionRange(object nuGetVersionRange, IVersionApi versionApi, IVersionRangeApi api)
 {
     NuGetVersionRange = nuGetVersionRange;
     _versionApi       = versionApi;
     _api = api;
 }
Ejemplo n.º 7
0
 public VersionLogic(IVersionApi api)
 {
     _api = api;
 }