Bulk update/create Resources from Excel #11
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bulk update/create Resources from Excel
Functionality: a means to allow admins to bulk update/create resources from excel.
Example:
./tg export
- by default, exports the admin's tenant into an xlsx file./tg import -f <xlsx-file>
- will import the saved configuration changes and attempt to either (a) update the existing resource or (b) create a new resourceExplanation of changes:
TwingateApiClient.mjs:
groups
andserviceAccounts
is now deprecated for theaccess
connection, there doesn't seem to be consistency across the API so I left as is (FRs that need to be requested below).createResource()
for expanded functionality with the mutationupdateResource()
to allow bulk update functionality with the mutationsmallUtilFuncs.mjs:
readerFromStreamReader
seems to be deprecated, temporarily updated module to the last working version (not familiar enough with a path forward - @chenbishop?)genFileNameFromNetworkName()
to accommodate new output folder so import/export files aren't dropped in main directoryimportCmd.mjs:
updateResource()
createResource()
outputDir
so import files aren't dropped in main directoryexportCmd.mjs:
outputDir
so export files aren't dropped in main directoryInstructions/Limitations & FRs needed:
Instructions/Limitations:
name
, (b)remoteNetworkLabel
, and (c)addressValue
specified.-
serviceAccounts
will not get updated as there is currently no argument available forresourceCreate
mutation.-
isActive
will not get updated as there is currently no argument available forresourceCreate
.name
, (b)remoteNetworkLabel
, and (c)addressValue
are specified.-
serviceAccounts
will not get updated as there is currently no argument available forresourceUpdate
.FRs needed:
resourceUpdate
MutationserviceAccounts ([])
- or the newaccess{serviceAccounts, groupIds}
resourceCreate
MutationisActive (boolean)
serviceAccounts ([])
- or goes off the newaccess{serviceAccounts, groupIds}