MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / execute

Method execute

keepercommander/commands/scim.py:105–124  ·  view source on GitHub ↗
(self, params, **kwargs)

Source from the content-addressed store, hash-verified

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
127class ScimCreateCommand(EnterpriseCommand):

Callers

nothing calls this directly

Calls 4

field_to_titleFunction · 0.85
dump_report_dataFunction · 0.85
get_node_pathMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected