/// <summary>
        ///     Retrieves the list of ACL rules associated with a network. This API requires your
        ///     organization ID and the ID of the target network.
        /// </summary>
        /// <param name="options">
        ///             Options for controlling the operation.
        /// </param>
        /// <param name="pagingOptions">
        ///     Options for controlling the paging.
        /// </param>
        /// <returns>
        ///     The VLAN collection.
        /// </returns>
        public async Task <IEnumerable <VlanType> > GetVlans(VlanListOptions options = null, PageableRequest pagingOptions = null)
        {
            var vlans =
                await
                _api.GetAsync <vlans>(
                    ApiUris.GetVlanByOrgId(_api.OrganizationId), pagingOptions);

            return(vlans.vlan);
        }
Example #2
0
        /// <summary>
        ///     Retrieves the list of ACL rules associated with a network. This API requires your
        ///     organization ID and the ID of the target network.
        /// </summary>
        /// <param name="options">
        ///     Options for controlling the operation.
        /// </param>
        /// <param name="pagingOptions">
        ///     Options for controlling the paging.
        /// </param>
        /// <returns>
        ///     The VLAN collection.
        /// </returns>
        public async Task <PagedResponse <VlanType> > GetVlansPaginated(VlanListOptions options = null, PageableRequest pagingOptions = null)
        {
            var response = await _api.GetAsync <vlans>(ApiUris.GetVlanByOrgId(_api.OrganizationId), pagingOptions, options);

            return(new PagedResponse <VlanType>
            {
                items = response.vlan,
                totalCount = response.totalCountSpecified ? response.totalCount : (int?)null,
                pageCount = response.pageCountSpecified ? response.pageCount : (int?)null,
                pageNumber = response.pageNumberSpecified ? response.pageNumber : (int?)null,
                pageSize = response.pageSizeSpecified ? response.pageSize : (int?)null
            });
        }
Example #3
0
        /// <summary>
        ///     Retrieves the list of ACL rules associated with a network. This API requires your
        ///     organization ID and the ID of the target network.
        /// </summary>
        /// <param name="options">
        ///     Options for controlling the operation.
        /// </param>
        /// <returns>
        ///     The VLAN collection.
        /// </returns>
        public async Task <IEnumerable <VlanType> > GetVlans(VlanListOptions options = null)
        {
            var response = await GetVlansPaginated(options, null);

            return(response.items);
        }
 public static async Task <IEnumerable <VlanType> > GetVlans(this IComputeApiClient client, VlanListOptions options = null, PageableRequest pagingOptions = null)
 {
     return(await client.Networking.Vlan.GetVlans(options, pagingOptions));
 }