/// <summary> /// Associates the floating IP withe the specified port. /// </summary> /// <param name="portId">The port identifier.</param> /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> /// <exception cref="InvalidOperationException">Thrown when a resource as not constructed by the SDK.</exception> public async Task AssociateAsync(Identifier portId, CancellationToken cancellationToken = default(CancellationToken)) { var networking = this.GetOwnerOrThrow <NetworkingApiBuilder>(); var request = new FloatingIPUpdateDefinition { PortId = portId }; var result = await networking.UpdateFloatingIPAsync <FloatingIP>(Id, request, cancellationToken).ConfigureAwait(false); result.CopyProperties(this); }
/// <inheritdoc cref="NetworkingApiBuilder.UpdateFloatingIPAsync{T}" /> public static Task <FloatingIP> UpdateFloatingIPAsync(this NetworkingService service, FloatingIPUpdateDefinition floatingIP, CancellationToken cancellationToken = default(CancellationToken)) { return(service._networkingApiBuilder.CreateFloatingIPAsync <FloatingIP>(floatingIP, cancellationToken)); }
/// <inheritdoc cref="NetworkingApiBuilder.UpdateFloatingIPAsync{T}" /> public static Task<FloatingIP> UpdateFloatingIPAsync(this NetworkingService service, FloatingIPUpdateDefinition floatingIP, CancellationToken cancellationToken = default(CancellationToken)) { return service._networkingApiBuilder.CreateFloatingIPAsync<FloatingIP>(floatingIP, cancellationToken); }