Exemple #1
0
        public void CorrectRequestForUpdateNodePool()
        {
            var factory = Substitute.For <IConnection>();
            var client  = new KubernetesClient(factory);
            var pool    = new Models.Requests.UpdateKubernetesNodePool();

            client.UpdateNodePool("1", "2", pool);
            var parameters = Arg.Is <List <Parameter> >(list => (string)list[0].Value == "1" && (string)list[1].Value == "2");

            factory.Received().ExecuteRequest <KubernetesNodePool>("kubernetes/clusters/{id}/node_pools/{poolId}", parameters, pool, "node_pool", Method.PUT);
        }
        /// <summary>
        /// Update a node pool on an existing Kubernetes cluster
        /// </summary>
        public Task <KubernetesNodePool> UpdateNodePool(string clusterId, string poolId, Models.Requests.UpdateKubernetesNodePool pool)
        {
            var parameters = new List <Parameter> {
                new Parameter {
                    Name = "id", Value = clusterId, Type = ParameterType.UrlSegment
                },
                new Parameter {
                    Name = "poolId", Value = poolId, Type = ParameterType.UrlSegment
                }
            };

            return(_connection.ExecuteRequest <KubernetesNodePool>("kubernetes/clusters/{id}/node_pools/{poolId}", parameters, pool, "node_pool", Method.PUT));
        }