Esempio n. 1
0
        /// <summary>
        /// Retrieves the list of the NAT Rules on a particular Network Domain at an MCP 2.0 data center
        /// This API requires your organization ID and the ID of the target network.
        /// </summary>
        /// <param name="networkDomainId">  Identifier for the network domain.</param>
        /// <param name="options">          Options for filtering the operations.</param>
        /// <param name="pagingOptions">    The paging options, null means default.</param>
        /// <returns>                       The NAT Rule collection.</returns>
        public async Task <PagedResponse <NatRuleType> > GetNatRulesPaginated(Guid networkDomainId, NatRuleListOptions options = null, PageableRequest pagingOptions = null)
        {
            var response = await _api.GetAsync <natRules>(ApiUris.GetDomainNatRules(_api.OrganizationId, networkDomainId.ToString()), pagingOptions, options);

            return(new PagedResponse <NatRuleType>
            {
                items = response.natRule,
                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
            });
        }
Esempio n. 2
0
        /// <summary>
        /// Retrieves the list of the NAT Rules on a particular Network Domain at an MCP 2.0 data center
        /// This API requires your organization ID and the ID of the target network.
        /// </summary>
        /// <param name="networkDomainId">  Identifier for the network domain.</param>
        /// <param name="options">          Options for filtering the operations.</param>
        /// <returns>                       The NAT Rule collection.</returns>
        public async Task <IEnumerable <NatRuleType> > GetNatRules(Guid networkDomainId, NatRuleListOptions options = null)
        {
            var response = await GetNatRulesPaginated(networkDomainId, options, null);

            return(response.items);
        }