Beispiel #1
0
        /// <summary>
        /// Lists the node agent SKUs matching the specified filter options.
        /// </summary>
        /// <param name="context">The account to use.</param>
        /// <param name="filterClause">The level of detail</param>
        /// <param name="maxCount">The number of results.</param>
        /// <param name="additionalBehaviors">Additional client behaviors to perform.</param>
        /// <returns>The node agent SKUs matching the specified filter.</returns>
        public IEnumerable <PSNodeAgentSku> ListNodeAgentSkus(
            BatchAccountContext context,
            string filterClause = default(string),
            int maxCount        = default(int),
            IEnumerable <BatchClientBehavior> additionalBehaviors = null)
        {
            PoolOperations   poolOperations = context.BatchOMClient.PoolOperations;
            ODATADetailLevel filterLevel    = new ODATADetailLevel(filterClause: filterClause);

            IPagedEnumerable <NodeAgentSku>     nodeAgentSkus   = poolOperations.ListNodeAgentSkus(filterLevel, additionalBehaviors);
            Func <NodeAgentSku, PSNodeAgentSku> mappingFunction = p => { return(new PSNodeAgentSku(p)); };

            return(PSPagedEnumerable <PSNodeAgentSku, NodeAgentSku> .CreateWithMaxCount(nodeAgentSkus, mappingFunction,
                                                                                        maxCount, () => WriteVerbose(string.Format(Resources.MaxCount, maxCount))));
        }