Skip to content

Releases: ultradns/python_rest_api_client

v2.2.5

27 Feb 19:02
b133a94
Compare
Choose a tag to compare

New Feature(s)

Proxy Support & TLS Validation (PR#6)

  • Added support for making requests through a proxy.

  • Introduced a parameter to explicitly disable TLS validation when needed.

    >>> proxy_dict = {
    ...     "http": "http://192.168.1.243:9080",
    ...     "https": "http://192.168.1.243:9080"
    ... }
    >>> from ultra_rest_client import RestApiClient
    >>> client = RestApiClient('username', 'password', proxy=proxy_dict, verify_\
    https=False)
    >>> print(client.get_zones())
    {'queryInfo': {'q': '' ... } }
    
    mitmproxy  | [05:43:22.823][192.168.1.211:47424] client connect
    mitmproxy  | [05:43:22.849][192.168.1.211:47424] server connect api.ultradns.com:443 (3.86.127.106:443)
    mitmproxy  | 192.168.1.211:47424: POST https://api.ultradns.com/v1/authorization/token
    mitmproxy  |                   << 200 OK 304b
    mitmproxy  | [05:43:23.489][192.168.1.211:47424] client disconnect
    mitmproxy  | [05:43:23.490][192.168.1.211:47424] server disconnect api.ultradns.com:443 (3.86.127.106:443)
    mitmproxy  | [05:43:42.830][192.168.1.211:56532] client connect
    mitmproxy  | [05:43:42.857][192.168.1.211:56532] server connect api.ultradns.com:443 (35.175.76.156:443)
    mitmproxy  | 192.168.1.211:56532: GET https://api.ultradns.com/v1/zones
    mitmproxy  |                   << 200 OK 1.7k
    
  • TLS validation warnings are now suppressed by default.

  • Updated README.md with details on proxy usage and TLS validation options.

Resign Zone Method (PR#8)

  • Added a method to resign DNSSEC-signed zones in the client wrapper.

Support for RD Pools (PR#7)

  • Added a method for creating RD pools.

    Example Usage:

    # Demonstration of creating an A record RD pool
    client.create_rd_pool(
        "example.com", # Zone name
        "foo", # Hostname (owner)
        300, # TTL
        [
            "1.1.1.1", # List of rdata 
            "2.2.2.2", 
            "3.3.3.3"
        ]
    )
    
    # Demonstration of creating an AAAA pool
    client.create_rd_pool(
        "example.com", 
        "bar", 
        300, 
        [
            "2001:db8::1",
            "2001:db8::2", 
            "2001:db8::3"
        ], 
        ipv6=True, # Set AAAA to True
        order="RANDOM", # (Optional) Order of record distribution
        description="lorem ipsum" # (Optional) Description of pool
    )
  • Added a method for replacing existing RD pools (PUT).

    Example Usage:

    client.edit_rd_pool(
        "example.com", 
        "bar", 
        600, 
        [
            "2001:db8::2", 
            "2001:db8::3"
        ], 
        ipv6=True, 
        order="FIXED", 
        description="ipsum"
    )
  • Added a method for retrieving all RD pools.

    Example Usage:

    client.get_rd_pools("example.com")
  • Added a delete method for removing an RD pool.

    Example Usage:

    client.delete_rd_pool("example.com", "foo")
    client.delete_rd_pool("example.com", "bar", ipv6=True)
  • Updated README.md with RD pool example.

v2.2.4

25 Feb 03:59
Compare
Choose a tag to compare

Housekeeping

  • modified file structure to be more aligned with best practices
  • deleted old obsolete setup.py file
  • fixed license section of README.md (Issue#26)
  • updated .gitignore with common Python template
  • made RestApiConnection class available in __init__.py
  • fixed license_files in pyproject.toml (it excepts a list, not a dictionary)
  • fixed version in about.py

New Feature(s)

Issue#28

  • added constructors to RestApiClient and RestApiConnection classes to support custom HTTP headers (custom_headers)

    from ultra_rest_client import RestApiClient
    client = RestApiClient('username', 'password', custom_headers={"foo":"bar", "user-agent":"hello"})
    zones = client.get_zones()

    Captured header output:

    {
        "Accept": "application/json",
        "Authorization": "Bearer redacted",
        "Content-Type": "application/json",
        "foo": "bar",
        "user-agent": "hello",
        "User-Agent": "udns-python-rest-client-2.2.3"
    }
  • added a public method to RestApiConnection which allows modification of headers after client has been instantiated

    client.rest_api_connection.set_custom_headers({"boo":"far","user-agent":"goodbye"})
    zones = client.get_zones()

    Captured header output:

    {
        "Accept": "application/json",
        "Authorization": "Bearer redacted",
        "Content-Type": "application/json",
        "foo": "bar",
        "boo": "far",
        "user-agent": "goodbye",
        "User-Agent": "udns-python-rest-client-2.2.3"
    }
  • attempting to set the following headers will raise a ValueError

    • Content-Type
    • Authorization
    • Accept
  • updated README.md with example

v2.2.3

03 Dec 14:30
Compare
Choose a tag to compare

adjustments to handling of x-task-id background tasks

v2.2.2

14 Oct 13:29
Compare
Choose a tag to compare

_do_call () of the connection does not handle background tasks and ACCEPTED http response codes

New parameter added to RestAPIClient constructor: use_token: bool = False

RestApiClient(bu: str, pr: str = None, use_token: bool = False, use_http: bool =False, host: str = "api.ultradns.com")
Initialize a Rest API Client.
Arguments:
bu (str) -- Either username or bearer token based on use_token flag.
pr (str, optional) -- Either password or refresh token based on use_token flag. Defaults to None.
use_token (bool, optional) -- If True, treats bu as bearer token and pr as refresh token. Defaults to False.

Keyword Arguments:
use_http (bool, optional) -- For internal testing purposes only, lets developers use http instead of https.
host (str) -- Allows you to point to a server other than the production server.

Raises:
ValueError -- If pr is not provided when use_token is True.

v2.1.1

05 Apr 22:49
7c05cd7
Compare
Choose a tag to compare

updated company and contact information

v2.1.0

10 Feb 20:24
Compare
Choose a tag to compare
python module version increment

Adding v3 support for getting zones

13 May 13:32
404eb61
Compare
Choose a tag to compare

Introduced two new functions get_zones_v3() and get_zone_metadata_v3() in addition to already present functions get_zones() and get_zone_metadata().