def setCardsAggregationMode(connection, chassisChainUrl, chassisIp, cardIdList, mode): ''' This method is used to change the aggregation mode on a list of cards from a chassis. In order to call this method, the desired chassis must be already added and connected. Args: - connection is the connection object that manages the HTTP data transfers between the client and the REST API - chassisChainUrl is the address of the chassisChain resource - chassisIp is the IP or hostname of the chassis that contains the card(s) - cardIdList is a list of card IDs - mode is the aggregation mode that will be set on the cards. Possible options are (depending on card type): NA (Non Aggregated), 1G, 10G, 40G ''' setCardsAggregationModeOperationUrl = "%s/operations/setCardsAggregationMode" % chassisChainUrl cardIdStr = ",".join([str(cardId) for cardId in cardIdList]) data = {"chassisIp":chassisIp, "cardIdList":cardIdStr, "mode":mode} performGenericOperation(connection, setCardsAggregationModeOperationUrl, data)