mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-28 01:41:36 +00:00
Added option showitemcountonly to gam print domains
This commit is contained in:
@@ -3275,9 +3275,13 @@ gam delete domain <DomainName>
|
||||
|
||||
gam info domain [<DomainName>]
|
||||
[formatjson]
|
||||
gam print domains [todrive <ToDriveAttribute>*]
|
||||
gam print domains
|
||||
[todrive <ToDriveAttribute>*]
|
||||
[formatjson [quotechar <Character>]]
|
||||
gam show domains [formatjson]
|
||||
[showitemcountonly]
|
||||
gam show domains
|
||||
[formatjson]
|
||||
[showitemcountonly]
|
||||
|
||||
gam create|add domainalias|aliasdomain <DomainAlias> <DomainName>
|
||||
gam delete domainalias|aliasdomain <DomainAlias>
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
Merged GAM-Team version
|
||||
|
||||
6.77.17
|
||||
|
||||
Added option `showitemcountonly` to `gam print domains` that causes GAM to display the
|
||||
number of domains on stdout; no CSV file is written.
|
||||
|
||||
6.77.16
|
||||
|
||||
Fixed bug in `gam <UserTypeEntity> print filelist` that caused a trap.
|
||||
|
||||
@@ -16090,18 +16090,33 @@ def doInfoDomain():
|
||||
|
||||
DOMAIN_SORT_TITLES = ['domainName', 'parentDomainName', 'creationTime', 'type', 'verified']
|
||||
|
||||
# gam print domains [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]]
|
||||
# gam show domains [formatjson]
|
||||
# gam print domains [todrive <ToDriveAttribute>*]
|
||||
# [formatjson [quotechar <Character>]]
|
||||
# [showitemcountonly]
|
||||
# gam show domains
|
||||
# [formatjson]
|
||||
# [showitemcountonly]
|
||||
def doPrintShowDomains():
|
||||
cd = buildGAPIObject(API.DIRECTORY)
|
||||
csvPF = CSVPrintFile(['domainName'], DOMAIN_SORT_TITLES) if Act.csvFormat() else None
|
||||
FJQC = FormatJSONQuoteChar(csvPF)
|
||||
getTodriveFJQCOnly(csvPF, FJQC, True)
|
||||
showItemCountOnly = False
|
||||
while Cmd.ArgumentsRemaining():
|
||||
myarg = getArgument()
|
||||
if csvPF and myarg == 'todrive':
|
||||
csvPF.GetTodriveParameters()
|
||||
elif myarg == 'showitemcountonly':
|
||||
showItemCountOnly = True
|
||||
else:
|
||||
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
||||
try:
|
||||
domains = callGAPIitems(cd.domains(), 'list', 'domains',
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.NOT_FOUND, GAPI.FORBIDDEN],
|
||||
customer=GC.Values[GC.CUSTOMER_ID])
|
||||
count = len(domains)
|
||||
if showItemCountOnly:
|
||||
writeStdout(f'{count}\n')
|
||||
return
|
||||
i = 0
|
||||
for domain in domains:
|
||||
i += 1
|
||||
|
||||
Reference in New Issue
Block a user