protected override void ProcessRecord() { if (Vlan != null) { Id = Guid.Parse(Vlan.id); } ResponseType response = null; base.ProcessRecord(); try { var expandVlan = new ExpandVlanType() { id = Id.ToString(), privateIpv4PrefixSize = PrivateIpv4PrefixSize }; response = Connection.ApiClient.Networking.Vlan.ExpandVlan(expandVlan).Result; } catch (AggregateException ae) { ae.Handle( e => { if (e is ComputeApiException) { WriteError( new ErrorRecord(e, "-2", ErrorCategory.InvalidOperation, Connection)); } else { ThrowTerminatingError( new ErrorRecord(e, "-1", ErrorCategory.ConnectionError, Connection)); } return(true); }); } WriteObject(response); }
/// <summary> /// Expand Virtual LAN on a network domain. /// </summary> /// <param name="expandVlan"> /// Expand Virtual LAN request. /// </param> /// <returns> /// Operation status /// </returns> public async Task <ResponseType> ExpandVlan(ExpandVlanType expandVlan) { return(await _api.PostAsync <ExpandVlanType, ResponseType>(ApiUris.ExpandVlan(_api.OrganizationId), expandVlan)); }