Beispiel #1
0
        public override void ExecuteCmdlet()
        {
            using (var client = CreateClient())
            {
                var request = new PatchGatewayClusterRequest
                {
                    Name                        = Name,
                    Department                  = Department,
                    Description                 = Description,
                    ContactInformation          = ContactInformation,
                    AllowCloudDatasourceRefresh = AllowCloudDatasourceRefresh,
                    AllowCustomConnectors       = AllowCustomConnectors,
                    LoadBalancingSelectorType   = LoadBalancingSelectorType
                };

                var result = client.Gateways.PatchGatewayCluster(GatewayClusterId, request, this.Scope == PowerBIUserScope.Individual).Result;
                Logger.WriteObject(result, true);
            }
        }
Beispiel #2
0
        public async Task SetOnPremisesDataGatewayClusterCanBeSerialized()
        {
            // Arrange
            var client  = Utilities.GetTestClient("");
            var request = new PatchGatewayClusterRequest()
            {
                Name                        = "name",
                Department                  = "department",
                Description                 = "description",
                ContactInformation          = "contactInformation",
                AllowCloudDatasourceRefresh = true,
                AllowCustomConnectors       = true,
                LoadBalancingSelectorType   = "loadBalancingSelectorType"
            };

            // Act
            var result = await client.PatchGatewayCluster(Guid.NewGuid(), request, true);

            // Assert
            result.IsSuccessStatusCode.Should().Be(true);
        }
        public async Task <HttpResponseMessage> PatchGatewayCluster(Guid gatewayClusterId, PatchGatewayClusterRequest patchGatewayClusterRequest, bool asIndividual)
        {
            var url = Invariant($"{GetODataUrlStart(asIndividual)}/gatewayclusters({gatewayClusterId})");

            var httpContent = SerializeObject(patchGatewayClusterRequest);
            var response    = await HttpClientInstance.PatchAsync(url, httpContent);

            response.EnsureSuccessStatusCode();

            return(response);
        }