catocli 1.0.11__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.

Files changed (208) hide show
  1. build/lib/catocli/Utils/clidriver.py +117 -0
  2. build/lib/catocli/__init__.py +2 -0
  3. build/lib/catocli/__main__.py +12 -0
  4. build/lib/catocli/parsers/custom/__init__.py +47 -0
  5. build/lib/catocli/parsers/custom/customLib.py +70 -0
  6. build/lib/catocli/parsers/mutation_admin/__init__.py +51 -0
  7. build/lib/catocli/parsers/mutation_container/__init__.py +23 -0
  8. build/lib/catocli/parsers/mutation_policy/__init__.py +357 -0
  9. build/lib/catocli/parsers/mutation_site/__init__.py +219 -0
  10. build/lib/catocli/parsers/mutation_sites/__init__.py +219 -0
  11. build/lib/catocli/parsers/parserApiClient.py +309 -0
  12. build/lib/catocli/parsers/query_accountBySubdomain/__init__.py +17 -0
  13. build/lib/catocli/parsers/query_accountMetrics/__init__.py +17 -0
  14. build/lib/catocli/parsers/query_accountRoles/__init__.py +17 -0
  15. build/lib/catocli/parsers/query_accountSnapshot/__init__.py +17 -0
  16. build/lib/catocli/parsers/query_admin/__init__.py +17 -0
  17. build/lib/catocli/parsers/query_admins/__init__.py +17 -0
  18. build/lib/catocli/parsers/query_appStats/__init__.py +17 -0
  19. build/lib/catocli/parsers/query_appStatsTimeSeries/__init__.py +17 -0
  20. build/lib/catocli/parsers/query_auditFeed/__init__.py +17 -0
  21. build/lib/catocli/parsers/query_container/__init__.py +17 -0
  22. build/lib/catocli/parsers/query_entityLookup/__init__.py +17 -0
  23. build/lib/catocli/parsers/query_events/__init__.py +17 -0
  24. build/lib/catocli/parsers/query_eventsFeed/__init__.py +17 -0
  25. build/lib/catocli/parsers/query_eventsTimeSeries/__init__.py +17 -0
  26. build/lib/catocli/parsers/query_hardwareManagement/__init__.py +17 -0
  27. build/lib/catocli/parsers/query_licensing/__init__.py +17 -0
  28. build/lib/catocli/parsers/query_policy/__init__.py +17 -0
  29. build/lib/catocli/parsers/query_siteLocation/__init__.py +17 -0
  30. build/lib/catocli/parsers/query_subDomains/__init__.py +17 -0
  31. build/lib/catocli/parsers/query_xdr/__init__.py +37 -0
  32. build/lib/catocli/parsers/raw/__init__.py +9 -0
  33. build/lib/graphql_client/__init__.py +11 -0
  34. build/lib/graphql_client/api/__init__.py +3 -0
  35. build/lib/graphql_client/api/call_api.py +73 -0
  36. build/lib/graphql_client/api_client.py +192 -0
  37. build/lib/graphql_client/api_client_types.py +404 -0
  38. build/lib/graphql_client/configuration.py +230 -0
  39. build/lib/graphql_client/models/__init__.py +13 -0
  40. build/lib/graphql_client/models/no_schema.py +71 -0
  41. build/lib/schema/catolib.py +1016 -0
  42. build/lib/schema/importSchema.py +60 -0
  43. build/lib/vendor/certifi/__init__.py +4 -0
  44. build/lib/vendor/certifi/__main__.py +12 -0
  45. build/lib/vendor/certifi/core.py +114 -0
  46. build/lib/vendor/certifi/py.typed +0 -0
  47. build/lib/vendor/six.py +998 -0
  48. build/lib/vendor/urllib3/__init__.py +211 -0
  49. build/lib/vendor/urllib3/_base_connection.py +172 -0
  50. build/lib/vendor/urllib3/_collections.py +483 -0
  51. build/lib/vendor/urllib3/_request_methods.py +278 -0
  52. build/lib/vendor/urllib3/_version.py +16 -0
  53. build/lib/vendor/urllib3/connection.py +1033 -0
  54. build/lib/vendor/urllib3/connectionpool.py +1182 -0
  55. build/lib/vendor/urllib3/contrib/__init__.py +0 -0
  56. build/lib/vendor/urllib3/contrib/emscripten/__init__.py +18 -0
  57. build/lib/vendor/urllib3/contrib/emscripten/connection.py +254 -0
  58. build/lib/vendor/urllib3/contrib/emscripten/fetch.py +418 -0
  59. build/lib/vendor/urllib3/contrib/emscripten/request.py +22 -0
  60. build/lib/vendor/urllib3/contrib/emscripten/response.py +285 -0
  61. build/lib/vendor/urllib3/contrib/pyopenssl.py +552 -0
  62. build/lib/vendor/urllib3/contrib/socks.py +228 -0
  63. build/lib/vendor/urllib3/exceptions.py +321 -0
  64. build/lib/vendor/urllib3/fields.py +341 -0
  65. build/lib/vendor/urllib3/filepost.py +89 -0
  66. build/lib/vendor/urllib3/http2/__init__.py +53 -0
  67. build/lib/vendor/urllib3/http2/connection.py +356 -0
  68. build/lib/vendor/urllib3/http2/probe.py +87 -0
  69. build/lib/vendor/urllib3/poolmanager.py +637 -0
  70. build/lib/vendor/urllib3/py.typed +2 -0
  71. build/lib/vendor/urllib3/response.py +1265 -0
  72. build/lib/vendor/urllib3/util/__init__.py +42 -0
  73. build/lib/vendor/urllib3/util/connection.py +137 -0
  74. build/lib/vendor/urllib3/util/proxy.py +43 -0
  75. build/lib/vendor/urllib3/util/request.py +256 -0
  76. build/lib/vendor/urllib3/util/response.py +101 -0
  77. build/lib/vendor/urllib3/util/retry.py +533 -0
  78. build/lib/vendor/urllib3/util/ssl_.py +513 -0
  79. build/lib/vendor/urllib3/util/ssl_match_hostname.py +159 -0
  80. build/lib/vendor/urllib3/util/ssltransport.py +276 -0
  81. build/lib/vendor/urllib3/util/timeout.py +275 -0
  82. build/lib/vendor/urllib3/util/url.py +471 -0
  83. build/lib/vendor/urllib3/util/util.py +42 -0
  84. build/lib/vendor/urllib3/util/wait.py +124 -0
  85. catocli/__init__.py +1 -1
  86. catocli/parsers/custom/__init__.py +1 -1
  87. catocli/parsers/custom/customLib.py +1 -2
  88. catocli/parsers/mutation_admin/__init__.py +3 -3
  89. catocli/parsers/mutation_admin_addAdmin/README.md +1 -1
  90. catocli/parsers/mutation_admin_removeAdmin/README.md +1 -1
  91. catocli/parsers/mutation_admin_updateAdmin/README.md +1 -1
  92. catocli/parsers/mutation_container/__init__.py +1 -1
  93. catocli/parsers/mutation_container_delete/README.md +1 -1
  94. catocli/parsers/mutation_policy/__init__.py +24 -24
  95. catocli/parsers/mutation_policy_internetFirewall_addRule/README.md +1 -1
  96. catocli/parsers/mutation_policy_internetFirewall_addSection/README.md +1 -1
  97. catocli/parsers/mutation_policy_internetFirewall_createPolicyRevision/README.md +1 -1
  98. catocli/parsers/mutation_policy_internetFirewall_discardPolicyRevision/README.md +1 -1
  99. catocli/parsers/mutation_policy_internetFirewall_moveRule/README.md +1 -1
  100. catocli/parsers/mutation_policy_internetFirewall_moveSection/README.md +1 -1
  101. catocli/parsers/mutation_policy_internetFirewall_publishPolicyRevision/README.md +1 -1
  102. catocli/parsers/mutation_policy_internetFirewall_removeRule/README.md +1 -1
  103. catocli/parsers/mutation_policy_internetFirewall_removeSection/README.md +1 -1
  104. catocli/parsers/mutation_policy_internetFirewall_updatePolicy/README.md +1 -1
  105. catocli/parsers/mutation_policy_internetFirewall_updateRule/README.md +1 -1
  106. catocli/parsers/mutation_policy_internetFirewall_updateSection/README.md +1 -1
  107. catocli/parsers/mutation_policy_wanFirewall_addRule/README.md +1 -1
  108. catocli/parsers/mutation_policy_wanFirewall_addSection/README.md +1 -1
  109. catocli/parsers/mutation_policy_wanFirewall_createPolicyRevision/README.md +1 -1
  110. catocli/parsers/mutation_policy_wanFirewall_discardPolicyRevision/README.md +1 -1
  111. catocli/parsers/mutation_policy_wanFirewall_moveRule/README.md +1 -1
  112. catocli/parsers/mutation_policy_wanFirewall_moveSection/README.md +1 -1
  113. catocli/parsers/mutation_policy_wanFirewall_publishPolicyRevision/README.md +1 -1
  114. catocli/parsers/mutation_policy_wanFirewall_removeRule/README.md +1 -1
  115. catocli/parsers/mutation_policy_wanFirewall_removeSection/README.md +1 -1
  116. catocli/parsers/mutation_policy_wanFirewall_updatePolicy/README.md +1 -1
  117. catocli/parsers/mutation_policy_wanFirewall_updateRule/README.md +1 -1
  118. catocli/parsers/mutation_policy_wanFirewall_updateSection/README.md +1 -1
  119. catocli/parsers/mutation_site/__init__.py +15 -15
  120. catocli/parsers/mutation_site_addIpsecIkeV2Site/README.md +1 -1
  121. catocli/parsers/mutation_site_addIpsecIkeV2SiteTunnels/README.md +1 -1
  122. catocli/parsers/mutation_site_addNetworkRange/README.md +1 -1
  123. catocli/parsers/mutation_site_addSocketSite/README.md +1 -1
  124. catocli/parsers/mutation_site_addStaticHost/README.md +1 -1
  125. catocli/parsers/mutation_site_removeNetworkRange/README.md +1 -1
  126. catocli/parsers/mutation_site_removeSite/README.md +1 -1
  127. catocli/parsers/mutation_site_removeStaticHost/README.md +1 -1
  128. catocli/parsers/mutation_site_updateHa/README.md +1 -1
  129. catocli/parsers/mutation_site_updateIpsecIkeV2SiteGeneralDetails/README.md +1 -1
  130. catocli/parsers/mutation_site_updateIpsecIkeV2SiteTunnels/README.md +1 -1
  131. catocli/parsers/mutation_site_updateNetworkRange/README.md +1 -1
  132. catocli/parsers/mutation_site_updateSiteGeneralDetails/README.md +2 -2
  133. catocli/parsers/mutation_site_updateSocketInterface/README.md +1 -1
  134. catocli/parsers/mutation_site_updateStaticHost/README.md +1 -1
  135. catocli/parsers/mutation_sites/__init__.py +15 -15
  136. catocli/parsers/mutation_sites_addIpsecIkeV2Site/README.md +1 -1
  137. catocli/parsers/mutation_sites_addIpsecIkeV2SiteTunnels/README.md +1 -1
  138. catocli/parsers/mutation_sites_addNetworkRange/README.md +1 -1
  139. catocli/parsers/mutation_sites_addSocketSite/README.md +1 -1
  140. catocli/parsers/mutation_sites_addStaticHost/README.md +1 -1
  141. catocli/parsers/mutation_sites_removeNetworkRange/README.md +1 -1
  142. catocli/parsers/mutation_sites_removeSite/README.md +1 -1
  143. catocli/parsers/mutation_sites_removeStaticHost/README.md +1 -1
  144. catocli/parsers/mutation_sites_updateHa/README.md +1 -1
  145. catocli/parsers/mutation_sites_updateIpsecIkeV2SiteGeneralDetails/README.md +1 -1
  146. catocli/parsers/mutation_sites_updateIpsecIkeV2SiteTunnels/README.md +1 -1
  147. catocli/parsers/mutation_sites_updateNetworkRange/README.md +1 -1
  148. catocli/parsers/mutation_sites_updateSiteGeneralDetails/README.md +2 -2
  149. catocli/parsers/mutation_sites_updateSocketInterface/README.md +1 -1
  150. catocli/parsers/mutation_sites_updateStaticHost/README.md +1 -1
  151. catocli/parsers/query_accountBySubdomain/README.md +1 -1
  152. catocli/parsers/query_accountBySubdomain/__init__.py +1 -1
  153. catocli/parsers/query_accountMetrics/README.md +1 -1
  154. catocli/parsers/query_accountMetrics/__init__.py +1 -1
  155. catocli/parsers/query_accountRoles/README.md +1 -1
  156. catocli/parsers/query_accountRoles/__init__.py +1 -1
  157. catocli/parsers/query_accountSnapshot/README.md +1 -1
  158. catocli/parsers/query_accountSnapshot/__init__.py +1 -1
  159. catocli/parsers/query_admin/README.md +1 -1
  160. catocli/parsers/query_admin/__init__.py +1 -1
  161. catocli/parsers/query_admins/README.md +1 -1
  162. catocli/parsers/query_admins/__init__.py +1 -1
  163. catocli/parsers/query_appStats/README.md +1 -1
  164. catocli/parsers/query_appStats/__init__.py +1 -1
  165. catocli/parsers/query_appStatsTimeSeries/README.md +1 -1
  166. catocli/parsers/query_appStatsTimeSeries/__init__.py +1 -1
  167. catocli/parsers/query_auditFeed/README.md +1 -1
  168. catocli/parsers/query_auditFeed/__init__.py +1 -1
  169. catocli/parsers/query_container/README.md +1 -1
  170. catocli/parsers/query_container/__init__.py +1 -1
  171. catocli/parsers/query_entityLookup/README.md +1 -1
  172. catocli/parsers/query_entityLookup/__init__.py +1 -1
  173. catocli/parsers/query_events/README.md +1 -1
  174. catocli/parsers/query_events/__init__.py +1 -1
  175. catocli/parsers/query_eventsFeed/README.md +2 -2
  176. catocli/parsers/query_eventsFeed/__init__.py +1 -1
  177. catocli/parsers/query_eventsTimeSeries/README.md +1 -1
  178. catocli/parsers/query_eventsTimeSeries/__init__.py +1 -1
  179. catocli/parsers/query_hardwareManagement/README.md +1 -1
  180. catocli/parsers/query_hardwareManagement/__init__.py +1 -1
  181. catocli/parsers/query_licensing/README.md +1 -1
  182. catocli/parsers/query_licensing/__init__.py +1 -1
  183. catocli/parsers/query_policy/README.md +1 -1
  184. catocli/parsers/query_policy/__init__.py +1 -1
  185. catocli/parsers/query_siteLocation/README.md +1 -1
  186. catocli/parsers/query_siteLocation/__init__.py +1 -1
  187. catocli/parsers/query_subDomains/README.md +1 -1
  188. catocli/parsers/query_subDomains/__init__.py +1 -1
  189. catocli/parsers/query_xdr/__init__.py +2 -2
  190. catocli/parsers/query_xdr_stories/README.md +1 -1
  191. catocli/parsers/query_xdr_story/README.md +1 -1
  192. {catocli-1.0.11.dist-info → catocli-1.0.13.dist-info}/METADATA +1 -1
  193. catocli-1.0.13.dist-info/RECORD +344 -0
  194. {catocli-1.0.11.dist-info → catocli-1.0.13.dist-info}/top_level.txt +2 -0
  195. models/mutation.site.updateSiteGeneralDetails.json +57 -0
  196. models/mutation.sites.updateSiteGeneralDetails.json +57 -0
  197. models/query.accountMetrics.json +80 -0
  198. models/query.accountSnapshot.json +40 -0
  199. models/query.auditFeed.json +60 -0
  200. models/query.events.json +240 -0
  201. models/query.eventsFeed.json +60 -0
  202. models/query.eventsTimeSeries.json +180 -0
  203. schema/catolib.py +6 -6
  204. catocli-1.0.11.dist-info/RECORD +0 -261
  205. vendor/.DS_Store +0 -0
  206. {catocli-1.0.11.dist-info → catocli-1.0.13.dist-info}/LICENSE +0 -0
  207. {catocli-1.0.11.dist-info → catocli-1.0.13.dist-info}/WHEEL +0 -0
  208. {catocli-1.0.11.dist-info → catocli-1.0.13.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_appStats_parse(query_subparsers):
5
+ query_appStats_parser = query_subparsers.add_parser('appStats',
6
+ help='appStats() query operation',
7
+ usage=get_help("query_appStats"))
8
+
9
+ query_appStats_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_appStats_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_appStats_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_appStats_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_appStats_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_appStats_parser.set_defaults(func=createRequest,operation_name='query.appStats')
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_appStatsTimeSeries_parse(query_subparsers):
5
+ query_appStatsTimeSeries_parser = query_subparsers.add_parser('appStatsTimeSeries',
6
+ help='appStatsTimeSeries() query operation',
7
+ usage=get_help("query_appStatsTimeSeries"))
8
+
9
+ query_appStatsTimeSeries_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_appStatsTimeSeries_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_appStatsTimeSeries_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_appStatsTimeSeries_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_appStatsTimeSeries_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_appStatsTimeSeries_parser.set_defaults(func=createRequest,operation_name='query.appStatsTimeSeries')
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_auditFeed_parse(query_subparsers):
5
+ query_auditFeed_parser = query_subparsers.add_parser('auditFeed',
6
+ help='auditFeed() query operation',
7
+ usage=get_help("query_auditFeed"))
8
+
9
+ query_auditFeed_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_auditFeed_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_auditFeed_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_auditFeed_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_auditFeed_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_auditFeed_parser.set_defaults(func=createRequest,operation_name='query.auditFeed')
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_container_parse(query_subparsers):
5
+ query_container_parser = query_subparsers.add_parser('container',
6
+ help='container() query operation',
7
+ usage=get_help("query_container"))
8
+
9
+ query_container_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_container_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_container_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_container_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_container_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_container_parser.set_defaults(func=createRequest,operation_name='query.container')
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_entityLookup_parse(query_subparsers):
5
+ query_entityLookup_parser = query_subparsers.add_parser('entityLookup',
6
+ help='entityLookup() query operation',
7
+ usage=get_help("query_entityLookup"))
8
+
9
+ query_entityLookup_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_entityLookup_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_entityLookup_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_entityLookup_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_entityLookup_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_entityLookup_parser.set_defaults(func=createRequest,operation_name='query.entityLookup')
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_events_parse(query_subparsers):
5
+ query_events_parser = query_subparsers.add_parser('events',
6
+ help='events() query operation',
7
+ usage=get_help("query_events"))
8
+
9
+ query_events_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_events_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_events_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_events_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_events_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_events_parser.set_defaults(func=createRequest,operation_name='query.events')
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_eventsFeed_parse(query_subparsers):
5
+ query_eventsFeed_parser = query_subparsers.add_parser('eventsFeed',
6
+ help='eventsFeed() query operation',
7
+ usage=get_help("query_eventsFeed"))
8
+
9
+ query_eventsFeed_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_eventsFeed_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_eventsFeed_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_eventsFeed_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_eventsFeed_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_eventsFeed_parser.set_defaults(func=createRequest,operation_name='query.eventsFeed')
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_eventsTimeSeries_parse(query_subparsers):
5
+ query_eventsTimeSeries_parser = query_subparsers.add_parser('eventsTimeSeries',
6
+ help='eventsTimeSeries() query operation',
7
+ usage=get_help("query_eventsTimeSeries"))
8
+
9
+ query_eventsTimeSeries_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_eventsTimeSeries_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_eventsTimeSeries_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_eventsTimeSeries_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_eventsTimeSeries_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_eventsTimeSeries_parser.set_defaults(func=createRequest,operation_name='query.eventsTimeSeries')
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_hardwareManagement_parse(query_subparsers):
5
+ query_hardwareManagement_parser = query_subparsers.add_parser('hardwareManagement',
6
+ help='hardwareManagement() query operation',
7
+ usage=get_help("query_hardwareManagement"))
8
+
9
+ query_hardwareManagement_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_hardwareManagement_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_hardwareManagement_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_hardwareManagement_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_hardwareManagement_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_hardwareManagement_parser.set_defaults(func=createRequest,operation_name='query.hardwareManagement')
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_licensing_parse(query_subparsers):
5
+ query_licensing_parser = query_subparsers.add_parser('licensing',
6
+ help='licensing() query operation',
7
+ usage=get_help("query_licensing"))
8
+
9
+ query_licensing_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_licensing_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_licensing_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_licensing_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_licensing_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_licensing_parser.set_defaults(func=createRequest,operation_name='query.licensing')
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_policy_parse(query_subparsers):
5
+ query_policy_parser = query_subparsers.add_parser('policy',
6
+ help='policy() query operation',
7
+ usage=get_help("query_policy"))
8
+
9
+ query_policy_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_policy_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_policy_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_policy_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_policy_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_policy_parser.set_defaults(func=createRequest,operation_name='query.policy')
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import querySiteLocation, get_help
3
+
4
+ def query_siteLocation_parse(query_subparsers):
5
+ query_siteLocation_parser = query_subparsers.add_parser('siteLocation',
6
+ help='siteLocation local cli query',
7
+ usage=get_help("query_siteLocation"))
8
+
9
+ query_siteLocation_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_siteLocation_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_siteLocation_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_siteLocation_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_siteLocation_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_siteLocation_parser.set_defaults(func=querySiteLocation,operation_name='query.siteLocation')
@@ -0,0 +1,17 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_subDomains_parse(query_subparsers):
5
+ query_subDomains_parser = query_subparsers.add_parser('subDomains',
6
+ help='subDomains() query operation',
7
+ usage=get_help("query_subDomains"))
8
+
9
+ query_subDomains_parser.add_argument('json', help='Variables in JSON format.')
10
+ query_subDomains_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
11
+ query_subDomains_parser.add_argument('-t', const=True, default=False, nargs='?',
12
+ help='Print test request preview without sending api call')
13
+ query_subDomains_parser.add_argument('-v', const=True, default=False, nargs='?',
14
+ help='Verbose output')
15
+ query_subDomains_parser.add_argument('-p', const=True, default=False, nargs='?',
16
+ help='Pretty print')
17
+ query_subDomains_parser.set_defaults(func=createRequest,operation_name='query.subDomains')
@@ -0,0 +1,37 @@
1
+
2
+ from ..parserApiClient import createRequest, get_help
3
+
4
+ def query_xdr_parse(query_subparsers):
5
+ query_xdr_parser = query_subparsers.add_parser('xdr',
6
+ help='xdr() query operation',
7
+ usage=get_help("query_xdr"))
8
+
9
+ query_xdr_subparsers = query_xdr_parser.add_subparsers()
10
+
11
+ query_xdr_stories_parser = query_xdr_subparsers.add_parser('stories',
12
+ help='stories() xdr operation',
13
+ usage=get_help("query_xdr_stories"))
14
+
15
+ query_xdr_stories_parser.add_argument('json', help='Variables in JSON format.')
16
+ query_xdr_stories_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
17
+ query_xdr_stories_parser.add_argument('-t', const=True, default=False, nargs='?',
18
+ help='Print test request preview without sending api call')
19
+ query_xdr_stories_parser.add_argument('-v', const=True, default=False, nargs='?',
20
+ help='Verbose output')
21
+ query_xdr_stories_parser.add_argument('-p', const=True, default=False, nargs='?',
22
+ help='Pretty print')
23
+ query_xdr_stories_parser.set_defaults(func=createRequest,operation_name='query.xdr.stories')
24
+
25
+ query_xdr_story_parser = query_xdr_subparsers.add_parser('story',
26
+ help='story() xdr operation',
27
+ usage=get_help("query_xdr_story"))
28
+
29
+ query_xdr_story_parser.add_argument('json', help='Variables in JSON format.')
30
+ query_xdr_story_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
31
+ query_xdr_story_parser.add_argument('-t', const=True, default=False, nargs='?',
32
+ help='Print test request preview without sending api call')
33
+ query_xdr_story_parser.add_argument('-v', const=True, default=False, nargs='?',
34
+ help='Verbose output')
35
+ query_xdr_story_parser.add_argument('-p', const=True, default=False, nargs='?',
36
+ help='Pretty print')
37
+ query_xdr_story_parser.set_defaults(func=createRequest,operation_name='query.xdr.story')
@@ -0,0 +1,9 @@
1
+
2
+ from ..parserApiClient import createRawRequest, get_help
3
+
4
+ def raw_parse(raw_parser):
5
+ raw_parser.add_argument('json', help='Query, Variables and opertaionName in JSON format.')
6
+ raw_parser.add_argument('-t', const=True, default=False, nargs='?', help='Print test request preview without sending api call')
7
+ raw_parser.add_argument('-v', const=True, default=False, nargs='?', help='Verbose output')
8
+ raw_parser.add_argument('-p', const=True, default=False, nargs='?', help='Pretty print')
9
+ raw_parser.set_defaults(func=createRawRequest,operation_name='raw')
@@ -0,0 +1,11 @@
1
+ # coding: utf-8
2
+
3
+ from __future__ import absolute_import
4
+
5
+ # # import api into package
6
+ from graphql_client.api.call_api import CallApi
7
+
8
+ # import ApiClient
9
+ from graphql_client.api_client_types import ApiClient
10
+ from graphql_client.configuration import Configuration
11
+ from graphql_client.models.no_schema import NoSchema
@@ -0,0 +1,3 @@
1
+ from __future__ import absolute_import
2
+
3
+ from graphql_client.api.call_api import CallApi
@@ -0,0 +1,73 @@
1
+ # coding: utf-8
2
+
3
+ from __future__ import absolute_import
4
+ import re
5
+ import json
6
+
7
+ # python 2 and python 3 compatibility library
8
+ import sys
9
+ sys.path.insert(0, 'vendor')
10
+ import six
11
+ from graphql_client.api_client_types import ApiClient
12
+
13
+ class CallApi(object):
14
+ def __init__(self, api_client=None):
15
+ if api_client is None:
16
+ api_client = ApiClient()
17
+ self.api_client = api_client
18
+
19
+ def call_api(self, body, args, **kwargs): # noqa: E501
20
+ (data) = self.call_api_with_http_info(body, args, **kwargs) # noqa: E501
21
+ return data
22
+
23
+ def call_api_with_http_info(self, body, args, **kwargs): # noqa: E501
24
+ all_params = ['body', 'sync_type'] # noqa: E501
25
+ all_params.append('async_req')
26
+ if args.get("v")==True:
27
+ all_params.append('_return_http_data_only')
28
+ all_params.append('_preload_content')
29
+ all_params.append('_request_timeout')
30
+
31
+ params = locals()
32
+ for key, val in six.iteritems(params['kwargs']):
33
+ if key not in all_params:
34
+ raise TypeError(
35
+ "Got an unexpected keyword argument '%s'"
36
+ " to method create_asset4" % key
37
+ )
38
+ params[key] = val
39
+ del params['kwargs']
40
+
41
+ if ('body' not in params or params['body'] is None):
42
+ raise ValueError("Missing the required parameter `body` when calling `create_asset4`")
43
+
44
+ collection_formats = {}
45
+
46
+ header_params = {}
47
+
48
+ form_params = []
49
+ local_var_files = {}
50
+
51
+ body_params = None
52
+ if 'body' in params:
53
+ body_params = params['body']
54
+ header_params['Accept'] = self.api_client.select_header_accept(['application/json'])
55
+ header_params['Content-Type'] = self.api_client.select_header_content_type(['application/json'])
56
+ header_params['x-api-key'] = self.api_client.configuration.api_key['x-api-key']
57
+ header_params['User-Agent'] = "Cato-CLI-v"+self.api_client.configuration.version
58
+
59
+ if args.get("v")==True:
60
+ print("Host: ",self.api_client.configuration.host)
61
+ print("Request Headers:",json.dumps(header_params,indent=4,sort_keys=True))
62
+ print("Request Data:",json.dumps(body_params,indent=4,sort_keys=True),"\n\n")
63
+
64
+ return self.api_client.call_api(
65
+ header_params,
66
+ body=body_params,
67
+ files=local_var_files,
68
+ response_type="NoSchema", # noqa: E501
69
+ async_req=params.get('async_req'),
70
+ _return_http_data_only=params.get('_return_http_data_only'),
71
+ _preload_content=params.get('_preload_content', True),
72
+ _request_timeout=params.get('_request_timeout'),
73
+ collection_formats=collection_formats)
@@ -0,0 +1,192 @@
1
+ # coding: utf-8
2
+
3
+ from __future__ import absolute_import
4
+
5
+ import io
6
+ import json
7
+ import logging
8
+ import re
9
+ import ssl
10
+
11
+ # python 2 and python 3 compatibility library
12
+ import sys
13
+ sys.path.insert(0, 'vendor')
14
+ import certifi
15
+ import six
16
+ from six.moves.urllib.parse import urlencode
17
+
18
+ try:
19
+ import urllib3
20
+ except ImportError:
21
+ raise ImportError('GraphQL python client requires urllib3.')
22
+
23
+ logger = logging.getLogger(__name__)
24
+
25
+ class QUERYResponse(io.IOBase):
26
+
27
+ def __init__(self, resp):
28
+ self.urllib3_response = resp
29
+ self.status = resp.status
30
+ self.reason = resp.reason
31
+ self.data = resp.data
32
+
33
+ def getheaders(self):
34
+ """Returns a dictionary of the response headers."""
35
+ return self.urllib3_response.getheaders()
36
+
37
+ def getheader(self, name, default=None):
38
+ """Returns a given response header."""
39
+ return self.urllib3_response.getheader(name, default)
40
+
41
+ class QUERYClientObject(object):
42
+
43
+ def __init__(self, configuration, pools_size=4, maxsize=None):
44
+ # urllib3.PoolManager will pass all kw parameters to connectionpool
45
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
46
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
47
+ # maxsize is the number of requests to host that are allowed in parallel # noqa: E501
48
+ # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
49
+
50
+ # cert_reqs
51
+ if configuration.verify_ssl:
52
+ cert_reqs = ssl.CERT_REQUIRED
53
+ else:
54
+ cert_reqs = ssl.CERT_NONE
55
+
56
+ # ca_certs
57
+ if configuration.ssl_ca_cert:
58
+ ca_certs = configuration.ssl_ca_cert
59
+ else:
60
+ # if not set certificate file, use Mozilla's root certificates.
61
+ ca_certs = certifi.where()
62
+
63
+ addition_pool_args = {}
64
+ if configuration.assert_hostname is not None:
65
+ addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
66
+
67
+ if maxsize is None:
68
+ if configuration.connection_pool_maxsize is not None:
69
+ maxsize = configuration.connection_pool_maxsize
70
+ else:
71
+ maxsize = 4
72
+
73
+ # https pool manager
74
+ if configuration.proxy:
75
+ self.pool_manager = urllib3.ProxyManager(
76
+ num_pools=pools_size,
77
+ maxsize=maxsize,
78
+ cert_reqs=cert_reqs,
79
+ ca_certs=ca_certs,
80
+ cert_file=configuration.cert_file,
81
+ key_file=configuration.key_file,
82
+ proxy_url=configuration.proxy,
83
+ **addition_pool_args
84
+ )
85
+ else:
86
+ self.pool_manager = urllib3.PoolManager(
87
+ num_pools=pools_size,
88
+ maxsize=maxsize,
89
+ cert_reqs=cert_reqs,
90
+ ca_certs=ca_certs,
91
+ cert_file=configuration.cert_file,
92
+ key_file=configuration.key_file,
93
+ **addition_pool_args
94
+ )
95
+
96
+ def request(self, method, url, headers=None,
97
+ body=None, _preload_content=True,
98
+ _request_timeout=None):
99
+ """Perform requests.
100
+ :param headers: http request headers
101
+ :param body: request json body, for `application/json`
102
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
103
+ be returned without reading/decoding response
104
+ data. Default is True.
105
+ :param _request_timeout: timeout setting for this request. If one
106
+ number provided, it will be total request
107
+ timeout. It can also be a pair (tuple) of
108
+ (connection, read) timeouts.
109
+ """
110
+ method = method.upper()
111
+ assert method in ['POST']
112
+ headers = headers or {}
113
+
114
+ timeout = None
115
+ if _request_timeout:
116
+ if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821
117
+ timeout = urllib3.Timeout(total=_request_timeout)
118
+ elif (isinstance(_request_timeout, tuple) and
119
+ len(_request_timeout) == 2):
120
+ timeout = urllib3.Timeout(
121
+ connect=_request_timeout[0], read=_request_timeout[1])
122
+
123
+ if 'Content-Type' not in headers:
124
+ headers['Content-Type'] = 'application/json'
125
+
126
+ try:
127
+ if re.search('json', headers['Content-Type'], re.IGNORECASE):
128
+ try:
129
+ r = self.pool_manager.request( method=method, url=url,
130
+ body=json.dumps(body),
131
+ preload_content=_preload_content,
132
+ timeout=timeout,
133
+ headers=headers)
134
+ except Exception as e:
135
+ # remove the restriction for raw
136
+ print("ERROR: ",e)
137
+ exit()
138
+
139
+ else:
140
+ # Cannot generate the request from given parameters
141
+ msg = """Cannot prepare a request message for provided
142
+ arguments. Please check that your arguments match
143
+ declared content type."""
144
+ raise ApiException(status=0, reason=msg)
145
+
146
+ except urllib3.exceptions.SSLError as e:
147
+ msg = "{0}\n{1}".format(type(e).__name__, str(e))
148
+ raise ApiException(status=0, reason=msg)
149
+
150
+ if _preload_content:
151
+ r = QUERYResponse(r)
152
+
153
+ # log response body
154
+ logger.debug("response body: %s", r.data)
155
+
156
+ if not 200 <= r.status <= 299:
157
+ raise ApiException(http_resp=r)
158
+
159
+ return r
160
+
161
+ def POST(self, url, headers=None, body=None, _preload_content=True, _request_timeout=None):
162
+ return self.request("POST", url, headers=headers,
163
+ _preload_content=_preload_content,
164
+ _request_timeout=_request_timeout,
165
+ body=body)
166
+
167
+ class ApiException(Exception):
168
+
169
+ def __init__(self, status=None, reason=None, http_resp=None):
170
+ if http_resp:
171
+ self.status = http_resp.status
172
+ self.reason = http_resp.reason
173
+ self.body = http_resp.data
174
+ self.headers = http_resp.getheaders()
175
+ else:
176
+ self.status = status
177
+ self.reason = reason
178
+ self.body = None
179
+ self.headers = None
180
+
181
+ def __str__(self):
182
+ """Custom error messages for exception"""
183
+ if self.body:
184
+ # error_message += "HTTP response body:\n{}".format(self.body.decode('utf8'))
185
+ return self.body.decode('utf8')
186
+ else:
187
+ error_message = "({0})\n"\
188
+ "Reason: {1}\n".format(self.status, self.reason)
189
+ if self.headers:
190
+ error_message += "HTTP response headers: {0}\n".format(
191
+ self.headers)
192
+