catocli 2.0.3__py3-none-any.whl → 2.0.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of catocli might be problematic. Click here for more details.
- build/lib/catocli/Utils/clidriver.py +268 -0
- build/lib/catocli/Utils/profile_manager.py +188 -0
- build/lib/catocli/Utils/version_checker.py +192 -0
- build/lib/catocli/__init__.py +2 -0
- build/lib/catocli/__main__.py +12 -0
- build/lib/catocli/parsers/configure/__init__.py +115 -0
- build/lib/catocli/parsers/configure/configure.py +307 -0
- build/lib/catocli/parsers/custom/__init__.py +57 -0
- build/lib/catocli/parsers/custom/customLib.py +561 -0
- build/lib/catocli/parsers/custom/export_rules/__init__.py +42 -0
- build/lib/catocli/parsers/custom/export_rules/export_rules.py +234 -0
- build/lib/catocli/parsers/custom/export_sites/__init__.py +21 -0
- build/lib/catocli/parsers/custom/export_sites/export_sites.py +372 -0
- build/lib/catocli/parsers/custom/import_rules_to_tf/__init__.py +58 -0
- build/lib/catocli/parsers/custom/import_rules_to_tf/import_rules_to_tf.py +451 -0
- build/lib/catocli/parsers/custom/import_sites_to_tf/__init__.py +45 -0
- build/lib/catocli/parsers/custom/import_sites_to_tf/import_sites_to_tf.py +891 -0
- build/lib/catocli/parsers/mutation_accountManagement/__init__.py +48 -0
- build/lib/catocli/parsers/mutation_admin/__init__.py +48 -0
- build/lib/catocli/parsers/mutation_container/__init__.py +138 -0
- build/lib/catocli/parsers/mutation_hardware/__init__.py +22 -0
- build/lib/catocli/parsers/mutation_policy/__init__.py +1305 -0
- build/lib/catocli/parsers/mutation_sandbox/__init__.py +35 -0
- build/lib/catocli/parsers/mutation_site/__init__.py +373 -0
- build/lib/catocli/parsers/mutation_sites/__init__.py +373 -0
- build/lib/catocli/parsers/mutation_xdr/__init__.py +48 -0
- build/lib/catocli/parsers/parserApiClient.py +513 -0
- build/lib/catocli/parsers/query_accountBySubdomain/__init__.py +16 -0
- build/lib/catocli/parsers/query_accountManagement/__init__.py +16 -0
- build/lib/catocli/parsers/query_accountMetrics/__init__.py +16 -0
- build/lib/catocli/parsers/query_accountRoles/__init__.py +16 -0
- build/lib/catocli/parsers/query_accountSnapshot/__init__.py +16 -0
- build/lib/catocli/parsers/query_admin/__init__.py +16 -0
- build/lib/catocli/parsers/query_admins/__init__.py +16 -0
- build/lib/catocli/parsers/query_appStats/__init__.py +16 -0
- build/lib/catocli/parsers/query_appStatsTimeSeries/__init__.py +16 -0
- build/lib/catocli/parsers/query_auditFeed/__init__.py +16 -0
- build/lib/catocli/parsers/query_catalogs/__init__.py +16 -0
- build/lib/catocli/parsers/query_container/__init__.py +16 -0
- build/lib/catocli/parsers/query_devices/__init__.py +16 -0
- build/lib/catocli/parsers/query_entityLookup/__init__.py +16 -0
- build/lib/catocli/parsers/query_events/__init__.py +16 -0
- build/lib/catocli/parsers/query_eventsFeed/__init__.py +16 -0
- build/lib/catocli/parsers/query_eventsTimeSeries/__init__.py +16 -0
- build/lib/catocli/parsers/query_hardware/__init__.py +16 -0
- build/lib/catocli/parsers/query_hardwareManagement/__init__.py +16 -0
- build/lib/catocli/parsers/query_licensing/__init__.py +16 -0
- build/lib/catocli/parsers/query_policy/__init__.py +161 -0
- build/lib/catocli/parsers/query_sandbox/__init__.py +16 -0
- build/lib/catocli/parsers/query_site/__init__.py +100 -0
- build/lib/catocli/parsers/query_siteLocation/__init__.py +13 -0
- build/lib/catocli/parsers/query_subDomains/__init__.py +16 -0
- build/lib/catocli/parsers/query_xdr/__init__.py +35 -0
- build/lib/catocli/parsers/raw/__init__.py +12 -0
- build/lib/graphql_client/__init__.py +11 -0
- build/lib/graphql_client/api/__init__.py +3 -0
- build/lib/graphql_client/api/call_api.py +84 -0
- build/lib/graphql_client/api_client.py +192 -0
- build/lib/graphql_client/api_client_types.py +409 -0
- build/lib/graphql_client/configuration.py +232 -0
- build/lib/graphql_client/models/__init__.py +13 -0
- build/lib/graphql_client/models/no_schema.py +71 -0
- build/lib/schema/catolib.py +1141 -0
- build/lib/schema/importSchema.py +60 -0
- build/lib/schema/remove_policyid.py +89 -0
- build/lib/schema/remove_policyid_mutations.py +89 -0
- build/lib/scripts/catolib.py +62 -0
- build/lib/scripts/export_if_rules_to_json.py +188 -0
- build/lib/scripts/export_wf_rules_to_json.py +111 -0
- build/lib/scripts/import_wf_rules_to_tfstate.py +331 -0
- build/lib/vendor/certifi/__init__.py +4 -0
- build/lib/vendor/certifi/__main__.py +12 -0
- build/lib/vendor/certifi/core.py +114 -0
- build/lib/vendor/certifi/py.typed +0 -0
- build/lib/vendor/six.py +998 -0
- build/lib/vendor/urllib3/__init__.py +211 -0
- build/lib/vendor/urllib3/_base_connection.py +172 -0
- build/lib/vendor/urllib3/_collections.py +483 -0
- build/lib/vendor/urllib3/_request_methods.py +278 -0
- build/lib/vendor/urllib3/_version.py +16 -0
- build/lib/vendor/urllib3/connection.py +1033 -0
- build/lib/vendor/urllib3/connectionpool.py +1182 -0
- build/lib/vendor/urllib3/contrib/__init__.py +0 -0
- build/lib/vendor/urllib3/contrib/emscripten/__init__.py +18 -0
- build/lib/vendor/urllib3/contrib/emscripten/connection.py +254 -0
- build/lib/vendor/urllib3/contrib/emscripten/fetch.py +418 -0
- build/lib/vendor/urllib3/contrib/emscripten/request.py +22 -0
- build/lib/vendor/urllib3/contrib/emscripten/response.py +285 -0
- build/lib/vendor/urllib3/contrib/pyopenssl.py +552 -0
- build/lib/vendor/urllib3/contrib/socks.py +228 -0
- build/lib/vendor/urllib3/exceptions.py +321 -0
- build/lib/vendor/urllib3/fields.py +341 -0
- build/lib/vendor/urllib3/filepost.py +89 -0
- build/lib/vendor/urllib3/http2/__init__.py +53 -0
- build/lib/vendor/urllib3/http2/connection.py +356 -0
- build/lib/vendor/urllib3/http2/probe.py +87 -0
- build/lib/vendor/urllib3/poolmanager.py +637 -0
- build/lib/vendor/urllib3/py.typed +2 -0
- build/lib/vendor/urllib3/response.py +1265 -0
- build/lib/vendor/urllib3/util/__init__.py +42 -0
- build/lib/vendor/urllib3/util/connection.py +137 -0
- build/lib/vendor/urllib3/util/proxy.py +43 -0
- build/lib/vendor/urllib3/util/request.py +256 -0
- build/lib/vendor/urllib3/util/response.py +101 -0
- build/lib/vendor/urllib3/util/retry.py +533 -0
- build/lib/vendor/urllib3/util/ssl_.py +513 -0
- build/lib/vendor/urllib3/util/ssl_match_hostname.py +159 -0
- build/lib/vendor/urllib3/util/ssltransport.py +276 -0
- build/lib/vendor/urllib3/util/timeout.py +275 -0
- build/lib/vendor/urllib3/util/url.py +471 -0
- build/lib/vendor/urllib3/util/util.py +42 -0
- build/lib/vendor/urllib3/util/wait.py +124 -0
- catocli/Utils/clidriver.py +1 -4
- catocli/__init__.py +1 -1
- catocli/parsers/custom/export_rules/__init__.py +2 -0
- catocli/parsers/custom/export_rules/export_rules.py +29 -5
- catocli/parsers/custom/export_sites/__init__.py +1 -0
- catocli/parsers/custom/export_sites/export_sites.py +10 -3
- catocli/parsers/mutation_container/__init__.py +116 -0
- catocli/parsers/mutation_container_fqdn/README.md +7 -0
- catocli/parsers/mutation_container_fqdn_addValues/README.md +17 -0
- catocli/parsers/mutation_container_fqdn_createFromFile/README.md +17 -0
- catocli/parsers/mutation_container_fqdn_removeValues/README.md +17 -0
- catocli/parsers/mutation_container_fqdn_updateFromFile/README.md +17 -0
- catocli/parsers/mutation_container_ipAddressRange/README.md +7 -0
- catocli/parsers/mutation_container_ipAddressRange_addValues/README.md +17 -0
- catocli/parsers/mutation_container_ipAddressRange_createFromFile/README.md +17 -0
- catocli/parsers/mutation_container_ipAddressRange_removeValues/README.md +17 -0
- catocli/parsers/mutation_container_ipAddressRange_updateFromFile/README.md +17 -0
- catocli/parsers/mutation_policy_internetFirewall_addRule/README.md +1 -1
- catocli/parsers/mutation_policy_internetFirewall_updateRule/README.md +1 -1
- catocli/parsers/mutation_policy_wanFirewall_addRule/README.md +1 -1
- catocli/parsers/mutation_policy_wanFirewall_updateRule/README.md +1 -1
- catocli/parsers/parserApiClient.py +183 -7
- catocli/parsers/query_policy/README.md +0 -17
- catocli/parsers/query_policy/__init__.py +153 -8
- catocli/parsers/query_policy_appTenantRestriction/README.md +7 -0
- catocli/parsers/query_policy_appTenantRestriction_policy/README.md +17 -0
- catocli/parsers/query_policy_dynamicIpAllocation/README.md +7 -0
- catocli/parsers/query_policy_dynamicIpAllocation_policy/README.md +17 -0
- catocli/parsers/query_policy_internetFirewall/README.md +7 -0
- catocli/parsers/query_policy_internetFirewall_policy/README.md +17 -0
- catocli/parsers/query_policy_remotePortFwd/README.md +7 -0
- catocli/parsers/query_policy_remotePortFwd_policy/README.md +17 -0
- catocli/parsers/query_policy_socketLan/README.md +7 -0
- catocli/parsers/query_policy_socketLan_policy/README.md +17 -0
- catocli/parsers/query_policy_terminalServer/README.md +7 -0
- catocli/parsers/query_policy_terminalServer_policy/README.md +17 -0
- catocli/parsers/query_policy_wanFirewall/README.md +7 -0
- catocli/parsers/query_policy_wanFirewall_policy/README.md +17 -0
- catocli/parsers/query_policy_wanNetwork/README.md +7 -0
- catocli/parsers/query_policy_wanNetwork_policy/README.md +17 -0
- catocli/parsers/query_site/README.md +0 -16
- catocli/parsers/query_site/__init__.py +92 -8
- catocli/parsers/query_site_availableVersionList/README.md +17 -0
- catocli/parsers/query_site_bgpPeer/README.md +17 -0
- catocli/parsers/query_site_bgpPeerList/README.md +17 -0
- catocli/parsers/query_site_cloudInterconnectConnectionConnectivity/README.md +17 -0
- catocli/parsers/query_site_cloudInterconnectPhysicalConnection/README.md +17 -0
- catocli/parsers/query_site_cloudInterconnectPhysicalConnectionId/README.md +17 -0
- catocli/parsers/query_site_siteBgpStatus/README.md +17 -0
- {catocli-2.0.3.dist-info → catocli-2.0.5.dist-info}/METADATA +1 -1
- {catocli-2.0.3.dist-info → catocli-2.0.5.dist-info}/RECORD +291 -121
- {catocli-2.0.3.dist-info → catocli-2.0.5.dist-info}/top_level.txt +1 -0
- graphql_client/api/call_api.py +4 -3
- models/mutation.container.fqdn.addValues.json +866 -0
- models/mutation.container.fqdn.createFromFile.json +819 -0
- models/mutation.container.fqdn.removeValues.json +866 -0
- models/mutation.container.fqdn.updateFromFile.json +1045 -0
- models/mutation.container.ipAddressRange.addValues.json +1020 -0
- models/mutation.container.ipAddressRange.createFromFile.json +819 -0
- models/mutation.container.ipAddressRange.removeValues.json +1020 -0
- models/mutation.container.ipAddressRange.updateFromFile.json +1045 -0
- models/mutation.policy.appTenantRestriction.addRule.json +8 -8
- models/mutation.policy.appTenantRestriction.addSection.json +1 -1
- models/mutation.policy.appTenantRestriction.createPolicyRevision.json +2 -2
- models/mutation.policy.appTenantRestriction.discardPolicyRevision.json +2 -2
- models/mutation.policy.appTenantRestriction.moveRule.json +2 -2
- models/mutation.policy.appTenantRestriction.moveSection.json +1 -1
- models/mutation.policy.appTenantRestriction.publishPolicyRevision.json +2 -2
- models/mutation.policy.appTenantRestriction.removeRule.json +2 -2
- models/mutation.policy.appTenantRestriction.removeSection.json +1 -1
- models/mutation.policy.appTenantRestriction.updatePolicy.json +2 -2
- models/mutation.policy.appTenantRestriction.updateRule.json +8 -8
- models/mutation.policy.appTenantRestriction.updateSection.json +1 -1
- models/mutation.policy.dynamicIpAllocation.addRule.json +1 -1
- models/mutation.policy.dynamicIpAllocation.addSection.json +1 -1
- models/mutation.policy.dynamicIpAllocation.createPolicyRevision.json +1 -1
- models/mutation.policy.dynamicIpAllocation.discardPolicyRevision.json +1 -1
- models/mutation.policy.dynamicIpAllocation.moveRule.json +1 -1
- models/mutation.policy.dynamicIpAllocation.moveSection.json +1 -1
- models/mutation.policy.dynamicIpAllocation.publishPolicyRevision.json +1 -1
- models/mutation.policy.dynamicIpAllocation.removeRule.json +1 -1
- models/mutation.policy.dynamicIpAllocation.removeSection.json +1 -1
- models/mutation.policy.dynamicIpAllocation.updatePolicy.json +1 -1
- models/mutation.policy.dynamicIpAllocation.updateRule.json +1 -1
- models/mutation.policy.dynamicIpAllocation.updateSection.json +1 -1
- models/mutation.policy.internetFirewall.addRule.json +502 -55
- models/mutation.policy.internetFirewall.addSection.json +1 -1
- models/mutation.policy.internetFirewall.createPolicyRevision.json +127 -10
- models/mutation.policy.internetFirewall.discardPolicyRevision.json +127 -10
- models/mutation.policy.internetFirewall.moveRule.json +127 -10
- models/mutation.policy.internetFirewall.moveSection.json +1 -1
- models/mutation.policy.internetFirewall.publishPolicyRevision.json +127 -10
- models/mutation.policy.internetFirewall.removeRule.json +127 -10
- models/mutation.policy.internetFirewall.removeSection.json +1 -1
- models/mutation.policy.internetFirewall.updatePolicy.json +127 -10
- models/mutation.policy.internetFirewall.updateRule.json +493 -55
- models/mutation.policy.internetFirewall.updateSection.json +1 -1
- models/mutation.policy.remotePortFwd.addRule.json +5 -5
- models/mutation.policy.remotePortFwd.addSection.json +1 -1
- models/mutation.policy.remotePortFwd.createPolicyRevision.json +2 -2
- models/mutation.policy.remotePortFwd.discardPolicyRevision.json +2 -2
- models/mutation.policy.remotePortFwd.moveRule.json +2 -2
- models/mutation.policy.remotePortFwd.moveSection.json +1 -1
- models/mutation.policy.remotePortFwd.publishPolicyRevision.json +2 -2
- models/mutation.policy.remotePortFwd.removeRule.json +2 -2
- models/mutation.policy.remotePortFwd.removeSection.json +1 -1
- models/mutation.policy.remotePortFwd.updatePolicy.json +2 -2
- models/mutation.policy.remotePortFwd.updateRule.json +5 -5
- models/mutation.policy.remotePortFwd.updateSection.json +1 -1
- models/mutation.policy.socketLan.addRule.json +16 -16
- models/mutation.policy.socketLan.addSection.json +1 -1
- models/mutation.policy.socketLan.createPolicyRevision.json +4 -4
- models/mutation.policy.socketLan.discardPolicyRevision.json +4 -4
- models/mutation.policy.socketLan.moveRule.json +4 -4
- models/mutation.policy.socketLan.moveSection.json +1 -1
- models/mutation.policy.socketLan.publishPolicyRevision.json +4 -4
- models/mutation.policy.socketLan.removeRule.json +4 -4
- models/mutation.policy.socketLan.removeSection.json +1 -1
- models/mutation.policy.socketLan.updatePolicy.json +4 -4
- models/mutation.policy.socketLan.updateRule.json +16 -16
- models/mutation.policy.socketLan.updateSection.json +1 -1
- models/mutation.policy.terminalServer.addRule.json +1 -1
- models/mutation.policy.terminalServer.addSection.json +1 -1
- models/mutation.policy.terminalServer.createPolicyRevision.json +1 -1
- models/mutation.policy.terminalServer.discardPolicyRevision.json +1 -1
- models/mutation.policy.terminalServer.moveRule.json +1 -1
- models/mutation.policy.terminalServer.moveSection.json +1 -1
- models/mutation.policy.terminalServer.publishPolicyRevision.json +1 -1
- models/mutation.policy.terminalServer.removeRule.json +1 -1
- models/mutation.policy.terminalServer.removeSection.json +1 -1
- models/mutation.policy.terminalServer.updatePolicy.json +1 -1
- models/mutation.policy.terminalServer.updateRule.json +1 -1
- models/mutation.policy.terminalServer.updateSection.json +1 -1
- models/mutation.policy.wanFirewall.addRule.json +500 -53
- models/mutation.policy.wanFirewall.addSection.json +1 -1
- models/mutation.policy.wanFirewall.createPolicyRevision.json +128 -11
- models/mutation.policy.wanFirewall.discardPolicyRevision.json +128 -11
- models/mutation.policy.wanFirewall.moveRule.json +128 -11
- models/mutation.policy.wanFirewall.moveSection.json +1 -1
- models/mutation.policy.wanFirewall.publishPolicyRevision.json +128 -11
- models/mutation.policy.wanFirewall.removeRule.json +128 -11
- models/mutation.policy.wanFirewall.removeSection.json +1 -1
- models/mutation.policy.wanFirewall.updatePolicy.json +128 -11
- models/mutation.policy.wanFirewall.updateRule.json +491 -53
- models/mutation.policy.wanFirewall.updateSection.json +1 -1
- models/mutation.policy.wanNetwork.addRule.json +13 -13
- models/mutation.policy.wanNetwork.addSection.json +1 -1
- models/mutation.policy.wanNetwork.createPolicyRevision.json +1 -1
- models/mutation.policy.wanNetwork.discardPolicyRevision.json +1 -1
- models/mutation.policy.wanNetwork.moveRule.json +1 -1
- models/mutation.policy.wanNetwork.moveSection.json +1 -1
- models/mutation.policy.wanNetwork.publishPolicyRevision.json +1 -1
- models/mutation.policy.wanNetwork.removeRule.json +1 -1
- models/mutation.policy.wanNetwork.removeSection.json +1 -1
- models/mutation.policy.wanNetwork.updatePolicy.json +1 -1
- models/mutation.policy.wanNetwork.updateRule.json +13 -13
- models/mutation.policy.wanNetwork.updateSection.json +1 -1
- models/query.policy.appTenantRestriction.policy.json +3086 -0
- models/query.policy.dynamicIpAllocation.policy.json +1934 -0
- models/query.policy.internetFirewall.policy.json +7833 -0
- models/query.policy.json +233 -0
- models/query.policy.remotePortFwd.policy.json +2387 -0
- models/query.policy.socketLan.policy.json +7140 -0
- models/query.policy.terminalServer.policy.json +1632 -0
- models/query.policy.wanFirewall.policy.json +9212 -0
- models/query.policy.wanNetwork.policy.json +8010 -0
- models/query.site.availableVersionList.json +365 -0
- models/query.site.bgpPeer.json +1917 -0
- models/query.site.bgpPeerList.json +2076 -0
- models/query.site.cloudInterconnectConnectionConnectivity.json +298 -0
- models/query.site.cloudInterconnectPhysicalConnection.json +728 -0
- models/query.site.cloudInterconnectPhysicalConnectionId.json +660 -0
- models/query.site.siteBgpStatus.json +869 -0
- schema/catolib.py +13 -6
- schema/remove_policyid.py +89 -0
- schema/remove_policyid_mutations.py +89 -0
- {catocli-2.0.3.dist-info → catocli-2.0.5.dist-info}/LICENSE +0 -0
- {catocli-2.0.3.dist-info → catocli-2.0.5.dist-info}/WHEEL +0 -0
- {catocli-2.0.3.dist-info → catocli-2.0.5.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
from __future__ import absolute_import
|
|
4
|
+
|
|
5
|
+
import copy
|
|
6
|
+
import logging
|
|
7
|
+
import multiprocessing
|
|
8
|
+
import sys
|
|
9
|
+
sys.path.insert(0, 'vendor')
|
|
10
|
+
import urllib3
|
|
11
|
+
import six
|
|
12
|
+
from six.moves import http_client as httplib
|
|
13
|
+
|
|
14
|
+
class TypeWithDefault(type):
|
|
15
|
+
def __init__(cls, name, bases, dct):
|
|
16
|
+
super(TypeWithDefault, cls).__init__(name, bases, dct)
|
|
17
|
+
cls._default = None
|
|
18
|
+
|
|
19
|
+
def __call__(cls):
|
|
20
|
+
if cls._default is None:
|
|
21
|
+
cls._default = type.__call__(cls)
|
|
22
|
+
return copy.copy(cls._default)
|
|
23
|
+
|
|
24
|
+
def set_default(cls, default):
|
|
25
|
+
cls._default = copy.copy(default)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class Configuration(six.with_metaclass(TypeWithDefault, object)):
|
|
29
|
+
"""NOTE: This class is auto generated by the swagger code generator program.
|
|
30
|
+
|
|
31
|
+
Ref: https://github.com/swagger-api/swagger-codegen
|
|
32
|
+
Do not edit the class manually.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
def __init__(self):
|
|
36
|
+
"""Constructor"""
|
|
37
|
+
# Default Base url
|
|
38
|
+
# Temp file folder for downloading files
|
|
39
|
+
self.temp_folder_path = None
|
|
40
|
+
|
|
41
|
+
# Authentication Settings
|
|
42
|
+
# dict to store API key(s)
|
|
43
|
+
self.api_key = {}
|
|
44
|
+
# dict to store API prefix (e.g. Bearer)
|
|
45
|
+
self.api_key_prefix = {}
|
|
46
|
+
# function to refresh API key if expired
|
|
47
|
+
self.refresh_api_key_hook = None
|
|
48
|
+
# Username for HTTP basic authentication
|
|
49
|
+
self.username = ""
|
|
50
|
+
# Password for HTTP basic authentication
|
|
51
|
+
self.password = ""
|
|
52
|
+
# Logging Settings
|
|
53
|
+
self.logger = {}
|
|
54
|
+
self.logger["package_logger"] = logging.getLogger("swagger_client")
|
|
55
|
+
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
|
|
56
|
+
# Log format
|
|
57
|
+
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
|
|
58
|
+
# Log stream handler
|
|
59
|
+
self.logger_stream_handler = None
|
|
60
|
+
# Log file handler
|
|
61
|
+
self.logger_file_handler = None
|
|
62
|
+
# Debug file location
|
|
63
|
+
self.logger_file = None
|
|
64
|
+
# Debug switch
|
|
65
|
+
self.debug = False
|
|
66
|
+
|
|
67
|
+
# SSL/TLS verification
|
|
68
|
+
# Set this to false to skip verifying SSL certificate when calling API
|
|
69
|
+
# from https server.
|
|
70
|
+
self.verify_ssl = True
|
|
71
|
+
# Set this to customize the certificate file to verify the peer.
|
|
72
|
+
self.ssl_ca_cert = None
|
|
73
|
+
# client certificate file
|
|
74
|
+
self.cert_file = None
|
|
75
|
+
# client key file
|
|
76
|
+
self.key_file = None
|
|
77
|
+
# Set this to True/False to enable/disable SSL hostname verification.
|
|
78
|
+
self.assert_hostname = None
|
|
79
|
+
|
|
80
|
+
# urllib3 connection pool's maximum number of connections saved
|
|
81
|
+
# per pool. urllib3 uses 1 connection as default value, but this is
|
|
82
|
+
# not the best value when you are making a lot of possibly parallel
|
|
83
|
+
# requests to the same host, which is often the case here.
|
|
84
|
+
# cpu_count * 5 is used as default value to increase performance.
|
|
85
|
+
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
|
|
86
|
+
|
|
87
|
+
# Proxy URL
|
|
88
|
+
self.proxy = None
|
|
89
|
+
# Safe chars for path_param
|
|
90
|
+
self.safe_chars_for_path_param = ''
|
|
91
|
+
# Custom headers
|
|
92
|
+
self.custom_headers = {}
|
|
93
|
+
|
|
94
|
+
@property
|
|
95
|
+
def logger_file(self):
|
|
96
|
+
"""The logger file.
|
|
97
|
+
|
|
98
|
+
If the logger_file is None, then add stream handler and remove file
|
|
99
|
+
handler. Otherwise, add file handler and remove stream handler.
|
|
100
|
+
|
|
101
|
+
:param value: The logger_file path.
|
|
102
|
+
:type: str
|
|
103
|
+
"""
|
|
104
|
+
return self.__logger_file
|
|
105
|
+
|
|
106
|
+
@logger_file.setter
|
|
107
|
+
def logger_file(self, value):
|
|
108
|
+
"""The logger file.
|
|
109
|
+
|
|
110
|
+
If the logger_file is None, then add stream handler and remove file
|
|
111
|
+
handler. Otherwise, add file handler and remove stream handler.
|
|
112
|
+
|
|
113
|
+
:param value: The logger_file path.
|
|
114
|
+
:type: str
|
|
115
|
+
"""
|
|
116
|
+
self.__logger_file = value
|
|
117
|
+
if self.__logger_file:
|
|
118
|
+
# If set logging file,
|
|
119
|
+
# then add file handler and remove stream handler.
|
|
120
|
+
self.logger_file_handler = logging.FileHandler(self.__logger_file)
|
|
121
|
+
self.logger_file_handler.setFormatter(self.logger_formatter)
|
|
122
|
+
for _, logger in six.iteritems(self.logger):
|
|
123
|
+
logger.addHandler(self.logger_file_handler)
|
|
124
|
+
if self.logger_stream_handler:
|
|
125
|
+
logger.removeHandler(self.logger_stream_handler)
|
|
126
|
+
else:
|
|
127
|
+
# If not set logging file,
|
|
128
|
+
# then add stream handler and remove file handler.
|
|
129
|
+
self.logger_stream_handler = logging.StreamHandler()
|
|
130
|
+
self.logger_stream_handler.setFormatter(self.logger_formatter)
|
|
131
|
+
for _, logger in six.iteritems(self.logger):
|
|
132
|
+
logger.addHandler(self.logger_stream_handler)
|
|
133
|
+
if self.logger_file_handler:
|
|
134
|
+
logger.removeHandler(self.logger_file_handler)
|
|
135
|
+
|
|
136
|
+
@property
|
|
137
|
+
def debug(self):
|
|
138
|
+
"""Debug status
|
|
139
|
+
|
|
140
|
+
:param value: The debug status, True or False.
|
|
141
|
+
:type: bool
|
|
142
|
+
"""
|
|
143
|
+
return self.__debug
|
|
144
|
+
|
|
145
|
+
@debug.setter
|
|
146
|
+
def debug(self, value):
|
|
147
|
+
"""Debug status
|
|
148
|
+
|
|
149
|
+
:param value: The debug status, True or False.
|
|
150
|
+
:type: bool
|
|
151
|
+
"""
|
|
152
|
+
self.__debug = value
|
|
153
|
+
if self.__debug:
|
|
154
|
+
# if debug status is True, turn on debug logging
|
|
155
|
+
for _, logger in six.iteritems(self.logger):
|
|
156
|
+
logger.setLevel(logging.DEBUG)
|
|
157
|
+
# turn on httplib debug
|
|
158
|
+
httplib.HTTPConnection.debuglevel = 1
|
|
159
|
+
else:
|
|
160
|
+
# if debug status is False, turn off debug logging,
|
|
161
|
+
# setting log level to default `logging.WARNING`
|
|
162
|
+
for _, logger in six.iteritems(self.logger):
|
|
163
|
+
logger.setLevel(logging.WARNING)
|
|
164
|
+
# turn off httplib debug
|
|
165
|
+
httplib.HTTPConnection.debuglevel = 0
|
|
166
|
+
|
|
167
|
+
@property
|
|
168
|
+
def logger_format(self):
|
|
169
|
+
"""The logger format.
|
|
170
|
+
|
|
171
|
+
The logger_formatter will be updated when sets logger_format.
|
|
172
|
+
|
|
173
|
+
:param value: The format string.
|
|
174
|
+
:type: str
|
|
175
|
+
"""
|
|
176
|
+
return self.__logger_format
|
|
177
|
+
|
|
178
|
+
@logger_format.setter
|
|
179
|
+
def logger_format(self, value):
|
|
180
|
+
"""The logger format.
|
|
181
|
+
|
|
182
|
+
The logger_formatter will be updated when sets logger_format.
|
|
183
|
+
|
|
184
|
+
:param value: The format string.
|
|
185
|
+
:type: str
|
|
186
|
+
"""
|
|
187
|
+
self.__logger_format = value
|
|
188
|
+
self.logger_formatter = logging.Formatter(self.__logger_format)
|
|
189
|
+
|
|
190
|
+
def get_api_key_with_prefix(self, identifier):
|
|
191
|
+
"""Gets API key (with prefix if set).
|
|
192
|
+
|
|
193
|
+
:param identifier: The identifier of apiKey.
|
|
194
|
+
:return: The token for api key authentication.
|
|
195
|
+
"""
|
|
196
|
+
if self.refresh_api_key_hook:
|
|
197
|
+
self.refresh_api_key_hook(self)
|
|
198
|
+
|
|
199
|
+
key = self.api_key.get(identifier)
|
|
200
|
+
if key:
|
|
201
|
+
prefix = self.api_key_prefix.get(identifier)
|
|
202
|
+
if prefix:
|
|
203
|
+
return "%s %s" % (prefix, key)
|
|
204
|
+
else:
|
|
205
|
+
return key
|
|
206
|
+
|
|
207
|
+
def auth_settings(self):
|
|
208
|
+
"""Gets Auth Settings dict for api client.
|
|
209
|
+
|
|
210
|
+
:return: The Auth Settings information dict.
|
|
211
|
+
"""
|
|
212
|
+
return {
|
|
213
|
+
'auth_token':
|
|
214
|
+
{
|
|
215
|
+
'type': 'api_key',
|
|
216
|
+
'in': 'header',
|
|
217
|
+
'key': 'Authorization',
|
|
218
|
+
'value': self.api_key
|
|
219
|
+
},
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
def to_debug_report(self):
|
|
223
|
+
"""Gets the essential information for debugging.
|
|
224
|
+
|
|
225
|
+
:return: The report for debugging.
|
|
226
|
+
"""
|
|
227
|
+
return "Python SDK Debug Report:\n"\
|
|
228
|
+
"OS: {env}\n"\
|
|
229
|
+
"Python Version: {pyversion}\n"\
|
|
230
|
+
"Version of the API: 1.0.0\n"\
|
|
231
|
+
"SDK Package Version: 1.0.0".\
|
|
232
|
+
format(env=sys.platform, pyversion=sys.version)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
OpenAPI spec version: 1.0.0
|
|
6
|
+
|
|
7
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import absolute_import
|
|
11
|
+
|
|
12
|
+
# import models into model package
|
|
13
|
+
from graphql_client.models.no_schema import NoSchema
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
OpenAPI spec version: 1.0.0
|
|
5
|
+
|
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import pprint
|
|
10
|
+
import re # noqa: F401
|
|
11
|
+
|
|
12
|
+
# python 2 and python 3 compatibility library
|
|
13
|
+
import sys
|
|
14
|
+
sys.path.insert(0, 'vendor')
|
|
15
|
+
import six
|
|
16
|
+
|
|
17
|
+
class NoSchema(object):
|
|
18
|
+
swagger_types = {}
|
|
19
|
+
|
|
20
|
+
attribute_map = {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
def __init__(self): # noqa: E501
|
|
24
|
+
"""NoSchema - a model defined in Swagger""" # noqa: E501
|
|
25
|
+
self.discriminator = None
|
|
26
|
+
|
|
27
|
+
def to_dict(self):
|
|
28
|
+
"""Returns the model properties as a dict"""
|
|
29
|
+
result = {}
|
|
30
|
+
|
|
31
|
+
for attr, _ in six.iteritems(self.swagger_types):
|
|
32
|
+
value = getattr(self, attr)
|
|
33
|
+
if isinstance(value, list):
|
|
34
|
+
result[attr] = list(map(
|
|
35
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
36
|
+
value
|
|
37
|
+
))
|
|
38
|
+
elif hasattr(value, "to_dict"):
|
|
39
|
+
result[attr] = value.to_dict()
|
|
40
|
+
elif isinstance(value, dict):
|
|
41
|
+
result[attr] = dict(map(
|
|
42
|
+
lambda item: (item[0], item[1].to_dict())
|
|
43
|
+
if hasattr(item[1], "to_dict") else item,
|
|
44
|
+
value.items()
|
|
45
|
+
))
|
|
46
|
+
else:
|
|
47
|
+
result[attr] = value
|
|
48
|
+
if issubclass(NoSchema, dict):
|
|
49
|
+
for key, value in self.items():
|
|
50
|
+
result[key] = value
|
|
51
|
+
|
|
52
|
+
return result
|
|
53
|
+
|
|
54
|
+
def to_str(self):
|
|
55
|
+
"""Returns the string representation of the model"""
|
|
56
|
+
return pprint.pformat(self.to_dict())
|
|
57
|
+
|
|
58
|
+
def __repr__(self):
|
|
59
|
+
"""For `print` and `pprint`"""
|
|
60
|
+
return self.to_str()
|
|
61
|
+
|
|
62
|
+
def __eq__(self, other):
|
|
63
|
+
"""Returns true if both objects are equal"""
|
|
64
|
+
if not isinstance(other, NoSchema):
|
|
65
|
+
return False
|
|
66
|
+
|
|
67
|
+
return self.__dict__ == other.__dict__
|
|
68
|
+
|
|
69
|
+
def __ne__(self, other):
|
|
70
|
+
"""Returns true if both objects are not equal"""
|
|
71
|
+
return not self == other
|