<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _exec_action(self, method, type, chaincodeID, function, args, id, secure_context=None, confidentiality_level=CHAINCODE_CONFIDENTIAL_PUB, metadata=None):
 """ Private method to implement the deploy, invoke and query actions Following http://www.jsonrpc.org/specification. :param method: Chaincode action to exec. MUST within DEFAULT_CHAINCODE_METHODS. :param type: chaincode language type: 1 for golang, 2 for node. :param chaincodeID: May include name or path. :param function: chaincode function name. :param args: chaincode function args. :param id: JSON-RPC requires this value for a response. :param secure_context: secure context if enable authentication. :param confidentiality_level: level of confidentiality. :param metadata: Metadata by client. """

        if method not in DEFAULT_CHAINCODE_METHODS:
            self.logger.error('Non-supported chaincode method: '+method)

        data = {
            "jsonrpc": "2.0",  # JSON-RPC protocol version. MUST be "2.0".
            "method": method,
            "params": {
                "type": type,
                "chaincodeID": chaincodeID,
                "ctorMsg": {
                    "function": function,
                    "args": args
                }
            },
            "id": id
        }
        if secure_context:
            data["params"]["secureContext"] = secure_context
        u = self._url("/chaincode")
        response = self._post(u, data=json.dumps(data))
        return self._result(response, True)