/// <inheritdoc cref="NetworkingApiBuilder.UpdateSubnetAsync" />
 public Task <Subnet> UpdateSubnetAsync(Identifier subnetId, SubnetUpdateDefinition subnet, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(_networkingApiBuilder
            .UpdateSubnetAsync(subnetId, subnet, cancellationToken)
            .SendAsync()
            .ReceiveJson <Subnet>());
 }
        public async void UpdateSubnetTest()
        {
            Network network = await _testData.CreateNetwork();

            Subnet subnet = await _testData.CreateSubnet(network);

            var networkUpdate = new SubnetUpdateDefinition
            {
                Name = string.Format("{0}-updated", subnet.Name)
            };

            Trace.WriteLine("Updating the subnet...");
            subnet = await _networkingService.UpdateSubnetAsync(subnet.Id, networkUpdate);

            Trace.WriteLine("Verifying subnet was updated as requested...");
            Assert.NotNull(subnet);
            Assert.Equal(networkUpdate.Name, subnet.Name);
        }
예제 #3
0
        public void UpdateSubnet()
        {
            using (var httpTest = new HttpTest())
            {
                Identifier subnetId = Guid.NewGuid();
                httpTest.RespondWithJson(new Subnet {
                    Id = subnetId
                });

                var definition = new SubnetUpdateDefinition {
                    Name = "new subnet name"
                };
                var subnet = _cloudNetworkService.UpdateSubnet(subnetId, definition);

                httpTest.ShouldHaveCalled("*/subnets/" + subnetId);
                Assert.NotNull(subnet);
                Assert.Equal(subnetId, subnet.Id);
            }
        }
 /// <inheritdoc cref="NetworkingApiBuilder.UpdateSubnetAsync" />
 public Task<Subnet> UpdateSubnetAsync(Identifier subnetId, SubnetUpdateDefinition subnet, CancellationToken cancellationToken = default(CancellationToken))
 {
     return _networkingApiBuilder
         .UpdateSubnetAsync(subnetId, subnet, cancellationToken)
         .SendAsync()
         .ReceiveJson<Subnet>();
 }
        public async void UpdateSubnetTest()
        {
            Network network = await _testData.CreateNetwork();
            Subnet subnet = await _testData.CreateSubnet(network);

            var networkUpdate = new SubnetUpdateDefinition
            {
                Name = string.Format("{0}-updated", subnet.Name)
            };

            Trace.WriteLine("Updating the subnet...");
            subnet = await _networkingService.UpdateSubnetAsync(subnet.Id, networkUpdate);

            Trace.WriteLine("Verifying subnet was updated as requested...");
            Assert.NotNull(subnet);
            Assert.Equal(networkUpdate.Name, subnet.Name);
        }
 /// <inheritdoc cref="OpenStack.Synchronous.NetworkingServiceExtensions.UpdateSubnet"/>
 public static Subnet UpdateSubnet(this CloudNetworkService cloudNetworkService, Identifier subnetId, SubnetUpdateDefinition subnet)
 {
     return cloudNetworkService.UpdateSubnetAsync(subnetId, subnet).ForceSynchronous();
 }