Invoke an operation and format the response. :type service_name: str :param service_name: The name of the service. Note this is the service name, not the endpoint prefix (e.g. ``ses`` not ``email``). :type operation_name: str :param operation_name: The
(self, service_name, operation_name, parameters, parsed_globals)
| 1061 | self._output_stream_factory = OutputStreamFactory(session) |
| 1062 | |
| 1063 | def invoke(self, service_name, operation_name, parameters, parsed_globals): |
| 1064 | """Invoke an operation and format the response. |
| 1065 | |
| 1066 | :type service_name: str |
| 1067 | :param service_name: The name of the service. Note this is the |
| 1068 | service name, not the endpoint prefix (e.g. ``ses`` not ``email``). |
| 1069 | |
| 1070 | :type operation_name: str |
| 1071 | :param operation_name: The operation name of the service. The casing |
| 1072 | of the operation name should match the exact casing used by the |
| 1073 | service, e.g. ``DescribeInstances``, not ``describe-instances`` or |
| 1074 | ``describe_instances``. |
| 1075 | |
| 1076 | :type parameters: dict |
| 1077 | :param parameters: The parameters for the operation call. Again, |
| 1078 | these values have the same casing used by the service. |
| 1079 | |
| 1080 | :type parsed_globals: Namespace |
| 1081 | :param parsed_globals: The parsed globals from the command line. |
| 1082 | |
| 1083 | :return: None, the result is displayed through a formatter, but no |
| 1084 | value is returned. |
| 1085 | |
| 1086 | """ |
| 1087 | client = self._session.create_client( |
| 1088 | service_name, |
| 1089 | region_name=parsed_globals.region, |
| 1090 | endpoint_url=parsed_globals.endpoint_url, |
| 1091 | verify=parsed_globals.verify_ssl, |
| 1092 | ) |
| 1093 | response = self._make_client_call( |
| 1094 | client, operation_name, parameters, parsed_globals |
| 1095 | ) |
| 1096 | self._display_response(operation_name, response, parsed_globals) |
| 1097 | return 0 |
| 1098 | |
| 1099 | def _make_client_call( |
| 1100 | self, client, operation_name, parameters, parsed_globals |