| 147 | console.log('INFO: Collecting metadata. This may take several minutes...'); |
| 148 | |
| 149 | const initializeFile = function(file, type, testQuery, resource) { |
| 150 | if (!file['access']) file['access'] = {}; |
| 151 | if (!file['pre_remediate']) file['pre_remediate'] = {}; |
| 152 | if (!file['pre_remediate']['actions']) file['pre_remediate']['actions'] = {}; |
| 153 | if (!file['pre_remediate']['actions'][testQuery]) file['pre_remediate']['actions'][testQuery] = {}; |
| 154 | if (!file['pre_remediate']['actions'][testQuery][resource]) file['pre_remediate']['actions'][testQuery][resource] = {}; |
| 155 | if (!file['post_remediate']) file['post_remediate'] = {}; |
| 156 | if (!file['post_remediate']['actions']) file['post_remediate']['actions'] = {}; |
| 157 | if (!file['post_remediate']['actions'][testQuery]) file['post_remediate']['actions'][testQuery] = {}; |
| 158 | if (!file['post_remediate']['actions'][testQuery][resource]) file['post_remediate']['actions'][testQuery][resource] = {}; |
| 159 | if (!file['remediate']) file['remediate'] = {}; |
| 160 | if (!file['remediate']['actions']) file['remediate']['actions'] = {}; |
| 161 | if (!file['remediate']['actions'][testQuery]) file['remediate']['actions'][testQuery] = {}; |
| 162 | if (!file['remediate']['actions'][testQuery][resource]) file['remediate']['actions'][testQuery][resource] = {}; |
| 163 | |
| 164 | return file; |
| 165 | }; |
| 166 | |
| 167 | // STEP 2 - Collect API Metadata from Service Providers |
| 168 | collector(cloudConfig, { |