(self, params, **kwargs)
| 103 | return scim_list_parser |
| 104 | |
| 105 | def execute(self, params, **kwargs): |
| 106 | fmt = kwargs.get('format') or '' |
| 107 | headers = ['scim_id', 'node_name', 'node_id', 'prefix', 'status', 'last_synced'] |
| 108 | if fmt != 'json': |
| 109 | headers = [field_to_title(x) for x in headers] |
| 110 | |
| 111 | table = [] |
| 112 | if params.enterprise and 'scims' in params.enterprise: |
| 113 | for info in params.enterprise['scims']: |
| 114 | node_id = info['node_id'] |
| 115 | last_synced = info.get('last_synced') |
| 116 | if isinstance(last_synced, int): |
| 117 | dt = datetime.datetime.fromtimestamp(last_synced / 1000) |
| 118 | last_synced = dt.strftime('%c') |
| 119 | else: |
| 120 | last_synced = str(last_synced or '') |
| 121 | row = [info['scim_id'], self.get_node_path(params, node_id), node_id, |
| 122 | info.get('role_prefix') or '', info['status'], last_synced] |
| 123 | table.append(row) |
| 124 | return dump_report_data(table, headers=headers, fmt=fmt, filename=kwargs.get('output')) |
| 125 | |
| 126 | |
| 127 | class ScimCreateCommand(EnterpriseCommand): |
nothing calls this directly
no test coverage detected