catocli 1.0.12__py3-none-any.whl → 1.0.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of catocli might be problematic. Click here for more details.
- build/lib/catocli/Utils/clidriver.py +117 -0
- build/lib/catocli/__init__.py +2 -0
- build/lib/catocli/__main__.py +12 -0
- build/lib/catocli/parsers/custom/__init__.py +47 -0
- build/lib/catocli/parsers/custom/customLib.py +70 -0
- build/lib/catocli/parsers/mutation_admin/__init__.py +51 -0
- build/lib/catocli/parsers/mutation_container/__init__.py +23 -0
- build/lib/catocli/parsers/mutation_policy/__init__.py +357 -0
- build/lib/catocli/parsers/mutation_site/__init__.py +219 -0
- build/lib/catocli/parsers/mutation_sites/__init__.py +219 -0
- build/lib/catocli/parsers/parserApiClient.py +309 -0
- build/lib/catocli/parsers/query_accountBySubdomain/__init__.py +17 -0
- build/lib/catocli/parsers/query_accountMetrics/__init__.py +17 -0
- build/lib/catocli/parsers/query_accountRoles/__init__.py +17 -0
- build/lib/catocli/parsers/query_accountSnapshot/__init__.py +17 -0
- build/lib/catocli/parsers/query_admin/__init__.py +17 -0
- build/lib/catocli/parsers/query_admins/__init__.py +17 -0
- build/lib/catocli/parsers/query_appStats/__init__.py +17 -0
- build/lib/catocli/parsers/query_appStatsTimeSeries/__init__.py +17 -0
- build/lib/catocli/parsers/query_auditFeed/__init__.py +17 -0
- build/lib/catocli/parsers/query_container/__init__.py +17 -0
- build/lib/catocli/parsers/query_entityLookup/__init__.py +17 -0
- build/lib/catocli/parsers/query_events/__init__.py +17 -0
- build/lib/catocli/parsers/query_eventsFeed/__init__.py +17 -0
- build/lib/catocli/parsers/query_eventsTimeSeries/__init__.py +17 -0
- build/lib/catocli/parsers/query_hardwareManagement/__init__.py +17 -0
- build/lib/catocli/parsers/query_licensing/__init__.py +17 -0
- build/lib/catocli/parsers/query_policy/__init__.py +17 -0
- build/lib/catocli/parsers/query_siteLocation/__init__.py +17 -0
- build/lib/catocli/parsers/query_subDomains/__init__.py +17 -0
- build/lib/catocli/parsers/query_xdr/__init__.py +37 -0
- build/lib/catocli/parsers/raw/__init__.py +9 -0
- build/lib/graphql_client/__init__.py +11 -0
- build/lib/graphql_client/api/__init__.py +3 -0
- build/lib/graphql_client/api/call_api.py +73 -0
- build/lib/graphql_client/api_client.py +192 -0
- build/lib/graphql_client/api_client_types.py +404 -0
- build/lib/graphql_client/configuration.py +230 -0
- build/lib/graphql_client/models/__init__.py +13 -0
- build/lib/graphql_client/models/no_schema.py +71 -0
- build/lib/schema/catolib.py +1016 -0
- build/lib/schema/importSchema.py +60 -0
- build/lib/vendor/certifi/__init__.py +4 -0
- build/lib/vendor/certifi/__main__.py +12 -0
- build/lib/vendor/certifi/core.py +114 -0
- build/lib/vendor/certifi/py.typed +0 -0
- build/lib/vendor/six.py +998 -0
- build/lib/vendor/urllib3/__init__.py +211 -0
- build/lib/vendor/urllib3/_base_connection.py +172 -0
- build/lib/vendor/urllib3/_collections.py +483 -0
- build/lib/vendor/urllib3/_request_methods.py +278 -0
- build/lib/vendor/urllib3/_version.py +16 -0
- build/lib/vendor/urllib3/connection.py +1033 -0
- build/lib/vendor/urllib3/connectionpool.py +1182 -0
- build/lib/vendor/urllib3/contrib/__init__.py +0 -0
- build/lib/vendor/urllib3/contrib/emscripten/__init__.py +18 -0
- build/lib/vendor/urllib3/contrib/emscripten/connection.py +254 -0
- build/lib/vendor/urllib3/contrib/emscripten/fetch.py +418 -0
- build/lib/vendor/urllib3/contrib/emscripten/request.py +22 -0
- build/lib/vendor/urllib3/contrib/emscripten/response.py +285 -0
- build/lib/vendor/urllib3/contrib/pyopenssl.py +552 -0
- build/lib/vendor/urllib3/contrib/socks.py +228 -0
- build/lib/vendor/urllib3/exceptions.py +321 -0
- build/lib/vendor/urllib3/fields.py +341 -0
- build/lib/vendor/urllib3/filepost.py +89 -0
- build/lib/vendor/urllib3/http2/__init__.py +53 -0
- build/lib/vendor/urllib3/http2/connection.py +356 -0
- build/lib/vendor/urllib3/http2/probe.py +87 -0
- build/lib/vendor/urllib3/poolmanager.py +637 -0
- build/lib/vendor/urllib3/py.typed +2 -0
- build/lib/vendor/urllib3/response.py +1265 -0
- build/lib/vendor/urllib3/util/__init__.py +42 -0
- build/lib/vendor/urllib3/util/connection.py +137 -0
- build/lib/vendor/urllib3/util/proxy.py +43 -0
- build/lib/vendor/urllib3/util/request.py +256 -0
- build/lib/vendor/urllib3/util/response.py +101 -0
- build/lib/vendor/urllib3/util/retry.py +533 -0
- build/lib/vendor/urllib3/util/ssl_.py +513 -0
- build/lib/vendor/urllib3/util/ssl_match_hostname.py +159 -0
- build/lib/vendor/urllib3/util/ssltransport.py +276 -0
- build/lib/vendor/urllib3/util/timeout.py +275 -0
- build/lib/vendor/urllib3/util/url.py +471 -0
- build/lib/vendor/urllib3/util/util.py +42 -0
- build/lib/vendor/urllib3/util/wait.py +124 -0
- catocli/__init__.py +1 -1
- catocli/parsers/custom/__init__.py +1 -1
- catocli/parsers/custom/customLib.py +1 -2
- catocli/parsers/mutation_site_updateSiteGeneralDetails/README.md +1 -1
- catocli/parsers/mutation_sites_updateSiteGeneralDetails/README.md +1 -1
- catocli/parsers/query_eventsFeed/README.md +1 -1
- {catocli-1.0.12.dist-info → catocli-1.0.13.dist-info}/METADATA +1 -1
- {catocli-1.0.12.dist-info → catocli-1.0.13.dist-info}/RECORD +104 -21
- {catocli-1.0.12.dist-info → catocli-1.0.13.dist-info}/top_level.txt +2 -0
- models/mutation.site.updateSiteGeneralDetails.json +57 -0
- models/mutation.sites.updateSiteGeneralDetails.json +57 -0
- models/query.accountMetrics.json +80 -0
- models/query.accountSnapshot.json +40 -0
- models/query.auditFeed.json +60 -0
- models/query.events.json +240 -0
- models/query.eventsFeed.json +60 -0
- models/query.eventsTimeSeries.json +180 -0
- vendor/.DS_Store +0 -0
- {catocli-1.0.12.dist-info → catocli-1.0.13.dist-info}/LICENSE +0 -0
- {catocli-1.0.12.dist-info → catocli-1.0.13.dist-info}/WHEEL +0 -0
- {catocli-1.0.12.dist-info → catocli-1.0.13.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
|
|
2
|
+
import os
|
|
3
|
+
import argparse
|
|
4
|
+
import json
|
|
5
|
+
import catocli
|
|
6
|
+
from graphql_client import Configuration
|
|
7
|
+
from graphql_client.api_client import ApiException
|
|
8
|
+
from ..parsers.parserApiClient import get_help
|
|
9
|
+
import sys
|
|
10
|
+
sys.path.insert(0, 'vendor')
|
|
11
|
+
import urllib3
|
|
12
|
+
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
13
|
+
if "CATO_TOKEN" not in os.environ:
|
|
14
|
+
print("Missing authentication, please set the CATO_TOKEN environment variable with your api key.")
|
|
15
|
+
exit()
|
|
16
|
+
CATO_TOKEN = os.getenv("CATO_TOKEN")
|
|
17
|
+
CATO_DEBUG = bool(os.getenv("CATO_DEBUG", False))
|
|
18
|
+
from ..parsers.raw import raw_parse
|
|
19
|
+
from ..parsers.custom import custom_parse
|
|
20
|
+
from ..parsers.query_siteLocation import query_siteLocation_parse
|
|
21
|
+
from ..parsers.mutation_admin import mutation_admin_parse
|
|
22
|
+
from ..parsers.mutation_container import mutation_container_parse
|
|
23
|
+
from ..parsers.mutation_policy import mutation_policy_parse
|
|
24
|
+
from ..parsers.mutation_site import mutation_site_parse
|
|
25
|
+
from ..parsers.mutation_sites import mutation_sites_parse
|
|
26
|
+
from ..parsers.query_accountBySubdomain import query_accountBySubdomain_parse
|
|
27
|
+
from ..parsers.query_accountMetrics import query_accountMetrics_parse
|
|
28
|
+
from ..parsers.query_accountRoles import query_accountRoles_parse
|
|
29
|
+
from ..parsers.query_accountSnapshot import query_accountSnapshot_parse
|
|
30
|
+
from ..parsers.query_admin import query_admin_parse
|
|
31
|
+
from ..parsers.query_admins import query_admins_parse
|
|
32
|
+
from ..parsers.query_appStats import query_appStats_parse
|
|
33
|
+
from ..parsers.query_appStatsTimeSeries import query_appStatsTimeSeries_parse
|
|
34
|
+
from ..parsers.query_auditFeed import query_auditFeed_parse
|
|
35
|
+
from ..parsers.query_container import query_container_parse
|
|
36
|
+
from ..parsers.query_entityLookup import query_entityLookup_parse
|
|
37
|
+
from ..parsers.query_events import query_events_parse
|
|
38
|
+
from ..parsers.query_eventsFeed import query_eventsFeed_parse
|
|
39
|
+
from ..parsers.query_eventsTimeSeries import query_eventsTimeSeries_parse
|
|
40
|
+
from ..parsers.query_hardwareManagement import query_hardwareManagement_parse
|
|
41
|
+
from ..parsers.query_licensing import query_licensing_parse
|
|
42
|
+
from ..parsers.query_policy import query_policy_parse
|
|
43
|
+
from ..parsers.query_subDomains import query_subDomains_parse
|
|
44
|
+
from ..parsers.query_xdr import query_xdr_parse
|
|
45
|
+
|
|
46
|
+
configuration = Configuration()
|
|
47
|
+
configuration.verify_ssl = False
|
|
48
|
+
configuration.api_key["x-api-key"] = CATO_TOKEN
|
|
49
|
+
configuration.host = "{}".format(catocli.__cato_host__)
|
|
50
|
+
configuration.debug = CATO_DEBUG
|
|
51
|
+
configuration.version = "{}".format(catocli.__version__)
|
|
52
|
+
|
|
53
|
+
parser = argparse.ArgumentParser(prog='catocli', usage='%(prog)s <operationType> <operationName> [options]', description="CLI for query on CATO via API.")
|
|
54
|
+
parser.add_argument('--version', action='version', version=catocli.__version__)
|
|
55
|
+
subparsers = parser.add_subparsers()
|
|
56
|
+
custom_parsers = custom_parse(subparsers)
|
|
57
|
+
raw_parsers = subparsers.add_parser('raw', help='Raw GraphQL', usage=get_help("raw"))
|
|
58
|
+
raw_parser = raw_parse(raw_parsers)
|
|
59
|
+
query_parser = subparsers.add_parser('query', help='Query', usage='catocli query <operationName> [options]')
|
|
60
|
+
query_subparsers = query_parser.add_subparsers(description='valid subcommands', help='additional help')
|
|
61
|
+
query_siteLocation_parser = query_siteLocation_parse(query_subparsers)
|
|
62
|
+
mutation_parser = subparsers.add_parser('mutation', help='Mutation', usage='catocli mutation <operationName> [options]')
|
|
63
|
+
mutation_subparsers = mutation_parser.add_subparsers(description='valid subcommands', help='additional help')
|
|
64
|
+
|
|
65
|
+
mutation_admin_parser = mutation_admin_parse(mutation_subparsers)
|
|
66
|
+
mutation_container_parser = mutation_container_parse(mutation_subparsers)
|
|
67
|
+
mutation_policy_parser = mutation_policy_parse(mutation_subparsers)
|
|
68
|
+
mutation_site_parser = mutation_site_parse(mutation_subparsers)
|
|
69
|
+
mutation_sites_parser = mutation_sites_parse(mutation_subparsers)
|
|
70
|
+
query_accountBySubdomain_parser = query_accountBySubdomain_parse(query_subparsers)
|
|
71
|
+
query_accountMetrics_parser = query_accountMetrics_parse(query_subparsers)
|
|
72
|
+
query_accountRoles_parser = query_accountRoles_parse(query_subparsers)
|
|
73
|
+
query_accountSnapshot_parser = query_accountSnapshot_parse(query_subparsers)
|
|
74
|
+
query_admin_parser = query_admin_parse(query_subparsers)
|
|
75
|
+
query_admins_parser = query_admins_parse(query_subparsers)
|
|
76
|
+
query_appStats_parser = query_appStats_parse(query_subparsers)
|
|
77
|
+
query_appStatsTimeSeries_parser = query_appStatsTimeSeries_parse(query_subparsers)
|
|
78
|
+
query_auditFeed_parser = query_auditFeed_parse(query_subparsers)
|
|
79
|
+
query_container_parser = query_container_parse(query_subparsers)
|
|
80
|
+
query_entityLookup_parser = query_entityLookup_parse(query_subparsers)
|
|
81
|
+
query_events_parser = query_events_parse(query_subparsers)
|
|
82
|
+
query_eventsFeed_parser = query_eventsFeed_parse(query_subparsers)
|
|
83
|
+
query_eventsTimeSeries_parser = query_eventsTimeSeries_parse(query_subparsers)
|
|
84
|
+
query_hardwareManagement_parser = query_hardwareManagement_parse(query_subparsers)
|
|
85
|
+
query_licensing_parser = query_licensing_parse(query_subparsers)
|
|
86
|
+
query_policy_parser = query_policy_parse(query_subparsers)
|
|
87
|
+
query_subDomains_parser = query_subDomains_parse(query_subparsers)
|
|
88
|
+
query_xdr_parser = query_xdr_parse(query_subparsers)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def main(args=None):
|
|
92
|
+
args = parser.parse_args(args=args)
|
|
93
|
+
try:
|
|
94
|
+
CATO_ACCOUNT_ID = os.getenv("CATO_ACCOUNT_ID")
|
|
95
|
+
if args.func.__name__!="createRawRequest":
|
|
96
|
+
if CATO_ACCOUNT_ID==None and args.accountID==None:
|
|
97
|
+
print("Missing accountID, please specify an accountID:\n")
|
|
98
|
+
print('Option 1: Set the CATO_ACCOUNT_ID environment variable with the value of your account ID.')
|
|
99
|
+
print('export CATO_ACCOUNT_ID="12345"\n')
|
|
100
|
+
print("Option 2: Override the accountID value as a cli argument, example:")
|
|
101
|
+
print('catocli <operationType> <operationName> -accountID=12345 <json>')
|
|
102
|
+
print("catocli query entityLookup -accountID=12345 '{\"type\":\"country\"}'\n")
|
|
103
|
+
exit()
|
|
104
|
+
elif args.accountID!=None:
|
|
105
|
+
configuration.accountID = args.accountID
|
|
106
|
+
else:
|
|
107
|
+
configuration.accountID = CATO_ACCOUNT_ID
|
|
108
|
+
response = args.func(args, configuration)
|
|
109
|
+
|
|
110
|
+
if type(response) == ApiException:
|
|
111
|
+
print("ERROR! Status code: {}".format(response.status))
|
|
112
|
+
print(response)
|
|
113
|
+
else:
|
|
114
|
+
if response!=None:
|
|
115
|
+
print(json.dumps(response[0], sort_keys=True, indent=4))
|
|
116
|
+
except AttributeError:
|
|
117
|
+
print('Missing arguments. Usage: catocli <operation> -h')
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
import catocli.parsers.custom.customLib as customLib
|
|
3
|
+
|
|
4
|
+
def custom_parse(subparsers):
|
|
5
|
+
entityTypes = ["account","admin","allocatedIP","any","availablePooledUsage","availableSiteUsage","dhcpRelayGroup","groupSubscription","host","lanFirewall","localRouting","location","mailingListSubscription","networkInterface","portProtocol","simpleService","site","siteRange","timezone","vpnUser","webhookSubscription"]
|
|
6
|
+
entity_parser = subparsers.add_parser('entity', help='Entity Lookup', usage='catocli entity <operationName> [options]')
|
|
7
|
+
entity_subparsers = entity_parser.add_subparsers(description='valid subcommands', help='additional help')
|
|
8
|
+
|
|
9
|
+
for entity in entityTypes:
|
|
10
|
+
item_parser = entity_subparsers.add_parser(entity, help="entityLookup() for type: "+entity, usage='catocli entity '+entity+' <operationName> [options]')
|
|
11
|
+
item_subparsers = item_parser.add_subparsers(description='valid subcommands', help='additional help')
|
|
12
|
+
|
|
13
|
+
item_list_parser = item_subparsers.add_parser('list',
|
|
14
|
+
help='entity '+entity+' list',
|
|
15
|
+
usage=get_help_custom("entity_"+entity+"_list"))
|
|
16
|
+
|
|
17
|
+
item_list_parser.add_argument('-accountID', help='The Account ID.')
|
|
18
|
+
item_list_parser.add_argument('-s', help='Search string', default='', nargs='?')
|
|
19
|
+
item_list_parser.add_argument('-f', default="csv", choices=["json","csv"], nargs='?',
|
|
20
|
+
help='Specify format for output')
|
|
21
|
+
item_list_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
22
|
+
help='Print test request preview without sending api call')
|
|
23
|
+
item_list_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
24
|
+
help='Verbose output')
|
|
25
|
+
item_list_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
26
|
+
help='Pretty print')
|
|
27
|
+
|
|
28
|
+
item_list_parser.set_defaults(func=customLib.entityTypeList,operation_name=entity)
|
|
29
|
+
|
|
30
|
+
def get_help_custom(path):
|
|
31
|
+
matchCmd = "catocli "+path.replace("_"," ")
|
|
32
|
+
import os
|
|
33
|
+
pwd = os.path.dirname(__file__)
|
|
34
|
+
# doc = path+"/README.md"
|
|
35
|
+
abs_path = os.path.join(pwd, "README.md")
|
|
36
|
+
new_line = "\nEXAMPLES:\n"
|
|
37
|
+
lines = open(abs_path, "r").readlines()
|
|
38
|
+
for line in lines:
|
|
39
|
+
if f"{matchCmd}" in line:
|
|
40
|
+
clean_line = line.replace("<br /><br />", "").replace("`","")
|
|
41
|
+
new_line += f"{clean_line}\n"
|
|
42
|
+
# matchArg = path.replace("_",".")
|
|
43
|
+
# for line in lines:
|
|
44
|
+
# if f"`{matchArg}" in line:
|
|
45
|
+
# clean_line = line.replace("<br /><br />", "").replace("`","")
|
|
46
|
+
# new_line += f"{clean_line}\n"
|
|
47
|
+
return new_line
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from graphql_client.api.call_api import ApiClient, CallApi
|
|
3
|
+
from graphql_client.api_client import ApiException
|
|
4
|
+
import logging
|
|
5
|
+
from ..parserApiClient import validateArgs
|
|
6
|
+
|
|
7
|
+
def entityTypeList(args, configuration):
|
|
8
|
+
params = vars(args)
|
|
9
|
+
operation = {
|
|
10
|
+
"operationArgs": {
|
|
11
|
+
"accountID": {
|
|
12
|
+
"name": "accountID",
|
|
13
|
+
"required": True,
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
variablesObj = { "accountID": (params.get("accountID") if params.get("accountID") else params.get("accountId"))}
|
|
18
|
+
|
|
19
|
+
instance = CallApi(ApiClient(configuration))
|
|
20
|
+
operationName = params["operation_name"]
|
|
21
|
+
query = '''query entityLookup ( $type:EntityType! $accountID:ID! $search:String ) {
|
|
22
|
+
entityLookup ( accountID:$accountID type:$type search:$search ) {
|
|
23
|
+
'''+params["operation_name"]+'''s: items {
|
|
24
|
+
description
|
|
25
|
+
'''+params["operation_name"]+''': entity {
|
|
26
|
+
id
|
|
27
|
+
name
|
|
28
|
+
type
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}'''
|
|
33
|
+
body = {
|
|
34
|
+
"query": query,
|
|
35
|
+
"operationName": "entityLookup",
|
|
36
|
+
"variables": {
|
|
37
|
+
"accountID": configuration.accountID,
|
|
38
|
+
"type": params["operation_name"],
|
|
39
|
+
"search": (params.get("s") if params.get("s")!=None else "")
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
isOk, invalidVars, message = validateArgs(variablesObj,operation)
|
|
44
|
+
if isOk==True:
|
|
45
|
+
if params["t"]==True:
|
|
46
|
+
if params["p"]==True:
|
|
47
|
+
print(json.dumps(body,indent=2,sort_keys=True).replace("\\n", "\n").replace("\\t", " "))
|
|
48
|
+
else:
|
|
49
|
+
print(json.dumps(body).replace("\\n", " ").replace("\\t", " ").replace(" "," ").replace(" "," "))
|
|
50
|
+
return None
|
|
51
|
+
else:
|
|
52
|
+
try:
|
|
53
|
+
response = instance.call_api(body,params)
|
|
54
|
+
if params["f"]=="json":
|
|
55
|
+
if params["p"]==True:
|
|
56
|
+
print(json.dumps(response[0].get("data").get("entityLookup").get(params["operation_name"]+"s"),indent=2,sort_keys=True).replace("\\n", "\n").replace("\\t", " "))
|
|
57
|
+
else:
|
|
58
|
+
print(json.dumps(response[0].get("data").get("entityLookup").get(params["operation_name"]+"s")))
|
|
59
|
+
else:
|
|
60
|
+
if len(response[0].get("data").get("entityLookup").get(params["operation_name"]+"s"))==0:
|
|
61
|
+
print("No results found")
|
|
62
|
+
else:
|
|
63
|
+
print("id,name,type,description")
|
|
64
|
+
for site in response[0].get("data").get("entityLookup").get(params["operation_name"]+"s"):
|
|
65
|
+
print(site.get(params["operation_name"]).get('id')+","+site.get(params["operation_name"]).get('name')+","+site.get(params["operation_name"]).get('type')+","+site.get('description'))
|
|
66
|
+
except ApiException as e:
|
|
67
|
+
return e
|
|
68
|
+
else:
|
|
69
|
+
print("ERROR: "+message,", ".join(invalidVars))
|
|
70
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
from ..parserApiClient import createRequest, get_help
|
|
3
|
+
|
|
4
|
+
def mutation_admin_parse(mutation_subparsers):
|
|
5
|
+
mutation_admin_parser = mutation_subparsers.add_parser('admin',
|
|
6
|
+
help='admin() mutation operation',
|
|
7
|
+
usage=get_help("mutation_admin"))
|
|
8
|
+
|
|
9
|
+
mutation_admin_subparsers = mutation_admin_parser.add_subparsers()
|
|
10
|
+
|
|
11
|
+
mutation_admin_addAdmin_parser = mutation_admin_subparsers.add_parser('addAdmin',
|
|
12
|
+
help='addAdmin() admin operation',
|
|
13
|
+
usage=get_help("mutation_admin_addAdmin"))
|
|
14
|
+
|
|
15
|
+
mutation_admin_addAdmin_parser.add_argument('json', help='Variables in JSON format.')
|
|
16
|
+
mutation_admin_addAdmin_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
17
|
+
mutation_admin_addAdmin_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
18
|
+
help='Print test request preview without sending api call')
|
|
19
|
+
mutation_admin_addAdmin_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
20
|
+
help='Verbose output')
|
|
21
|
+
mutation_admin_addAdmin_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
22
|
+
help='Pretty print')
|
|
23
|
+
mutation_admin_addAdmin_parser.set_defaults(func=createRequest,operation_name='mutation.admin.addAdmin')
|
|
24
|
+
|
|
25
|
+
mutation_admin_removeAdmin_parser = mutation_admin_subparsers.add_parser('removeAdmin',
|
|
26
|
+
help='removeAdmin() admin operation',
|
|
27
|
+
usage=get_help("mutation_admin_removeAdmin"))
|
|
28
|
+
|
|
29
|
+
mutation_admin_removeAdmin_parser.add_argument('json', help='Variables in JSON format.')
|
|
30
|
+
mutation_admin_removeAdmin_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
31
|
+
mutation_admin_removeAdmin_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
32
|
+
help='Print test request preview without sending api call')
|
|
33
|
+
mutation_admin_removeAdmin_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
34
|
+
help='Verbose output')
|
|
35
|
+
mutation_admin_removeAdmin_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
36
|
+
help='Pretty print')
|
|
37
|
+
mutation_admin_removeAdmin_parser.set_defaults(func=createRequest,operation_name='mutation.admin.removeAdmin')
|
|
38
|
+
|
|
39
|
+
mutation_admin_updateAdmin_parser = mutation_admin_subparsers.add_parser('updateAdmin',
|
|
40
|
+
help='updateAdmin() admin operation',
|
|
41
|
+
usage=get_help("mutation_admin_updateAdmin"))
|
|
42
|
+
|
|
43
|
+
mutation_admin_updateAdmin_parser.add_argument('json', help='Variables in JSON format.')
|
|
44
|
+
mutation_admin_updateAdmin_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
45
|
+
mutation_admin_updateAdmin_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
46
|
+
help='Print test request preview without sending api call')
|
|
47
|
+
mutation_admin_updateAdmin_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
48
|
+
help='Verbose output')
|
|
49
|
+
mutation_admin_updateAdmin_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
50
|
+
help='Pretty print')
|
|
51
|
+
mutation_admin_updateAdmin_parser.set_defaults(func=createRequest,operation_name='mutation.admin.updateAdmin')
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
from ..parserApiClient import createRequest, get_help
|
|
3
|
+
|
|
4
|
+
def mutation_container_parse(mutation_subparsers):
|
|
5
|
+
mutation_container_parser = mutation_subparsers.add_parser('container',
|
|
6
|
+
help='container() mutation operation',
|
|
7
|
+
usage=get_help("mutation_container"))
|
|
8
|
+
|
|
9
|
+
mutation_container_subparsers = mutation_container_parser.add_subparsers()
|
|
10
|
+
|
|
11
|
+
mutation_container_delete_parser = mutation_container_subparsers.add_parser('delete',
|
|
12
|
+
help='delete() container operation',
|
|
13
|
+
usage=get_help("mutation_container_delete"))
|
|
14
|
+
|
|
15
|
+
mutation_container_delete_parser.add_argument('json', help='Variables in JSON format.')
|
|
16
|
+
mutation_container_delete_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
17
|
+
mutation_container_delete_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
18
|
+
help='Print test request preview without sending api call')
|
|
19
|
+
mutation_container_delete_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
20
|
+
help='Verbose output')
|
|
21
|
+
mutation_container_delete_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
22
|
+
help='Pretty print')
|
|
23
|
+
mutation_container_delete_parser.set_defaults(func=createRequest,operation_name='mutation.container.delete')
|