{ "info": { "author": "Martin J. Levy", "author_email": "mahtin@mahtin.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "python-cloudflare3\r\n=================\r\n\r\nInstallation\r\n------------\r\n\r\nTwo methods are provided to install this software. Use PyPi (see\r\n`package `__ details) or GitHub\r\n(see `package `__\r\ndetails).\r\n\r\nVia PyPI\r\n~~~~~~~~\r\n\r\n.. code:: bash\r\n\r\n $ sudo pip install python-cloudflare3\r\n $\r\n\r\nYes - that simple! (the sudo may not be needed in some cases).\r\n\r\nVia github\r\n~~~~~~~~~~\r\n\r\n.. code:: bash\r\n\r\n $ git clone https://github.com/dmyerscough/python-cloudflare\r\n $ cd python-cloudflare\r\n $ ./setup.py build\r\n $ sudo ./setup.py install\r\n $\r\n\r\nOr whatever variance of that you want to use.\r\n\r\nCloudFlare API version 4\r\n------------------------\r\n\r\nThe CloudFlare API can be found `here `__.\r\nEach API call is provided via a similarly named function within the\r\n*CloudFlare* class. A full list is provided below.\r\n\r\nGetting Started\r\n---------------\r\n\r\nA very simple listing of zones within your account; including the IPv6\r\nstatus of the zone.\r\n\r\n.. code:: python\r\n\r\n import CloudFlare\r\n\r\n def main():\r\n cf = CloudFlare.CloudFlare()\r\n zones = cf.zones.get(params = {'per_page':50})\r\n for zone in zones:\r\n zone_name = zone['name']\r\n zone_id = zone['id']\r\n settings_ipv6 = cf.zones.settings.ipv6.get(zone_id)\r\n ipv6_status = settings_ipv6['value']\r\n settings_ssl = cf.zones.settings.ssl.get(zone_id)\r\n ssl_status = settings_ssl['value']\r\n print zone_id, ssl_status, ipv6_status, zone_name\r\n\r\n if __name__ == '__main__':\r\n main()\r\n\r\nA more complex example follows.\r\n\r\n.. code:: python\r\n\r\n import sys\r\n import CloudFlare\r\n\r\n def main():\r\n zone_name = 'example.com'\r\n\r\n cf = CloudFlare.CloudFlare()\r\n\r\n # query for the zone name and expect only one value back\r\n try:\r\n zones = cf.zones.get(params = {'name':zone_name,'per_page':1})\r\n except CloudFlare.CloudFlareAPIError as e:\r\n exit('/zones.get %d %s - api call failed' % (e, e))\r\n except Exception as e:\r\n exit('/zones.get - %s - api call failed' % (e))\r\n\r\n # extract the zone_id which is needed to process that zone\r\n zone = zones[0]\r\n zone_id = zone['id']\r\n\r\n # request the DNS records from that zone\r\n try:\r\n dns_records = cf.zones.dns_records.get(zone_id)\r\n except CloudFlare.CloudFlareAPIError as e:\r\n exit('/zones/dns_records.get %d %s - api call failed' % (e, e))\r\n\r\n # print the results - first the zone name\r\n print zone_id, zone_name\r\n\r\n # then all the DNS records for that zone\r\n for dns_record in dns_records:\r\n r_name = dns_record['name']\r\n r_type = dns_record['type']\r\n r_value = dns_record['content']\r\n r_id = dns_record['id']\r\n print '\\t', r_id, r_name, r_type, r_value\r\n\r\n exit(0)\r\n\r\n if __name__ == '__main__':\r\n main()\r\n\r\nProviding CloudFlare Username and API Key\r\n-----------------------------------------\r\n\r\nWhen you create a *CloudFlare* class you can pass up to three\r\nparamaters.\r\n\r\n- Account email\r\n- Account API key\r\n- Optional Debug flag (True/False)\r\n\r\nIf the account email and API key are not passed when you create the\r\nclass, then they are retreived from either the users exported shell\r\nenvironment variables or the .cloudflare.cfg or ~/.cloudflare.cfg or\r\n~/.cloudflare/cloudflare.cfg files, in that order.\r\n\r\nThere is one call that presently doesn't need any email or token\r\ncertification (the */ips* call); hence you can test without any values\r\nsaved away.\r\n\r\nUsing shell environment variables\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\n.. code:: bash\r\n\r\n $ export CF_API_EMAIL='user@example.com'\r\n $ export CF_API_KEY='00000000000000000000000000000000'\r\n $ export CF_API_CERTKEY='v1.0-...'\r\n $\r\n\r\nUsing configuration file to store email and keys\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\n.. code:: bash\r\n\r\n $ cat ~/.cloudflare/cloudflare.cfg\r\n [CloudFlare]\r\n email = user@example.com\r\n token = 00000000000000000000000000000000\r\n certoken = v1.0-...\r\n $\r\n\r\nThe *CF\\_API\\_CERTKEY* or *certtoken* values are used for the Origin-CA\r\n*/certificates* API calls.\r\n\r\nIncluded example code\r\n---------------------\r\n\r\nThe *examples* folder contains many examples in both simple and verbose\r\nformats.\r\n\r\nA DNS zone code example\r\n-----------------------\r\n\r\n.. code:: python\r\n\r\n #!/usr/bin/env python\r\n\r\n import sys\r\n import CloudFlare\r\n\r\n def main():\r\n zone_name = sys.argv[1]\r\n cf = CloudFlare.CloudFlare()\r\n zone_info = cf.zones.post(data={'jump_start':False, 'name': zone_name})\r\n zone_id = zone_info['id']\r\n\r\n dns_records = [\r\n {'name':'foo', 'type':'AAAA', 'content':'2001:d8b::1'},\r\n {'name':'foo', 'type':'A', 'content':'192.168.0.1'},\r\n {'name':'duh', 'type':'A', 'content':'10.0.0.1', 'ttl':120},\r\n {'name':'bar', 'type':'CNAME', 'content':'foo'},\r\n {'name':'shakespeare', 'type':'TXT', 'content':\"What's in a name? That which we call a rose by any other name ...\"}\r\n ]\r\n\r\n for dns_record in dns_records:\r\n r = cf.zones.dns_records.post(zone_id, data=dns_record)\r\n exit(0)\r\n\r\n if __name__ == '__main__':\r\n main()\r\n\r\nCLI\r\n---\r\n\r\nAll API calls can be called from the command line. The command will\r\nconvert domain names on-the-fly into zone\\_identifier's.\r\n\r\n.. code:: bash\r\n\r\n $ cli4 [-h|--help] [-v|--verbose] [-q|--quiet] [--get|--patch|--post|-put|--delete] [item=value ...] /command...\r\n\r\nFor API calls that need a set of date or parameters passed there is a\r\nitem=value format. If you want a numeric value passed, then *==* can be\r\nused to force the value to be treated as a numeric value.\r\n\r\nThe output from the CLI command is in json format (and human readable).\r\n\r\nSimple CLI examples\r\n~~~~~~~~~~~~~~~~~~~\r\n\r\n- ``cli4 /user/billing/profile``\r\n- ``cli4 /user/invites``\r\n\r\n- ``cli4 /zones/:example.com``\r\n- ``cli4 /zones/:example.com/dnssec``\r\n- ``cli4 /zones/:example.com/settings/ipv6``\r\n- ``cli4 --put /zones/:example.com/activation_check``\r\n- ``cli4 /zones/:example.com/keyless_certificates``\r\n\r\n- ``cli4 /zones/:example.com/analytics/dashboard``\r\n\r\nMore complex CLI examples\r\n~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nHere is the creation of a DNS entry, followed by a listing of that entry\r\nand then the deletion of that entry.\r\n\r\n.. code:: bash\r\n\r\n $ $ cli4 --post name=\"test\" type=\"A\" content=\"10.0.0.1\" /zones/:example.com/dns_records\r\n {\r\n \"id\": \"94e028933c87b4bff3c70a42e6daac4f\",\r\n \"name\": \"test.example.com\",\r\n \"type\": \"A\",\r\n \"content\": \"10.0.0.1\",\r\n ...\r\n }\r\n $\r\n\r\n $ cli4 /zones/:example.com/dns_records/:test.example.com | jq '{\"id\":.id,\"name\":.name,\"type\":.type,\"content\":.content}'\r\n {\r\n \"id\": \"94e028933c87b4bff3c70a42e6daac4f\",\r\n \"name\": \"test.example.com\",\r\n \"type\": \"A\",\r\n \"content\": \"10.0.0.1\"\r\n }\r\n\r\n $ cli4 --delete /zones/:example.com/dns_records/:test.example.com | jq -c .\r\n {\"id\":\"94e028933c87b4bff3c70a42e6daac4f\"}\r\n $\r\n\r\nThere's the ability to handle dns entries with multiple values. This\r\nproduces more than one API call within the command.\r\n\r\n::\r\n\r\n $ cli4 /zones/:example.com/dns_records/:test.example.com | jq -c '.[]|{\"id\":.id,\"name\":.name,\"type\":.type,\"content\":.content}'\r\n {\"id\":\"bca0c4a5e3691e62841627e4dc3a19ed\",\"name\":\"test.example.com\",\"type\":\"A\",\"content\":\"192.168.0.1\"}\r\n {\"id\":\"d94f788e6bf72ba2a54145ad04b34f08\",\"name\":\"test.example.com\",\"type\":\"AAAA\",\"content\":\"2001:d8b::1\"}\r\n $\r\n\r\nHere are the cache purging commands.\r\n\r\n.. code:: bash\r\n\r\n $ cli4 --delete purge_everything=true /zones/:example.com/purge_cache | jq -c .\r\n {\"id\":\"d8afaec3dd2b7f8c1b470e594a21a01d\"}\r\n $\r\n\r\n $ cli4 --delete files='[http://example.com/css/styles.css]' /zones/:example.com/purge_cache | jq -c .\r\n {\"id\":\"d8afaec3dd2b7f8c1b470e594a21a01d\"}\r\n $\r\n\r\n $ cli4 --delete files='[http://example.com/css/styles.css,http://example.com/js/script.js]' /zones/:example.com/purge_cache | jq -c .\r\n {\"id\":\"d8afaec3dd2b7f8c1b470e594a21a01d\"}\r\n $\r\n\r\n $ cli4 --delete tags='[tag1,tag2,tag3]' /zones/:example.com/purge_cache | jq -c .\r\n cli4: /zones/:example.com/purge_cache - 1107 Only enterprise zones can purge by tag.\r\n $\r\n\r\nA somewhat useful listing of available plans for a specific zone.\r\n\r\n.. code:: bash\r\n\r\n $ cli4 /zones/:example.com/available_plans | jq -c '.[]|{\"id\":.id,\"name\":.name}'\r\n {\"id\":\"a577b510288e82b26486fd1df47000ec\",\"name\":\"Pro Website\"}\r\n {\"id\":\"1ac039f6c29b691475c3d74fe588d1ae\",\"name\":\"Business Website\"}\r\n {\"id\":\"94f3b7b768b0458b56d2cac4fe5ec0f9\",\"name\":\"Enterprise Website\"}\r\n {\"id\":\"0feeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"name\":\"Free Website\"}\r\n $\r\n\r\nDNSSEC CLI examples\r\n~~~~~~~~~~~~~~~~~~~\r\n\r\n.. code:: bash\r\n\r\n $ cli4 /zones/:example.com/dnssec | jq -c '{\"status\":.status}'\r\n {\"status\":\"disabled\"}\r\n $\r\n\r\n $ cli4 --patch status=active /zones/:example.com/dnssec | jq -c '{\"status\":.status}'\r\n {\"status\":\"pending\"}\r\n $\r\n\r\n $ cli4 /zones/:example.com/dnssec\r\n {\r\n \"algorithm\": \"13\",\r\n \"digest\": \"41600621c65065b09230ebc9556ced937eb7fd86e31635d0025326ccf09a7194\",\r\n \"digest_algorithm\": \"SHA256\",\r\n \"digest_type\": \"2\",\r\n \"ds\": \"example.com. 3600 IN DS 2371 13 2 41600621c65065b09230ebc9556ced937eb7fd86e31635d0025326ccf09a7194\",\r\n \"flags\": 257,\r\n \"key_tag\": 2371,\r\n \"key_type\": \"ECDSAP256SHA256\",\r\n \"modified_on\": \"2016-05-01T22:42:15.591158Z\",\r\n \"public_key\": \"mdsswUyr3DPW132mOi8V9xESWE8jTo0dxCjjnopKl+GqJxpVXckHAeF+KkxLbxILfDLUT0rAK9iUzy1L53eKGQ==\",\r\n \"status\": \"pending\"\r\n }\r\n $\r\n\r\nImplemented API calls\r\n---------------------\r\n\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | ``PUT`` | ``POST`` | ``PATCH`` | ``DELETE`` | API call |\r\n+===========+===========+============+=============+==============+===============================================================+\r\n| ``GET`` | | ``POST`` | | ``DELETE`` | /certificates |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /ips |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /organizations |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | ``POST`` | ``PATCH`` | ``DELETE`` | /organizations/:identifier/firewall/access\\_rules/rules |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| | | | ``PATCH`` | | /organizations/:identifier/invite |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | ``POST`` | | ``DELETE`` | /organizations/:identifier/invites |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | ``DELETE`` | /organizations/:identifier/members |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | ``POST`` | ``PATCH`` | ``DELETE`` | /organizations/:identifier/railguns |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /organizations/:identifier/railguns/:identifier/zones |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /organizations/:identifier/roles |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | ``POST`` | ``PATCH`` | ``DELETE`` | /organizations/:identifier/virtual\\_dns |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | ``POST`` | ``PATCH`` | ``DELETE`` | /railguns |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /railguns/:identifier/zones |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /user |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /user/billing/history |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /user/billing/profile |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /user/billing/subscriptions/apps |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /user/billing/subscriptions/zones |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | ``POST`` | ``PATCH`` | ``DELETE`` | /user/firewall/access\\_rules/rules |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /user/invites |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | ``DELETE`` | /user/organizations |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | ``POST`` | ``PATCH`` | ``DELETE`` | /user/virtual\\_dns |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | ``POST`` | ``PATCH`` | ``DELETE`` | /zones |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| | ``PUT`` | | | | /zones/:identifier/activation\\_check |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /zones/:identifier/analytics/colos |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /zones/:identifier/analytics/dashboard |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /zones/:identifier/available\\_plans |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| | ``PUT`` | | | | /zones/:identifier/custom\\_certificates/prioritize |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | ``POST`` | ``PATCH`` | ``DELETE`` | /zones/:identifier/custom\\_certificates |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | ``PUT`` | | | | /zones/:identifier/custom\\_pages |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | ``PUT`` | ``POST`` | | ``DELETE`` | /zones/:identifier/dns\\_records |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/firewall/waf/packages/:identifier/groups |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/firewall/waf/packages/:identifier/rules |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/firewall/waf/packages |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | ``POST`` | ``PATCH`` | ``DELETE`` | /zones/:identifier/firewall/access\\_rules/rules |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | ``POST`` | ``PATCH`` | ``DELETE`` | /zones/:identifier/keyless\\_certificates |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | ``PUT`` | ``POST`` | ``PATCH`` | ``DELETE`` | /zones/:identifier/pagerules |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| | | | | ``DELETE`` | /zones/:identifier/purge\\_cache |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /zones/:identifier/railguns/:identifier/diagnose |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/railguns |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | | | /zones/:identifier/settings/advanced\\_ddos |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/always\\_online |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/browser\\_cache\\_ttl |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/browser\\_check |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/cache\\_level |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/challenge\\_ttl |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/development\\_mode |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/email\\_obfuscation |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/hotlink\\_protection |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/ip\\_geolocation |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/ipv6 |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/minify |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/mirage |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/mobile\\_redirect |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/origin\\_error\\_page\\_pass\\_thru |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/polish |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/prefetch\\_preload |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/response\\_buffering |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/rocket\\_loader |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/security\\_header |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/security\\_level |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/server\\_side\\_exclude |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/sort\\_query\\_string\\_for\\_cache |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/ssl |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/tls\\_1\\_2\\_only |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/tls\\_client\\_auth |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/true\\_client\\_ip\\_header |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n| ``GET`` | | | ``PATCH`` | | /zones/:identifier/settings/waf |\r\n+-----------+-----------+------------+-------------+--------------+---------------------------------------------------------------+\r\n\r\nAdding extra API calls manually\r\n-------------------------------\r\n\r\nExtra API calls can be added via the configuration file\r\n\r\n.. code:: bash\r\n\r\n $ cat ~/.cloudflare/cloudflare.cfg\r\n [CloudFlare]\r\n extras=\r\n /client/v4/command\r\n /client/v4/command/:command_identifier\r\n /client/v4/command/:command_identifier/settings\r\n $\r\n\r\nWhile it's easy to call anything within CloudFlare's API, it's not very\r\nuseful to add items in here as they will simply return API URL errors.\r\nTechnically, this is only useful for internal testing within CloudFlare.\r\n\r\nIssues\r\n------\r\n\r\nThe following error can be caused by an out of date SSL/TLS library\r\nand/or out of date Python.\r\n\r\n::\r\n\r\n /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.\r\n SNIMissingWarning\r\n /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.\r\n InsecurePlatformWarning\r\n\r\nThe solution can be found\r\n`here `__\r\nand/or\r\n`here `__.\r\n\r\nCredit\r\n------\r\n\r\nThis is based on work by `Felix Wong\r\n(gnowxilef) `__ found\r\n`here `__. It\r\nhas been seriously expanded upon.\r\n\r\nCopyright\r\n---------\r\n\r\nPortions copyright `Felix Wong\r\n(gnowxilef) `__ 2015 and CloudFlare 2016.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dmyerscough/python-cloudflare", "keywords": "cloudflare", "license": "MIT", "maintainer": "Damian Myerscough", "maintainer_email": "Damian.Myerscough@gmail.com", "name": "python-cloudflare3", "package_url": "https://pypi.org/project/python-cloudflare3/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-cloudflare3/", "project_urls": { "Homepage": "https://github.com/dmyerscough/python-cloudflare" }, "release_url": "https://pypi.org/project/python-cloudflare3/1.0.2/", "requires_dist": null, "requires_python": null, "summary": "Python wrapper for the CloudFlare v4 API", "version": "1.0.2" }, "last_serial": 2167959, "releases": { "1.0.2": [] }, "urls": [] }