catocli 1.0.13__py3-none-any.whl → 1.0.15__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.
- catocli/Utils/clidriver.py +15 -2
- catocli/__init__.py +1 -1
- catocli/parsers/custom/customLib.py +3 -1
- catocli/parsers/mutation_accountManagement/README.md +7 -0
- catocli/parsers/mutation_accountManagement/__init__.py +51 -0
- catocli/parsers/mutation_accountManagement_addAccount/README.md +17 -0
- catocli/parsers/mutation_accountManagement_removeAccount/README.md +16 -0
- catocli/parsers/mutation_accountManagement_updateAccount/README.md +17 -0
- catocli/parsers/mutation_admin_addAdmin/README.md +2 -2
- catocli/parsers/mutation_admin_updateAdmin/README.md +2 -2
- catocli/parsers/mutation_container_delete/README.md +2 -2
- catocli/parsers/mutation_policy_internetFirewall_addRule/README.md +3 -3
- catocli/parsers/mutation_policy_internetFirewall_addSection/README.md +3 -3
- catocli/parsers/mutation_policy_internetFirewall_createPolicyRevision/README.md +3 -3
- catocli/parsers/mutation_policy_internetFirewall_discardPolicyRevision/README.md +3 -3
- catocli/parsers/mutation_policy_internetFirewall_moveRule/README.md +3 -3
- catocli/parsers/mutation_policy_internetFirewall_moveSection/README.md +3 -3
- catocli/parsers/mutation_policy_internetFirewall_publishPolicyRevision/README.md +3 -3
- catocli/parsers/mutation_policy_internetFirewall_removeRule/README.md +3 -3
- catocli/parsers/mutation_policy_internetFirewall_removeSection/README.md +3 -3
- catocli/parsers/mutation_policy_internetFirewall_updatePolicy/README.md +3 -3
- catocli/parsers/mutation_policy_internetFirewall_updateRule/README.md +3 -3
- catocli/parsers/mutation_policy_internetFirewall_updateSection/README.md +3 -3
- catocli/parsers/mutation_policy_wanFirewall_addRule/README.md +3 -3
- catocli/parsers/mutation_policy_wanFirewall_addSection/README.md +3 -3
- catocli/parsers/mutation_policy_wanFirewall_createPolicyRevision/README.md +3 -3
- catocli/parsers/mutation_policy_wanFirewall_discardPolicyRevision/README.md +3 -3
- catocli/parsers/mutation_policy_wanFirewall_moveRule/README.md +3 -3
- catocli/parsers/mutation_policy_wanFirewall_moveSection/README.md +3 -3
- catocli/parsers/mutation_policy_wanFirewall_publishPolicyRevision/README.md +3 -3
- catocli/parsers/mutation_policy_wanFirewall_removeRule/README.md +3 -3
- catocli/parsers/mutation_policy_wanFirewall_removeSection/README.md +3 -3
- catocli/parsers/mutation_policy_wanFirewall_updatePolicy/README.md +3 -3
- catocli/parsers/mutation_policy_wanFirewall_updateRule/README.md +3 -3
- catocli/parsers/mutation_policy_wanFirewall_updateSection/README.md +3 -3
- catocli/parsers/mutation_site/__init__.py +14 -0
- catocli/parsers/mutation_site_addIpsecIkeV2Site/README.md +2 -2
- catocli/parsers/mutation_site_addIpsecIkeV2SiteTunnels/README.md +2 -2
- catocli/parsers/mutation_site_addNetworkRange/README.md +2 -2
- catocli/parsers/mutation_site_addSocketSite/README.md +2 -2
- catocli/parsers/mutation_site_addStaticHost/README.md +2 -2
- catocli/parsers/mutation_site_removeIpsecIkeV2SiteTunnels/README.md +18 -0
- catocli/parsers/mutation_site_updateHa/README.md +2 -2
- catocli/parsers/mutation_site_updateIpsecIkeV2SiteGeneralDetails/README.md +2 -2
- catocli/parsers/mutation_site_updateIpsecIkeV2SiteTunnels/README.md +2 -2
- catocli/parsers/mutation_site_updateNetworkRange/README.md +2 -2
- catocli/parsers/mutation_site_updateSiteGeneralDetails/README.md +2 -2
- catocli/parsers/mutation_site_updateSocketInterface/README.md +2 -2
- catocli/parsers/mutation_site_updateStaticHost/README.md +2 -2
- catocli/parsers/mutation_sites/__init__.py +14 -0
- catocli/parsers/mutation_sites_addIpsecIkeV2Site/README.md +2 -2
- catocli/parsers/mutation_sites_addIpsecIkeV2SiteTunnels/README.md +2 -2
- catocli/parsers/mutation_sites_addNetworkRange/README.md +2 -2
- catocli/parsers/mutation_sites_addSocketSite/README.md +2 -2
- catocli/parsers/mutation_sites_addStaticHost/README.md +2 -2
- catocli/parsers/mutation_sites_removeIpsecIkeV2SiteTunnels/README.md +18 -0
- catocli/parsers/mutation_sites_updateHa/README.md +2 -2
- catocli/parsers/mutation_sites_updateIpsecIkeV2SiteGeneralDetails/README.md +2 -2
- catocli/parsers/mutation_sites_updateIpsecIkeV2SiteTunnels/README.md +2 -2
- catocli/parsers/mutation_sites_updateNetworkRange/README.md +2 -2
- catocli/parsers/mutation_sites_updateSiteGeneralDetails/README.md +2 -2
- catocli/parsers/mutation_sites_updateSocketInterface/README.md +2 -2
- catocli/parsers/mutation_sites_updateStaticHost/README.md +2 -2
- catocli/parsers/parserApiClient.py +7 -4
- catocli/parsers/query_accountManagement/README.md +16 -0
- catocli/parsers/query_accountManagement/__init__.py +17 -0
- catocli/parsers/query_admins/README.md +2 -2
- catocli/parsers/query_appStats/README.md +5 -5
- catocli/parsers/query_appStatsTimeSeries/README.md +4 -4
- catocli/parsers/query_auditFeed/README.md +2 -2
- catocli/parsers/query_container/README.md +8 -8
- catocli/parsers/query_entityLookup/README.md +6 -6
- catocli/parsers/query_events/README.md +5 -5
- catocli/parsers/query_eventsFeed/README.md +2 -2
- catocli/parsers/query_eventsTimeSeries/README.md +4 -4
- catocli/parsers/query_hardwareManagement/README.md +2 -2
- catocli/parsers/query_policy/README.md +3 -3
- catocli/parsers/query_xdr_stories/README.md +2 -2
- {catocli-1.0.13.dist-info → catocli-1.0.15.dist-info}/METADATA +1 -1
- catocli-1.0.15.dist-info/RECORD +275 -0
- {catocli-1.0.13.dist-info → catocli-1.0.15.dist-info}/top_level.txt +0 -2
- graphql_client/api_client_types.py +4 -0
- models/mutation.accountManagement.addAccount.json +908 -0
- models/mutation.accountManagement.removeAccount.json +446 -0
- models/mutation.accountManagement.updateAccount.json +524 -0
- models/mutation.admin.addAdmin.json +103 -103
- models/mutation.admin.removeAdmin.json +3 -3
- models/mutation.admin.updateAdmin.json +121 -121
- models/mutation.container.delete.json +67 -67
- models/mutation.policy.internetFirewall.addRule.json +2497 -1889
- models/mutation.policy.internetFirewall.addSection.json +92 -92
- models/mutation.policy.internetFirewall.createPolicyRevision.json +734 -546
- models/mutation.policy.internetFirewall.discardPolicyRevision.json +734 -546
- models/mutation.policy.internetFirewall.moveRule.json +723 -535
- models/mutation.policy.internetFirewall.moveSection.json +85 -85
- models/mutation.policy.internetFirewall.publishPolicyRevision.json +734 -546
- models/mutation.policy.internetFirewall.removeRule.json +710 -522
- models/mutation.policy.internetFirewall.removeSection.json +72 -72
- models/mutation.policy.internetFirewall.updatePolicy.json +734 -546
- models/mutation.policy.internetFirewall.updateRule.json +2476 -1885
- models/mutation.policy.internetFirewall.updateSection.json +85 -85
- models/mutation.policy.wanFirewall.addRule.json +2577 -1225
- models/mutation.policy.wanFirewall.addSection.json +92 -92
- models/mutation.policy.wanFirewall.createPolicyRevision.json +800 -455
- models/mutation.policy.wanFirewall.discardPolicyRevision.json +800 -455
- models/mutation.policy.wanFirewall.moveRule.json +789 -444
- models/mutation.policy.wanFirewall.moveSection.json +85 -85
- models/mutation.policy.wanFirewall.publishPolicyRevision.json +800 -455
- models/mutation.policy.wanFirewall.removeRule.json +776 -431
- models/mutation.policy.wanFirewall.removeSection.json +72 -72
- models/mutation.policy.wanFirewall.updatePolicy.json +800 -455
- models/mutation.policy.wanFirewall.updateRule.json +2597 -1265
- models/mutation.policy.wanFirewall.updateSection.json +85 -85
- models/mutation.site.addIpsecIkeV2Site.json +43 -43
- models/mutation.site.addIpsecIkeV2SiteTunnels.json +505 -102
- models/mutation.site.addNetworkRange.json +53 -53
- models/mutation.site.addSocketSite.json +43 -43
- models/mutation.site.addStaticHost.json +33 -33
- models/mutation.site.removeIpsecIkeV2SiteTunnels.json +861 -0
- models/mutation.site.removeNetworkRange.json +3 -3
- models/mutation.site.removeSite.json +3 -3
- models/mutation.site.removeStaticHost.json +3 -3
- models/mutation.site.updateHa.json +54 -54
- models/mutation.site.updateIpsecIkeV2SiteGeneralDetails.json +79 -79
- models/mutation.site.updateIpsecIkeV2SiteTunnels.json +123 -123
- models/mutation.site.updateNetworkRange.json +74 -74
- models/mutation.site.updateSiteGeneralDetails.json +73 -73
- models/mutation.site.updateSocketInterface.json +282 -282
- models/mutation.site.updateStaticHost.json +54 -54
- models/mutation.sites.addIpsecIkeV2Site.json +43 -43
- models/mutation.sites.addIpsecIkeV2SiteTunnels.json +505 -102
- models/mutation.sites.addNetworkRange.json +53 -53
- models/mutation.sites.addSocketSite.json +43 -43
- models/mutation.sites.addStaticHost.json +33 -33
- models/mutation.sites.removeIpsecIkeV2SiteTunnels.json +861 -0
- models/mutation.sites.removeNetworkRange.json +3 -3
- models/mutation.sites.removeSite.json +3 -3
- models/mutation.sites.removeStaticHost.json +3 -3
- models/mutation.sites.updateHa.json +54 -54
- models/mutation.sites.updateIpsecIkeV2SiteGeneralDetails.json +79 -79
- models/mutation.sites.updateIpsecIkeV2SiteTunnels.json +123 -123
- models/mutation.sites.updateNetworkRange.json +74 -74
- models/mutation.sites.updateSiteGeneralDetails.json +73 -73
- models/mutation.sites.updateSocketInterface.json +282 -282
- models/mutation.sites.updateStaticHost.json +54 -54
- models/query.accountManagement.json +355 -0
- models/query.accountMetrics.json +235 -235
- models/query.accountRoles.json +3 -3
- models/query.accountSnapshot.json +278 -118
- models/query.admin.json +24 -24
- models/query.admins.json +138 -138
- models/query.appStats.json +92 -92
- models/query.appStatsTimeSeries.json +78 -78
- models/query.auditFeed.json +77 -77
- models/query.container.json +192 -192
- models/query.entityLookup.json +154 -154
- models/query.events.json +54 -54
- models/query.eventsFeed.json +38 -38
- models/query.eventsTimeSeries.json +78 -78
- models/query.hardwareManagement.json +125 -125
- models/query.licensing.json +933 -249
- models/query.policy.json +1502 -970
- models/query.xdr.stories.json +842 -842
- models/query.xdr.story.json +610 -610
- schema/catolib.py +12 -13
- build/lib/catocli/Utils/clidriver.py +0 -117
- build/lib/catocli/__init__.py +0 -2
- build/lib/catocli/__main__.py +0 -12
- build/lib/catocli/parsers/custom/__init__.py +0 -47
- build/lib/catocli/parsers/custom/customLib.py +0 -70
- build/lib/catocli/parsers/mutation_admin/__init__.py +0 -51
- build/lib/catocli/parsers/mutation_container/__init__.py +0 -23
- build/lib/catocli/parsers/mutation_policy/__init__.py +0 -357
- build/lib/catocli/parsers/mutation_site/__init__.py +0 -219
- build/lib/catocli/parsers/mutation_sites/__init__.py +0 -219
- build/lib/catocli/parsers/parserApiClient.py +0 -309
- build/lib/catocli/parsers/query_accountBySubdomain/__init__.py +0 -17
- build/lib/catocli/parsers/query_accountMetrics/__init__.py +0 -17
- build/lib/catocli/parsers/query_accountRoles/__init__.py +0 -17
- build/lib/catocli/parsers/query_accountSnapshot/__init__.py +0 -17
- build/lib/catocli/parsers/query_admin/__init__.py +0 -17
- build/lib/catocli/parsers/query_admins/__init__.py +0 -17
- build/lib/catocli/parsers/query_appStats/__init__.py +0 -17
- build/lib/catocli/parsers/query_appStatsTimeSeries/__init__.py +0 -17
- build/lib/catocli/parsers/query_auditFeed/__init__.py +0 -17
- build/lib/catocli/parsers/query_container/__init__.py +0 -17
- build/lib/catocli/parsers/query_entityLookup/__init__.py +0 -17
- build/lib/catocli/parsers/query_events/__init__.py +0 -17
- build/lib/catocli/parsers/query_eventsFeed/__init__.py +0 -17
- build/lib/catocli/parsers/query_eventsTimeSeries/__init__.py +0 -17
- build/lib/catocli/parsers/query_hardwareManagement/__init__.py +0 -17
- build/lib/catocli/parsers/query_licensing/__init__.py +0 -17
- build/lib/catocli/parsers/query_policy/__init__.py +0 -17
- build/lib/catocli/parsers/query_siteLocation/__init__.py +0 -17
- build/lib/catocli/parsers/query_subDomains/__init__.py +0 -17
- build/lib/catocli/parsers/query_xdr/__init__.py +0 -37
- build/lib/catocli/parsers/raw/__init__.py +0 -9
- build/lib/graphql_client/__init__.py +0 -11
- build/lib/graphql_client/api/__init__.py +0 -3
- build/lib/graphql_client/api/call_api.py +0 -73
- build/lib/graphql_client/api_client.py +0 -192
- build/lib/graphql_client/api_client_types.py +0 -404
- build/lib/graphql_client/configuration.py +0 -230
- build/lib/graphql_client/models/__init__.py +0 -13
- build/lib/graphql_client/models/no_schema.py +0 -71
- build/lib/schema/catolib.py +0 -1016
- build/lib/schema/importSchema.py +0 -60
- build/lib/vendor/certifi/__init__.py +0 -4
- build/lib/vendor/certifi/__main__.py +0 -12
- build/lib/vendor/certifi/core.py +0 -114
- build/lib/vendor/certifi/py.typed +0 -0
- build/lib/vendor/six.py +0 -998
- build/lib/vendor/urllib3/__init__.py +0 -211
- build/lib/vendor/urllib3/_base_connection.py +0 -172
- build/lib/vendor/urllib3/_collections.py +0 -483
- build/lib/vendor/urllib3/_request_methods.py +0 -278
- build/lib/vendor/urllib3/_version.py +0 -16
- build/lib/vendor/urllib3/connection.py +0 -1033
- build/lib/vendor/urllib3/connectionpool.py +0 -1182
- build/lib/vendor/urllib3/contrib/__init__.py +0 -0
- build/lib/vendor/urllib3/contrib/emscripten/__init__.py +0 -18
- build/lib/vendor/urllib3/contrib/emscripten/connection.py +0 -254
- build/lib/vendor/urllib3/contrib/emscripten/fetch.py +0 -418
- build/lib/vendor/urllib3/contrib/emscripten/request.py +0 -22
- build/lib/vendor/urllib3/contrib/emscripten/response.py +0 -285
- build/lib/vendor/urllib3/contrib/pyopenssl.py +0 -552
- build/lib/vendor/urllib3/contrib/socks.py +0 -228
- build/lib/vendor/urllib3/exceptions.py +0 -321
- build/lib/vendor/urllib3/fields.py +0 -341
- build/lib/vendor/urllib3/filepost.py +0 -89
- build/lib/vendor/urllib3/http2/__init__.py +0 -53
- build/lib/vendor/urllib3/http2/connection.py +0 -356
- build/lib/vendor/urllib3/http2/probe.py +0 -87
- build/lib/vendor/urllib3/poolmanager.py +0 -637
- build/lib/vendor/urllib3/py.typed +0 -2
- build/lib/vendor/urllib3/response.py +0 -1265
- build/lib/vendor/urllib3/util/__init__.py +0 -42
- build/lib/vendor/urllib3/util/connection.py +0 -137
- build/lib/vendor/urllib3/util/proxy.py +0 -43
- build/lib/vendor/urllib3/util/request.py +0 -256
- build/lib/vendor/urllib3/util/response.py +0 -101
- build/lib/vendor/urllib3/util/retry.py +0 -533
- build/lib/vendor/urllib3/util/ssl_.py +0 -513
- build/lib/vendor/urllib3/util/ssl_match_hostname.py +0 -159
- build/lib/vendor/urllib3/util/ssltransport.py +0 -276
- build/lib/vendor/urllib3/util/timeout.py +0 -275
- build/lib/vendor/urllib3/util/url.py +0 -471
- build/lib/vendor/urllib3/util/util.py +0 -42
- build/lib/vendor/urllib3/util/wait.py +0 -124
- catocli-1.0.13.dist-info/RECORD +0 -344
- {catocli-1.0.13.dist-info → catocli-1.0.15.dist-info}/LICENSE +0 -0
- {catocli-1.0.13.dist-info → catocli-1.0.15.dist-info}/WHEEL +0 -0
- {catocli-1.0.13.dist-info → catocli-1.0.15.dist-info}/entry_points.txt +0 -0
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
from ..parserApiClient import createRequest, get_help
|
|
3
|
-
|
|
4
|
-
def mutation_sites_parse(mutation_subparsers):
|
|
5
|
-
mutation_sites_parser = mutation_subparsers.add_parser('sites',
|
|
6
|
-
help='sites() mutation operation',
|
|
7
|
-
usage=get_help("mutation_sites"))
|
|
8
|
-
|
|
9
|
-
mutation_sites_subparsers = mutation_sites_parser.add_subparsers()
|
|
10
|
-
|
|
11
|
-
mutation_sites_addIpsecIkeV2Site_parser = mutation_sites_subparsers.add_parser('addIpsecIkeV2Site',
|
|
12
|
-
help='addIpsecIkeV2Site() sites operation',
|
|
13
|
-
usage=get_help("mutation_sites_addIpsecIkeV2Site"))
|
|
14
|
-
|
|
15
|
-
mutation_sites_addIpsecIkeV2Site_parser.add_argument('json', help='Variables in JSON format.')
|
|
16
|
-
mutation_sites_addIpsecIkeV2Site_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
17
|
-
mutation_sites_addIpsecIkeV2Site_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
18
|
-
help='Print test request preview without sending api call')
|
|
19
|
-
mutation_sites_addIpsecIkeV2Site_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
20
|
-
help='Verbose output')
|
|
21
|
-
mutation_sites_addIpsecIkeV2Site_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
22
|
-
help='Pretty print')
|
|
23
|
-
mutation_sites_addIpsecIkeV2Site_parser.set_defaults(func=createRequest,operation_name='mutation.sites.addIpsecIkeV2Site')
|
|
24
|
-
|
|
25
|
-
mutation_sites_addIpsecIkeV2SiteTunnels_parser = mutation_sites_subparsers.add_parser('addIpsecIkeV2SiteTunnels',
|
|
26
|
-
help='addIpsecIkeV2SiteTunnels() sites operation',
|
|
27
|
-
usage=get_help("mutation_sites_addIpsecIkeV2SiteTunnels"))
|
|
28
|
-
|
|
29
|
-
mutation_sites_addIpsecIkeV2SiteTunnels_parser.add_argument('json', help='Variables in JSON format.')
|
|
30
|
-
mutation_sites_addIpsecIkeV2SiteTunnels_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
31
|
-
mutation_sites_addIpsecIkeV2SiteTunnels_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
32
|
-
help='Print test request preview without sending api call')
|
|
33
|
-
mutation_sites_addIpsecIkeV2SiteTunnels_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
34
|
-
help='Verbose output')
|
|
35
|
-
mutation_sites_addIpsecIkeV2SiteTunnels_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
36
|
-
help='Pretty print')
|
|
37
|
-
mutation_sites_addIpsecIkeV2SiteTunnels_parser.set_defaults(func=createRequest,operation_name='mutation.sites.addIpsecIkeV2SiteTunnels')
|
|
38
|
-
|
|
39
|
-
mutation_sites_addNetworkRange_parser = mutation_sites_subparsers.add_parser('addNetworkRange',
|
|
40
|
-
help='addNetworkRange() sites operation',
|
|
41
|
-
usage=get_help("mutation_sites_addNetworkRange"))
|
|
42
|
-
|
|
43
|
-
mutation_sites_addNetworkRange_parser.add_argument('json', help='Variables in JSON format.')
|
|
44
|
-
mutation_sites_addNetworkRange_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
45
|
-
mutation_sites_addNetworkRange_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
46
|
-
help='Print test request preview without sending api call')
|
|
47
|
-
mutation_sites_addNetworkRange_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
48
|
-
help='Verbose output')
|
|
49
|
-
mutation_sites_addNetworkRange_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
50
|
-
help='Pretty print')
|
|
51
|
-
mutation_sites_addNetworkRange_parser.set_defaults(func=createRequest,operation_name='mutation.sites.addNetworkRange')
|
|
52
|
-
|
|
53
|
-
mutation_sites_addSocketSite_parser = mutation_sites_subparsers.add_parser('addSocketSite',
|
|
54
|
-
help='addSocketSite() sites operation',
|
|
55
|
-
usage=get_help("mutation_sites_addSocketSite"))
|
|
56
|
-
|
|
57
|
-
mutation_sites_addSocketSite_parser.add_argument('json', help='Variables in JSON format.')
|
|
58
|
-
mutation_sites_addSocketSite_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
59
|
-
mutation_sites_addSocketSite_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
60
|
-
help='Print test request preview without sending api call')
|
|
61
|
-
mutation_sites_addSocketSite_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
62
|
-
help='Verbose output')
|
|
63
|
-
mutation_sites_addSocketSite_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
64
|
-
help='Pretty print')
|
|
65
|
-
mutation_sites_addSocketSite_parser.set_defaults(func=createRequest,operation_name='mutation.sites.addSocketSite')
|
|
66
|
-
|
|
67
|
-
mutation_sites_addStaticHost_parser = mutation_sites_subparsers.add_parser('addStaticHost',
|
|
68
|
-
help='addStaticHost() sites operation',
|
|
69
|
-
usage=get_help("mutation_sites_addStaticHost"))
|
|
70
|
-
|
|
71
|
-
mutation_sites_addStaticHost_parser.add_argument('json', help='Variables in JSON format.')
|
|
72
|
-
mutation_sites_addStaticHost_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
73
|
-
mutation_sites_addStaticHost_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
74
|
-
help='Print test request preview without sending api call')
|
|
75
|
-
mutation_sites_addStaticHost_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
76
|
-
help='Verbose output')
|
|
77
|
-
mutation_sites_addStaticHost_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
78
|
-
help='Pretty print')
|
|
79
|
-
mutation_sites_addStaticHost_parser.set_defaults(func=createRequest,operation_name='mutation.sites.addStaticHost')
|
|
80
|
-
|
|
81
|
-
mutation_sites_removeNetworkRange_parser = mutation_sites_subparsers.add_parser('removeNetworkRange',
|
|
82
|
-
help='removeNetworkRange() sites operation',
|
|
83
|
-
usage=get_help("mutation_sites_removeNetworkRange"))
|
|
84
|
-
|
|
85
|
-
mutation_sites_removeNetworkRange_parser.add_argument('json', help='Variables in JSON format.')
|
|
86
|
-
mutation_sites_removeNetworkRange_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
87
|
-
mutation_sites_removeNetworkRange_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
88
|
-
help='Print test request preview without sending api call')
|
|
89
|
-
mutation_sites_removeNetworkRange_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
90
|
-
help='Verbose output')
|
|
91
|
-
mutation_sites_removeNetworkRange_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
92
|
-
help='Pretty print')
|
|
93
|
-
mutation_sites_removeNetworkRange_parser.set_defaults(func=createRequest,operation_name='mutation.sites.removeNetworkRange')
|
|
94
|
-
|
|
95
|
-
mutation_sites_removeSite_parser = mutation_sites_subparsers.add_parser('removeSite',
|
|
96
|
-
help='removeSite() sites operation',
|
|
97
|
-
usage=get_help("mutation_sites_removeSite"))
|
|
98
|
-
|
|
99
|
-
mutation_sites_removeSite_parser.add_argument('json', help='Variables in JSON format.')
|
|
100
|
-
mutation_sites_removeSite_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
101
|
-
mutation_sites_removeSite_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
102
|
-
help='Print test request preview without sending api call')
|
|
103
|
-
mutation_sites_removeSite_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
104
|
-
help='Verbose output')
|
|
105
|
-
mutation_sites_removeSite_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
106
|
-
help='Pretty print')
|
|
107
|
-
mutation_sites_removeSite_parser.set_defaults(func=createRequest,operation_name='mutation.sites.removeSite')
|
|
108
|
-
|
|
109
|
-
mutation_sites_removeStaticHost_parser = mutation_sites_subparsers.add_parser('removeStaticHost',
|
|
110
|
-
help='removeStaticHost() sites operation',
|
|
111
|
-
usage=get_help("mutation_sites_removeStaticHost"))
|
|
112
|
-
|
|
113
|
-
mutation_sites_removeStaticHost_parser.add_argument('json', help='Variables in JSON format.')
|
|
114
|
-
mutation_sites_removeStaticHost_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
115
|
-
mutation_sites_removeStaticHost_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
116
|
-
help='Print test request preview without sending api call')
|
|
117
|
-
mutation_sites_removeStaticHost_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
118
|
-
help='Verbose output')
|
|
119
|
-
mutation_sites_removeStaticHost_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
120
|
-
help='Pretty print')
|
|
121
|
-
mutation_sites_removeStaticHost_parser.set_defaults(func=createRequest,operation_name='mutation.sites.removeStaticHost')
|
|
122
|
-
|
|
123
|
-
mutation_sites_updateHa_parser = mutation_sites_subparsers.add_parser('updateHa',
|
|
124
|
-
help='updateHa() sites operation',
|
|
125
|
-
usage=get_help("mutation_sites_updateHa"))
|
|
126
|
-
|
|
127
|
-
mutation_sites_updateHa_parser.add_argument('json', help='Variables in JSON format.')
|
|
128
|
-
mutation_sites_updateHa_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
129
|
-
mutation_sites_updateHa_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
130
|
-
help='Print test request preview without sending api call')
|
|
131
|
-
mutation_sites_updateHa_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
132
|
-
help='Verbose output')
|
|
133
|
-
mutation_sites_updateHa_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
134
|
-
help='Pretty print')
|
|
135
|
-
mutation_sites_updateHa_parser.set_defaults(func=createRequest,operation_name='mutation.sites.updateHa')
|
|
136
|
-
|
|
137
|
-
mutation_sites_updateIpsecIkeV2SiteGeneralDetails_parser = mutation_sites_subparsers.add_parser('updateIpsecIkeV2SiteGeneralDetails',
|
|
138
|
-
help='updateIpsecIkeV2SiteGeneralDetails() sites operation',
|
|
139
|
-
usage=get_help("mutation_sites_updateIpsecIkeV2SiteGeneralDetails"))
|
|
140
|
-
|
|
141
|
-
mutation_sites_updateIpsecIkeV2SiteGeneralDetails_parser.add_argument('json', help='Variables in JSON format.')
|
|
142
|
-
mutation_sites_updateIpsecIkeV2SiteGeneralDetails_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
143
|
-
mutation_sites_updateIpsecIkeV2SiteGeneralDetails_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
144
|
-
help='Print test request preview without sending api call')
|
|
145
|
-
mutation_sites_updateIpsecIkeV2SiteGeneralDetails_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
146
|
-
help='Verbose output')
|
|
147
|
-
mutation_sites_updateIpsecIkeV2SiteGeneralDetails_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
148
|
-
help='Pretty print')
|
|
149
|
-
mutation_sites_updateIpsecIkeV2SiteGeneralDetails_parser.set_defaults(func=createRequest,operation_name='mutation.sites.updateIpsecIkeV2SiteGeneralDetails')
|
|
150
|
-
|
|
151
|
-
mutation_sites_updateIpsecIkeV2SiteTunnels_parser = mutation_sites_subparsers.add_parser('updateIpsecIkeV2SiteTunnels',
|
|
152
|
-
help='updateIpsecIkeV2SiteTunnels() sites operation',
|
|
153
|
-
usage=get_help("mutation_sites_updateIpsecIkeV2SiteTunnels"))
|
|
154
|
-
|
|
155
|
-
mutation_sites_updateIpsecIkeV2SiteTunnels_parser.add_argument('json', help='Variables in JSON format.')
|
|
156
|
-
mutation_sites_updateIpsecIkeV2SiteTunnels_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
157
|
-
mutation_sites_updateIpsecIkeV2SiteTunnels_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
158
|
-
help='Print test request preview without sending api call')
|
|
159
|
-
mutation_sites_updateIpsecIkeV2SiteTunnels_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
160
|
-
help='Verbose output')
|
|
161
|
-
mutation_sites_updateIpsecIkeV2SiteTunnels_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
162
|
-
help='Pretty print')
|
|
163
|
-
mutation_sites_updateIpsecIkeV2SiteTunnels_parser.set_defaults(func=createRequest,operation_name='mutation.sites.updateIpsecIkeV2SiteTunnels')
|
|
164
|
-
|
|
165
|
-
mutation_sites_updateNetworkRange_parser = mutation_sites_subparsers.add_parser('updateNetworkRange',
|
|
166
|
-
help='updateNetworkRange() sites operation',
|
|
167
|
-
usage=get_help("mutation_sites_updateNetworkRange"))
|
|
168
|
-
|
|
169
|
-
mutation_sites_updateNetworkRange_parser.add_argument('json', help='Variables in JSON format.')
|
|
170
|
-
mutation_sites_updateNetworkRange_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
171
|
-
mutation_sites_updateNetworkRange_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
172
|
-
help='Print test request preview without sending api call')
|
|
173
|
-
mutation_sites_updateNetworkRange_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
174
|
-
help='Verbose output')
|
|
175
|
-
mutation_sites_updateNetworkRange_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
176
|
-
help='Pretty print')
|
|
177
|
-
mutation_sites_updateNetworkRange_parser.set_defaults(func=createRequest,operation_name='mutation.sites.updateNetworkRange')
|
|
178
|
-
|
|
179
|
-
mutation_sites_updateSiteGeneralDetails_parser = mutation_sites_subparsers.add_parser('updateSiteGeneralDetails',
|
|
180
|
-
help='updateSiteGeneralDetails() sites operation',
|
|
181
|
-
usage=get_help("mutation_sites_updateSiteGeneralDetails"))
|
|
182
|
-
|
|
183
|
-
mutation_sites_updateSiteGeneralDetails_parser.add_argument('json', help='Variables in JSON format.')
|
|
184
|
-
mutation_sites_updateSiteGeneralDetails_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
185
|
-
mutation_sites_updateSiteGeneralDetails_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
186
|
-
help='Print test request preview without sending api call')
|
|
187
|
-
mutation_sites_updateSiteGeneralDetails_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
188
|
-
help='Verbose output')
|
|
189
|
-
mutation_sites_updateSiteGeneralDetails_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
190
|
-
help='Pretty print')
|
|
191
|
-
mutation_sites_updateSiteGeneralDetails_parser.set_defaults(func=createRequest,operation_name='mutation.sites.updateSiteGeneralDetails')
|
|
192
|
-
|
|
193
|
-
mutation_sites_updateSocketInterface_parser = mutation_sites_subparsers.add_parser('updateSocketInterface',
|
|
194
|
-
help='updateSocketInterface() sites operation',
|
|
195
|
-
usage=get_help("mutation_sites_updateSocketInterface"))
|
|
196
|
-
|
|
197
|
-
mutation_sites_updateSocketInterface_parser.add_argument('json', help='Variables in JSON format.')
|
|
198
|
-
mutation_sites_updateSocketInterface_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
199
|
-
mutation_sites_updateSocketInterface_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
200
|
-
help='Print test request preview without sending api call')
|
|
201
|
-
mutation_sites_updateSocketInterface_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
202
|
-
help='Verbose output')
|
|
203
|
-
mutation_sites_updateSocketInterface_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
204
|
-
help='Pretty print')
|
|
205
|
-
mutation_sites_updateSocketInterface_parser.set_defaults(func=createRequest,operation_name='mutation.sites.updateSocketInterface')
|
|
206
|
-
|
|
207
|
-
mutation_sites_updateStaticHost_parser = mutation_sites_subparsers.add_parser('updateStaticHost',
|
|
208
|
-
help='updateStaticHost() sites operation',
|
|
209
|
-
usage=get_help("mutation_sites_updateStaticHost"))
|
|
210
|
-
|
|
211
|
-
mutation_sites_updateStaticHost_parser.add_argument('json', help='Variables in JSON format.')
|
|
212
|
-
mutation_sites_updateStaticHost_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
213
|
-
mutation_sites_updateStaticHost_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
214
|
-
help='Print test request preview without sending api call')
|
|
215
|
-
mutation_sites_updateStaticHost_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
216
|
-
help='Verbose output')
|
|
217
|
-
mutation_sites_updateStaticHost_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
218
|
-
help='Pretty print')
|
|
219
|
-
mutation_sites_updateStaticHost_parser.set_defaults(func=createRequest,operation_name='mutation.sites.updateStaticHost')
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
import codecs
|
|
2
|
-
import json
|
|
3
|
-
import os
|
|
4
|
-
import sys
|
|
5
|
-
from graphql_client import ApiClient, CallApi
|
|
6
|
-
from graphql_client.api_client import ApiException
|
|
7
|
-
import logging
|
|
8
|
-
import pprint
|
|
9
|
-
|
|
10
|
-
def createRequest(args, configuration):
|
|
11
|
-
params = vars(args)
|
|
12
|
-
instance = CallApi(ApiClient(configuration))
|
|
13
|
-
operationName = params["operation_name"]
|
|
14
|
-
operation = loadJSON("models/"+operationName+".json")
|
|
15
|
-
try:
|
|
16
|
-
variablesObj = json.loads(params["json"])
|
|
17
|
-
except ValueError as e:
|
|
18
|
-
print("ERROR: Query argument must be valid json in quotes. ",e,'\n\nExample: \'{"yourKey":"yourValue"}\'')
|
|
19
|
-
exit()
|
|
20
|
-
variablesObj["accountID"] = configuration.accountID
|
|
21
|
-
isOk, invalidVars, message = validateArgs(variablesObj,operation)
|
|
22
|
-
if isOk==True:
|
|
23
|
-
body = generateGraphqlPayload(variablesObj,operation,operationName)
|
|
24
|
-
if params["t"]==True:
|
|
25
|
-
if params["p"]==True:
|
|
26
|
-
print(json.dumps(body,indent=2,sort_keys=True).replace("\\n", "\n").replace("\\t", " "))
|
|
27
|
-
else:
|
|
28
|
-
print(json.dumps(body).replace("\\n", " ").replace("\\t", " ").replace(" "," ").replace(" "," "))
|
|
29
|
-
return None
|
|
30
|
-
else:
|
|
31
|
-
try:
|
|
32
|
-
return instance.call_api(body,params)
|
|
33
|
-
except ApiException as e:
|
|
34
|
-
return e
|
|
35
|
-
else:
|
|
36
|
-
print("ERROR: "+message,", ".join(invalidVars))
|
|
37
|
-
|
|
38
|
-
def querySiteLocation(args, configuration):
|
|
39
|
-
params = vars(args)
|
|
40
|
-
operationName = params["operation_name"]
|
|
41
|
-
operation = loadJSON("models/"+operationName+".json")
|
|
42
|
-
try:
|
|
43
|
-
variablesObj = json.loads(params["json"])
|
|
44
|
-
except ValueError as e:
|
|
45
|
-
print("ERROR: Query argument must be valid json in quotes. ",e,'\n\nExample: \'{filters:[{"search": "Your city here","field":"city","opeation":"exact"}}\'')
|
|
46
|
-
exit()
|
|
47
|
-
if not variablesObj.get("filters"):
|
|
48
|
-
print("ERROR: Missing argument, must include filters array. ",e,'\n\nExample: \'{filters:[{"search": "Your city here","field":"city","opeation":"exact"}}\'')
|
|
49
|
-
exit()
|
|
50
|
-
if not isinstance(variablesObj.get("filters"), list):
|
|
51
|
-
print("ERROR: Invalid argument, must include filters array. ",e,'\n\nExample: \'{filters:[{"search": "Your city here","field":"city","opeation":"exact"}}\'')
|
|
52
|
-
exit()
|
|
53
|
-
requiredFields = ["search","field","operation"]
|
|
54
|
-
for filter in variablesObj["filters"]:
|
|
55
|
-
if not isinstance(filter, dict):
|
|
56
|
-
print("ERROR: Invalid filter '"+str(filter)+"', filters must be valid json and include 'search', 'field', and 'operation'. ",'\n\nExample: \'{filters:[{"search": "Your city here","field":"city","opeation":"exact"}}\'',type(filter))
|
|
57
|
-
exit()
|
|
58
|
-
for param in filter:
|
|
59
|
-
if param not in requiredFields:
|
|
60
|
-
print("ERROR: Invalid field '"+param+"', filters must include 'search', 'field', and 'operation'. ",'\n\nExample: \'{filters:[{"search": "Your city here","field":"city","opeation":"exact"}}\'')
|
|
61
|
-
exit()
|
|
62
|
-
for filter in variablesObj["filters"]:
|
|
63
|
-
for param in filter:
|
|
64
|
-
val = filter.get(param)
|
|
65
|
-
if param=="search" and (not isinstance(val, str) or len(val)<3):
|
|
66
|
-
print("ERROR: Invalid search '"+val+"', must be a string value and at least 3 characters in lengh. ",'\n\nExample: \'{filters:[{"search": "Your city here","field":"city","opeation":"exact"}}\'')
|
|
67
|
-
exit()
|
|
68
|
-
if param=="field" and (not isinstance(val, str) or val not in [ 'countryName', 'stateName', 'city']):
|
|
69
|
-
print("ERROR: Invalid field '"+val+"', must be one of the following: 'countryName', 'stateName', or 'city'.",'\n\nExample: \'{"search":"your query here","field":"city"}\'')
|
|
70
|
-
exit()
|
|
71
|
-
if param=="operation" and (not isinstance(val, str) or val not in [ 'startsWith', 'endsWith', 'exact', 'contains' ]):
|
|
72
|
-
print("ERROR: Invalid operation '"+val+"', must be one of the following: 'startsWith', 'endsWith', 'exact', 'contains'.",'\n\nExample: \'{"search": "Your search here","field":"city","operation":"exact"}\'')
|
|
73
|
-
exit()
|
|
74
|
-
response = {"data":[]}
|
|
75
|
-
for key, siteObj in operation.items():
|
|
76
|
-
isOk = True
|
|
77
|
-
for filter in variablesObj["filters"]:
|
|
78
|
-
search = filter.get("search")
|
|
79
|
-
field = filter.get("field")
|
|
80
|
-
operation = filter.get("operation")
|
|
81
|
-
if field in siteObj:
|
|
82
|
-
if operation=="startsWith" and not siteObj[field].startswith(search):
|
|
83
|
-
isOk = False
|
|
84
|
-
break
|
|
85
|
-
elif operation=="endsWith" and not siteObj[field].endswith(search):
|
|
86
|
-
isOk = False
|
|
87
|
-
break
|
|
88
|
-
elif operation=="exact" and not siteObj[field]==search:
|
|
89
|
-
isOk = False
|
|
90
|
-
break
|
|
91
|
-
elif operation=="contains" and not search in siteObj[field]:
|
|
92
|
-
isOk = False
|
|
93
|
-
break
|
|
94
|
-
else:
|
|
95
|
-
isOk = False
|
|
96
|
-
break
|
|
97
|
-
if isOk==False:
|
|
98
|
-
break
|
|
99
|
-
if isOk==True:
|
|
100
|
-
response["data"].append(siteObj)
|
|
101
|
-
if params["p"]==True:
|
|
102
|
-
responseStr = json.dumps(response,indent=2,sort_keys=True,ensure_ascii=False).encode('utf8')
|
|
103
|
-
print(responseStr.decode())
|
|
104
|
-
else:
|
|
105
|
-
responseStr = json.dumps(response,ensure_ascii=False).encode('utf8')
|
|
106
|
-
print(responseStr.decode())
|
|
107
|
-
|
|
108
|
-
def createRawRequest(args, configuration):
|
|
109
|
-
params = vars(args)
|
|
110
|
-
instance = CallApi(ApiClient(configuration))
|
|
111
|
-
isOk = False
|
|
112
|
-
try:
|
|
113
|
-
body = json.loads(params["json"])
|
|
114
|
-
isOk = True
|
|
115
|
-
except ValueError as e:
|
|
116
|
-
print("ERROR: Argument must be valid json. ",e)
|
|
117
|
-
isOk=False
|
|
118
|
-
except Exception as e:
|
|
119
|
-
isOk=False
|
|
120
|
-
print("ERROR: ",e)
|
|
121
|
-
if isOk==True:
|
|
122
|
-
if params["t"]==True:
|
|
123
|
-
if params["p"]==True:
|
|
124
|
-
print(json.dumps(body,indent=2,sort_keys=True).replace("\\n", "\n").replace("\\t", "\t"))
|
|
125
|
-
else:
|
|
126
|
-
print(json.dumps(body).replace("\\n", " ").replace("\\t", " ").replace(" "," ").replace(" "," "))
|
|
127
|
-
return None
|
|
128
|
-
else:
|
|
129
|
-
try:
|
|
130
|
-
return instance.call_api(body,params)
|
|
131
|
-
except ApiException as e:
|
|
132
|
-
print(e)
|
|
133
|
-
exit()
|
|
134
|
-
|
|
135
|
-
def generateGraphqlPayload(variablesObj,operation,operationName):
|
|
136
|
-
indent = " "
|
|
137
|
-
queryStr = ""
|
|
138
|
-
variableStr = ""
|
|
139
|
-
for varName in variablesObj:
|
|
140
|
-
if (varName in operation["operationArgs"]):
|
|
141
|
-
variableStr += operation["operationArgs"][varName]["requestStr"]
|
|
142
|
-
operationAry = operationName.split(".")
|
|
143
|
-
operationType = operationAry.pop(0)
|
|
144
|
-
queryStr = operationType + " "
|
|
145
|
-
queryStr += renderCamelCase(".".join(operationAry))
|
|
146
|
-
queryStr += " ( " + variableStr + ") {\n"
|
|
147
|
-
queryStr += indent + operation["name"] + " ( "
|
|
148
|
-
for argName in operation["args"]:
|
|
149
|
-
arg = operation["args"][argName]
|
|
150
|
-
if arg["varName"] in variablesObj:
|
|
151
|
-
queryStr += arg["responseStr"]
|
|
152
|
-
queryStr += ") {\n" + renderArgsAndFields("", variablesObj, operation, operation["type"]["definition"], " ") + " }"
|
|
153
|
-
queryStr += indent + "\n}";
|
|
154
|
-
body = {
|
|
155
|
-
"query":queryStr,
|
|
156
|
-
"variables":variablesObj,
|
|
157
|
-
"operationName":renderCamelCase(".".join(operationAry)),
|
|
158
|
-
}
|
|
159
|
-
return body
|
|
160
|
-
|
|
161
|
-
def get_help(path):
|
|
162
|
-
matchCmd = "catocli "+path.replace("_"," ")
|
|
163
|
-
import os
|
|
164
|
-
pwd = os.path.dirname(__file__)
|
|
165
|
-
doc = path+"/README.md"
|
|
166
|
-
abs_path = os.path.join(pwd, doc)
|
|
167
|
-
new_line = "\nEXAMPLES:\n"
|
|
168
|
-
lines = open(abs_path, "r").readlines()
|
|
169
|
-
for line in lines:
|
|
170
|
-
if f"{matchCmd}" in line:
|
|
171
|
-
clean_line = line.replace("<br /><br />", "").replace("`","")
|
|
172
|
-
new_line += f"{clean_line}\n"
|
|
173
|
-
# matchArg = path.replace("_",".")
|
|
174
|
-
# for line in lines:
|
|
175
|
-
# if f"`{matchArg}" in line:
|
|
176
|
-
# clean_line = line.replace("<br /><br />", "").replace("`","")
|
|
177
|
-
# new_line += f"{clean_line}\n"
|
|
178
|
-
return new_line
|
|
179
|
-
|
|
180
|
-
def validateArgs(variablesObj,operation):
|
|
181
|
-
isOk = True
|
|
182
|
-
invalidVars = []
|
|
183
|
-
message = "Arguments are missing or have invalid values: "
|
|
184
|
-
for varName in variablesObj:
|
|
185
|
-
if varName not in operation["operationArgs"]:
|
|
186
|
-
isOk = False
|
|
187
|
-
invalidVars.append('"'+varName+'"')
|
|
188
|
-
message = "Invalid argument names: "
|
|
189
|
-
if isOk==True:
|
|
190
|
-
for varName in operation["operationArgs"]:
|
|
191
|
-
if operation["operationArgs"][varName]["required"] and varName not in variablesObj:
|
|
192
|
-
isOk = False
|
|
193
|
-
invalidVars.append('"'+varName+'"')
|
|
194
|
-
else:
|
|
195
|
-
if varName in variablesObj:
|
|
196
|
-
value = variablesObj[varName]
|
|
197
|
-
if operation["operationArgs"][varName]["required"] and value=="":
|
|
198
|
-
isOk = False
|
|
199
|
-
invalidVars.append('"'+varName+'":"'+str(value)+'"')
|
|
200
|
-
return isOk, invalidVars, message
|
|
201
|
-
|
|
202
|
-
def loadJSON(file):
|
|
203
|
-
CONFIG = {}
|
|
204
|
-
module_dir_ary = os.path.dirname(__file__).split("/")
|
|
205
|
-
del module_dir_ary[-1]
|
|
206
|
-
del module_dir_ary[-1]
|
|
207
|
-
module_dir = "/".join(module_dir_ary)
|
|
208
|
-
try:
|
|
209
|
-
with open(module_dir+'/'+file, 'r') as data:
|
|
210
|
-
CONFIG = json.load(data)
|
|
211
|
-
return CONFIG
|
|
212
|
-
except:
|
|
213
|
-
logging.warning("File \""+module_dir+'/'+file+"\" not found.")
|
|
214
|
-
exit()
|
|
215
|
-
|
|
216
|
-
def renderCamelCase(pathStr):
|
|
217
|
-
str = "";
|
|
218
|
-
pathAry = pathStr.split(".")
|
|
219
|
-
for i, path in enumerate(pathAry):
|
|
220
|
-
if i == 0:
|
|
221
|
-
str += path
|
|
222
|
-
else:
|
|
223
|
-
str += path[0].upper() + path[1:]
|
|
224
|
-
return str
|
|
225
|
-
|
|
226
|
-
def renderArgsAndFields(responseArgStr, variablesObj, curOperation, definition, indent):
|
|
227
|
-
for fieldName in definition['fields']:
|
|
228
|
-
field = definition['fields'][fieldName]
|
|
229
|
-
field_name = field['alias'] if 'alias' in field else field['name']
|
|
230
|
-
responseArgStr += indent + field_name
|
|
231
|
-
if field.get("args") and not isinstance(field['args'], list):
|
|
232
|
-
if (len(list(field['args'].keys()))>0):
|
|
233
|
-
argsPresent = False
|
|
234
|
-
argStr = " ( "
|
|
235
|
-
for argName in field['args']:
|
|
236
|
-
arg = field['args'][argName]
|
|
237
|
-
if arg["varName"] in variablesObj:
|
|
238
|
-
argStr += arg['responseStr'] + " "
|
|
239
|
-
argsPresent = True
|
|
240
|
-
argStr += ") "
|
|
241
|
-
if argsPresent==True:
|
|
242
|
-
responseArgStr += argStr
|
|
243
|
-
if field.get("type") and field['type'].get('definition') and field['type']['definition']['fields'] is not None:
|
|
244
|
-
responseArgStr += " {\n"
|
|
245
|
-
for subfieldIndex in field['type']['definition']['fields']:
|
|
246
|
-
subfield = field['type']['definition']['fields'][subfieldIndex]
|
|
247
|
-
subfield_name = subfield['alias'] if 'alias' in subfield else subfield['name']
|
|
248
|
-
responseArgStr += indent + " " + subfield_name
|
|
249
|
-
if subfield.get("args") and len(list(subfield["args"].keys()))>0:
|
|
250
|
-
argsPresent = False
|
|
251
|
-
subArgStr = " ( "
|
|
252
|
-
for argName in subfield['args']:
|
|
253
|
-
arg = subfield['args'][argName]
|
|
254
|
-
if arg["varName"] in variablesObj:
|
|
255
|
-
argsPresent = True
|
|
256
|
-
subArgStr += arg['responseStr'] + " "
|
|
257
|
-
subArgStr += " )"
|
|
258
|
-
if argsPresent==True:
|
|
259
|
-
responseArgStr += subArgStr
|
|
260
|
-
if subfield.get("type") and subfield['type'].get("definition") and (subfield['type']['definition'].get("fields") or subfield['type']['definition'].get('inputFields')):
|
|
261
|
-
responseArgStr += " {\n"
|
|
262
|
-
responseArgStr = renderArgsAndFields(responseArgStr, variablesObj, curOperation, subfield['type']['definition'], indent + " ")
|
|
263
|
-
if subfield['type']['definition'].get('possibleTypes'):
|
|
264
|
-
for possibleTypeName in subfield['type']['definition']['possibleTypes']:
|
|
265
|
-
possibleType = subfield['type']['definition']['possibleTypes'][possibleTypeName]
|
|
266
|
-
responseArgStr += indent + " ... on " + possibleType['name'] + " {\n"
|
|
267
|
-
if possibleType.get('fields') or possibleType.get('inputFields'):
|
|
268
|
-
responseArgStr = renderArgsAndFields(responseArgStr, variablesObj, curOperation, possibleType, indent + " ")
|
|
269
|
-
responseArgStr += indent + " }\n"
|
|
270
|
-
responseArgStr += indent + " }"
|
|
271
|
-
elif subfield.get('type') and subfield['type'].get('definition') and subfield['type']['definition'].get('possibleTypes'):
|
|
272
|
-
responseArgStr += " {\n"
|
|
273
|
-
responseArgStr += indent + " __typename\n"
|
|
274
|
-
for possibleTypeName in subfield['type']['definition']['possibleTypes']:
|
|
275
|
-
possibleType = subfield['type']['definition']['possibleTypes'][possibleTypeName]
|
|
276
|
-
responseArgStr += indent + " ... on " + possibleType['name'] + " {\n"
|
|
277
|
-
if possibleType.get('fields') or possibleType.get('inputFields'):
|
|
278
|
-
responseArgStr = renderArgsAndFields(responseArgStr, variablesObj, curOperation, possibleType, indent + " ")
|
|
279
|
-
responseArgStr += indent + " }\n"
|
|
280
|
-
responseArgStr += indent + " }\n"
|
|
281
|
-
responseArgStr += "\n"
|
|
282
|
-
if field['type']['definition'].get('possibleTypes'):
|
|
283
|
-
for possibleTypeName in field['type']['definition']['possibleTypes']:
|
|
284
|
-
possibleType = field['type']['definition']['possibleTypes'][possibleTypeName]
|
|
285
|
-
responseArgStr += indent + " ... on " + possibleType['name'] + " {\n"
|
|
286
|
-
if possibleType.get('fields') or possibleType.get('inputFields'):
|
|
287
|
-
responseArgStr = renderArgsAndFields(responseArgStr, variablesObj, curOperation, possibleType, indent + " ")
|
|
288
|
-
responseArgStr += indent + " }\n"
|
|
289
|
-
responseArgStr += indent + "}\n"
|
|
290
|
-
if field.get('type') and field['type'].get('definition') and field['type']['definition'].get('inputFields'):
|
|
291
|
-
responseArgStr += " {\n"
|
|
292
|
-
for subfieldName in field['type']['definition'].get('inputFields'):
|
|
293
|
-
subfield = field['type']['definition']['inputFields'][subfieldName]
|
|
294
|
-
subfield_name = subfield['alias'] if 'alias' in subfield else subfield['name']
|
|
295
|
-
responseArgStr += indent + " " + subfield_name
|
|
296
|
-
if subfield.get('type') and subfield['type'].get('definition') and (subfield['type']['definition'].get('fields') or subfield['type']['definition'].get('inputFields')):
|
|
297
|
-
responseArgStr += " {\n"
|
|
298
|
-
responseArgStr = renderArgsAndFields(responseArgStr, variablesObj, curOperation, subfield['type']['definition'], indent + " ")
|
|
299
|
-
responseArgStr += indent + " }\n"
|
|
300
|
-
if field['type']['definition'].get('possibleTypes'):
|
|
301
|
-
for possibleTypeName in field['type']['definition']['possibleTypes']:
|
|
302
|
-
possibleType = field['type']['definition']['possibleTypes'][possibleTypeName]
|
|
303
|
-
responseArgStr += indent + "... on " + possibleType['name'] + " {\n"
|
|
304
|
-
if possibleType.get('fields') or possibleType.get('inputFields'):
|
|
305
|
-
responseArgStr = renderArgsAndFields(responseArgStr, variablesObj, curOperation, possibleType, indent + " ")
|
|
306
|
-
responseArgStr += indent + " }\n"
|
|
307
|
-
responseArgStr += indent + "}\n"
|
|
308
|
-
responseArgStr += "\n"
|
|
309
|
-
return responseArgStr
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
from ..parserApiClient import createRequest, get_help
|
|
3
|
-
|
|
4
|
-
def query_accountBySubdomain_parse(query_subparsers):
|
|
5
|
-
query_accountBySubdomain_parser = query_subparsers.add_parser('accountBySubdomain',
|
|
6
|
-
help='accountBySubdomain() query operation',
|
|
7
|
-
usage=get_help("query_accountBySubdomain"))
|
|
8
|
-
|
|
9
|
-
query_accountBySubdomain_parser.add_argument('json', help='Variables in JSON format.')
|
|
10
|
-
query_accountBySubdomain_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
11
|
-
query_accountBySubdomain_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
12
|
-
help='Print test request preview without sending api call')
|
|
13
|
-
query_accountBySubdomain_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
14
|
-
help='Verbose output')
|
|
15
|
-
query_accountBySubdomain_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
16
|
-
help='Pretty print')
|
|
17
|
-
query_accountBySubdomain_parser.set_defaults(func=createRequest,operation_name='query.accountBySubdomain')
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
from ..parserApiClient import createRequest, get_help
|
|
3
|
-
|
|
4
|
-
def query_accountMetrics_parse(query_subparsers):
|
|
5
|
-
query_accountMetrics_parser = query_subparsers.add_parser('accountMetrics',
|
|
6
|
-
help='accountMetrics() query operation',
|
|
7
|
-
usage=get_help("query_accountMetrics"))
|
|
8
|
-
|
|
9
|
-
query_accountMetrics_parser.add_argument('json', help='Variables in JSON format.')
|
|
10
|
-
query_accountMetrics_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
11
|
-
query_accountMetrics_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
12
|
-
help='Print test request preview without sending api call')
|
|
13
|
-
query_accountMetrics_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
14
|
-
help='Verbose output')
|
|
15
|
-
query_accountMetrics_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
16
|
-
help='Pretty print')
|
|
17
|
-
query_accountMetrics_parser.set_defaults(func=createRequest,operation_name='query.accountMetrics')
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
from ..parserApiClient import createRequest, get_help
|
|
3
|
-
|
|
4
|
-
def query_accountRoles_parse(query_subparsers):
|
|
5
|
-
query_accountRoles_parser = query_subparsers.add_parser('accountRoles',
|
|
6
|
-
help='accountRoles() query operation',
|
|
7
|
-
usage=get_help("query_accountRoles"))
|
|
8
|
-
|
|
9
|
-
query_accountRoles_parser.add_argument('json', help='Variables in JSON format.')
|
|
10
|
-
query_accountRoles_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
11
|
-
query_accountRoles_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
12
|
-
help='Print test request preview without sending api call')
|
|
13
|
-
query_accountRoles_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
14
|
-
help='Verbose output')
|
|
15
|
-
query_accountRoles_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
16
|
-
help='Pretty print')
|
|
17
|
-
query_accountRoles_parser.set_defaults(func=createRequest,operation_name='query.accountRoles')
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
from ..parserApiClient import createRequest, get_help
|
|
3
|
-
|
|
4
|
-
def query_accountSnapshot_parse(query_subparsers):
|
|
5
|
-
query_accountSnapshot_parser = query_subparsers.add_parser('accountSnapshot',
|
|
6
|
-
help='accountSnapshot() query operation',
|
|
7
|
-
usage=get_help("query_accountSnapshot"))
|
|
8
|
-
|
|
9
|
-
query_accountSnapshot_parser.add_argument('json', help='Variables in JSON format.')
|
|
10
|
-
query_accountSnapshot_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
11
|
-
query_accountSnapshot_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
12
|
-
help='Print test request preview without sending api call')
|
|
13
|
-
query_accountSnapshot_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
14
|
-
help='Verbose output')
|
|
15
|
-
query_accountSnapshot_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
16
|
-
help='Pretty print')
|
|
17
|
-
query_accountSnapshot_parser.set_defaults(func=createRequest,operation_name='query.accountSnapshot')
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
from ..parserApiClient import createRequest, get_help
|
|
3
|
-
|
|
4
|
-
def query_admin_parse(query_subparsers):
|
|
5
|
-
query_admin_parser = query_subparsers.add_parser('admin',
|
|
6
|
-
help='admin() query operation',
|
|
7
|
-
usage=get_help("query_admin"))
|
|
8
|
-
|
|
9
|
-
query_admin_parser.add_argument('json', help='Variables in JSON format.')
|
|
10
|
-
query_admin_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
11
|
-
query_admin_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
12
|
-
help='Print test request preview without sending api call')
|
|
13
|
-
query_admin_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
14
|
-
help='Verbose output')
|
|
15
|
-
query_admin_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
16
|
-
help='Pretty print')
|
|
17
|
-
query_admin_parser.set_defaults(func=createRequest,operation_name='query.admin')
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
from ..parserApiClient import createRequest, get_help
|
|
3
|
-
|
|
4
|
-
def query_admins_parse(query_subparsers):
|
|
5
|
-
query_admins_parser = query_subparsers.add_parser('admins',
|
|
6
|
-
help='admins() query operation',
|
|
7
|
-
usage=get_help("query_admins"))
|
|
8
|
-
|
|
9
|
-
query_admins_parser.add_argument('json', help='Variables in JSON format.')
|
|
10
|
-
query_admins_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
11
|
-
query_admins_parser.add_argument('-t', const=True, default=False, nargs='?',
|
|
12
|
-
help='Print test request preview without sending api call')
|
|
13
|
-
query_admins_parser.add_argument('-v', const=True, default=False, nargs='?',
|
|
14
|
-
help='Verbose output')
|
|
15
|
-
query_admins_parser.add_argument('-p', const=True, default=False, nargs='?',
|
|
16
|
-
help='Pretty print')
|
|
17
|
-
query_admins_parser.set_defaults(func=createRequest,operation_name='query.admins')
|