{"id":42283,"date":"2026-01-29T08:10:00","date_gmt":"2026-01-29T07:10:00","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=42283"},"modified":"2026-06-28T06:00:56","modified_gmt":"2026-06-28T04:00:56","slug":"goldengate-rest-api-basics-with-python","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/","title":{"rendered":"GoldenGate REST API basics with Python"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Oracle GoldenGate REST API has been around for quite some time now, but I&#8217;ve yet to see it used in practice at customers. Every time I tried to introduce it, it was some sort of novelty. Mainly because DBAs tend to dislike automation, but also for technical reasons. Even though <strong>the REST API was introduced in GoldenGate 12c<\/strong> with the Microservices Architecture, some customers are still stuck with the Classic Architecture. As a reminder, the classic architecture is now completely absent from the 23ai version (<a href=\"https:\/\/www.dbi-services.com\/blog\/planning-goldengate-migration-before-premier-support-expires\/\" target=\"_blank\" rel=\"noreferrer noopener\">plan your migration<\/a> now !).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That being said, <strong>where to start<\/strong> when using the GoldenGate REST API? Oracle has some <a href=\"https:\/\/docs.oracle.com\/en\/database\/goldengate\/core\/26\/coredoc\/upgrading-oracle-goldengate-microservices-rest-api.html\" target=\"_blank\" rel=\"noreferrer noopener\">basic documentation<\/a> using <code>curl<\/code>, but I want to take things a bit further by <strong>leveraging the power of Python<\/strong>, starting with basic requests.<\/p>\n\n\n\n<h2 id=\"h-make-your-first-request-to-the-goldengate-rest-api\" class=\"wp-block-heading\">Make your first request to the GoldenGate REST API<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you really have no idea what a REST API is, there are tons of excellent articles online for you to get into it. Getting back to the basics, in Python, the <code>requests<\/code> module will <strong>handle the API calls<\/strong> for us.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The most basic REST API call would look like what I show below. Adapt the credentials, and the service manager host and port.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport requests\n\nurl = &quot;http:\/\/vmogg:7809\/services&quot;\nauth = (&quot;ogg_user&quot;, &quot;ogg_password&quot;)\nresult = requests.get(url, auth=auth)\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Until now, nothing fascinating, but with the 200 return code below, we know that the call succeeded. The <code>ok<\/code> flag gives us the <strong>status of the call<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; result\n&lt;Response &#091;200]&gt;\n&gt;&gt;&gt; result.ok\nTrue<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And to <strong>get the real data<\/strong> returned by the API, use the <code>json<\/code> method.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; result.json()\n{'$schema': 'api:versions', 'links': &#091;{'rel': 'current', 'href': 'http:\/\/vmogg:7809\/services\/v2', 'mediaType': 'application\/json'}, {'rel': 'canonical', 'href': 'http:\/\/vmogg:7809\/services', 'mediaType': 'application\/json'}, {'rel': 'self', 'href': 'http:\/\/vmogg:7809\/services', 'mediaType': 'application\/json'}], 'items': &#091;{'$schema': 'api:version', 'version': 'v2', 'isLatest': True, 'lifecycle': 'active', 'catalog': {'links': &#091;{'rel': 'canonical', 'href': 'http:\/\/vmogg:7809\/services\/v2\/metadata-catalog', 'mediaType': 'application\/json'}]}}]}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Up until that point, you are successfully making API connections to your GoldenGate service manager, but nothing more. What you need to change is the URL, and more specifically the endpoint.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>\/services<\/code> is called an <em>endpoint<\/em>, and the <strong>full list of endpoints<\/strong> can be found in the <a href=\"https:\/\/docs.oracle.com\/en\/middleware\/goldengate\/core\/23\/oggra\/rest-endpoints.html\" target=\"_blank\" rel=\"noreferrer noopener\">GoldenGate documentation<\/a>. Not all of them are useful, but when looking for a specific GoldenGate action, this endpoint library is a good starting point.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For instance, to get the <strong><a href=\"https:\/\/docs.oracle.com\/en\/database\/goldengate\/core\/26\/oggra\/op-services-version-deployments-get.html\" target=\"_blank\" rel=\"noreferrer noopener\">list of all the deployments<\/a><\/strong> associated with your service manager, use the <code>\/services\/v2\/deployments<\/code> endpoint. If you get an <code>OGG-12064<\/code> error, it means that the credentials are not correct (they were technically not needed for the first example).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; url = \"http:\/\/vmogg:7809\/services\/v2\/deployments\"\n&gt;&gt;&gt; requests.get(url, auth=auth).json()\n{\n    '$schema': 'api:standardResponse',\n    'links': &#091;\n        {'rel': 'canonical', 'href': 'http:\/\/vmogg:7809\/services\/v2\/deployments', 'mediaType': 'application\/json'},\n        {'rel': 'self', 'href': 'http:\/\/vmogg:7809\/services\/v2\/deployments', 'mediaType': 'application\/json'},\n        {'rel': 'describedby', 'href': 'http:\/\/vmogg:7809\/services\/v2\/metadata-catalog\/versionDeployments', 'mediaType': 'application\/schema+json'}\n    ],\n    'messages': &#091;],\n    'response': {\n        '$schema': 'ogg:collection',\n        'items': &#091;\n            {'links': &#091;{'rel': 'parent', 'href': 'http:\/\/vmogg:7809\/services\/v2\/deployments', 'mediaType': 'application\/json'}, {'rel': 'canonical', 'href': 'http:\/\/vmogg:7809\/services\/v2\/deployments\/ServiceManager', 'mediaType': 'application\/json'}], '$schema': 'ogg:collectionItem', 'name': 'ServiceManager', 'status': 'running'},\n            {'links': &#091;{'rel': 'parent', 'href': 'http:\/\/vmogg:7809\/services\/v2\/deployments', 'mediaType': 'application\/json'}, {'rel': 'canonical', 'href': 'http:\/\/vmogg:7809\/services\/v2\/deployments\/ogg_test_01', 'mediaType': 'application\/json'}], '$schema': 'ogg:collectionItem', 'name': 'ogg_test_01', 'status': 'running'},\n            {'links': &#091;{'rel': 'parent', 'href': 'http:\/\/vmogg:7809\/services\/v2\/deployments', 'mediaType': 'application\/json'}, {'rel': 'canonical', 'href': 'http:\/\/vmogg:7809\/services\/v2\/deployments\/ogg_test_02', 'mediaType': 'application\/json'}], '$schema': 'ogg:collectionItem', 'name': 'ogg_test_02', 'status': 'running'}\n        ]\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Already, we&#8217;re starting to get a bit lost in the output (even though I cleaned it for you). Without going too much into the details, when the call succeeds, we are interested in the <code>response.items<\/code> object, discarding <code>$schema<\/code> and <code>links<\/code> objects. When the call fails, let&#8217;s just display the output for now.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef parse(response):\n    try:\n        return response.json()\n    except ValueError:\n        return response.text\n\ndef extract_main(result):\n    if not isinstance(result, dict):\n        return result\n    resp = result.get(&quot;response&quot;, result)\n    if &quot;items&quot; not in resp:\n        return resp\n    exclude = {&quot;links&quot;, &quot;$schema&quot;}\n    return &#x5B;{k: v for k, v in i.items() if k not in exclude} for i in resp&#x5B;&quot;items&quot;]]\n\nresult = requests.get(url, auth=auth)\nif result.ok:\n    response = parse(result)\n    main_response = extract_main(response)\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">We now have a more human-friendly output for our API calls ! For this specific example, we only retrieve the deployment names and their status.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; main_response\n&#091;{'name': 'ServiceManager', 'status': 'running'}, {'name': 'ogg_test_01', 'status': 'running'}, {'name': 'ogg_test_02', 'status': 'running'}]<\/code><\/pre>\n\n\n\n<h2 id=\"h-goldengate-post-api-calls\" class=\"wp-block-heading\">GoldenGate POST API calls<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Some API calls require you to <strong>send data<\/strong> instead of just receiving it. A common example is the <strong>creation of a GoldenGate user<\/strong>. Both the role and the username are part of the endpoint. Using the <code>post<\/code> method instead of <code>get<\/code>, we will give the user settings (the password, essentially) in the <code>params<\/code> argument:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport requests\n\nrole = &quot;User&quot;\nuser = &quot;ogg_username&quot;\nurl = f&quot;http:\/\/vmogg:7809\/services\/v2\/authorizations\/{role}\/{user}&quot;\nauth = (&quot;ogg_user&quot;, &quot;ogg_password&quot;)\ndata = {\n    &quot;credential&quot;: &quot;your_password&quot;\n}\n\nresult = requests.post(url, auth=auth, json=data)\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">To check if the user was created, you can go to the Web UI or check the <code>ok<\/code> flag again.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; result.ok\nTrue<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"263\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2026\/01\/ogg_blog_restapi_user_creation_webui-1024x263.png\" alt=\"\" class=\"wp-image-42537\" style=\"aspect-ratio:3.8936771203012963;width:556px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2026\/01\/ogg_blog_restapi_user_creation_webui-1024x263.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2026\/01\/ogg_blog_restapi_user_creation_webui-300x77.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2026\/01\/ogg_blog_restapi_user_creation_webui-768x197.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2026\/01\/ogg_blog_restapi_user_creation_webui.png 1284w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Here, the API doesn&#8217;t provide us with much information when the call succeeds:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; result.text\n'{\"$schema\":\"api:standardResponse\",\"links\":&#091;{\"rel\":\"canonical\",\"href\":\"http:\/\/vmogg:7809\/services\/v2\/authorizations\/User\/ogg_username\",\"mediaType\":\"application\/json\"},{\"rel\":\"self\",\"href\":\"http:\/\/vmogg:7809\/services\/v2\/authorizations\/User\/ogg_username\",\"mediaType\":\"application\/json\"}],\"messages\":&#091;]}'<\/code><\/pre>\n\n\n\n<h2 id=\"h-a-fully-working-oggrestapi-python-class\" class=\"wp-block-heading\">A fully working <code>OGGRestAPI<\/code> Python class<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When dealing with the REST API, you will quickly feel the need for a standard client object that will handle everything for you. A very basic <code>ogg_rest_api.py<\/code> script class will look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import getpass\nimport requests\nimport time\nimport urllib3\nfrom pprint import pprint\n\n\nclass OGGRestAPI:\n    \"\"\"Oracle GoldenGate REST API client (base class).\"\"\"\n\n    # HTTP statuses worth retrying (transient \/ server-side).\n    _RETRY_STATUSES = frozenset({429, 502, 503, 504})\n    # Exceptions worth retrying (transient network issues).\n    _RETRY_EXCEPTIONS = (\n        requests.exceptions.ConnectionError,\n        requests.exceptions.Timeout,\n        requests.exceptions.ChunkedEncodingError,\n    )\n\n    def __init__(self, url, username=None, password=None, deployment=None, ca_cert=None,\n                 reverse_proxy=False, verify_ssl=True, test_connection=True, timeout=None, version='v2'):\n        \"\"\"\n        Initialize Oracle GoldenGate REST API client.\n\n        :param url: Base URL of the OGG REST API. It can be:\n                    'http(s):\/\/hostname:port' without NGINX reverse proxy,\n                    'https:\/\/nginx_host:nginx_port' with NGINX reverse proxy.\n        :param username: service username\n        :param password: service password. If omitted, the user is prompted to\n                         enter it securely (input is not echoed).\n        :param deployment: when reverse proxy is used, the deployment name to use (e.g. 'ogg_test_01')\n        :param ca_cert: path to a trusted CA cert (for self-signed certs)\n        :param reverse_proxy: bool, whether to use NGINX reverse proxy\n        :param verify_ssl: bool, whether to verify SSL certs\n        :param test_connection: if True, will attempt a simple GET on \/services on init\n        :param timeout: request timeout in seconds\n        \"\"\"\n        self.swagger_version = '2026.01.27'\n        self.version = version\n        self.base_url = url\n        self.username = username\n        if password is None:\n            password = getpass.getpass(f'Password for {username or \"OGG REST API\"}: ')\n        self.auth = (self.username, password)\n        self.headers = {'Accept': 'application\/json', 'Content-Type': 'application\/json'}\n        self.deployment = deployment\n        self.reverse_proxy = reverse_proxy\n        self.verify_ssl = ca_cert if ca_cert else verify_ssl\n        self.timeout = timeout\n        self.session = requests.Session()\n        self.session.headers.update(self.headers)\n\n        if not verify_ssl and self.base_url.startswith('https:\/\/'):\n            # Disable InsecureRequestWarning if verification is off\n            urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n\n        # Test connection\n        if test_connection:\n            # Verify connectivity. Raises on failure so callers can catch and handle\n            # connection issues gracefully. The base class has no generated endpoint\n            # methods, so a simple GET on \/services is used here.\n            resp = self._request('GET', '\/services', raw_response=True)\n            if resp.status_code == 200:\n                print(f'Connected to OGG REST API at {self.base_url}')\n            elif resp.status_code == 403:\n                raise RuntimeError(\n                    f\"Authentication failed connecting to OGG REST API at {self.base_url} \"\n                    f\"with user {self.username}. Please check your credentials.\"\n                )\n            else:\n                raise RuntimeError(\n                    f\"Failed to connect to OGG REST API at {self.base_url}. \"\n                    f\"HTTP {resp.status_code}: {resp.text}\"\n                )\n\n    def _request(self, method, path, *, params=None, data=None, max_retries=3,\n                 backoff_factor=1.0, raw_response=False):\n        \"\"\"Make an HTTP request, retrying transient failures, then parse the response.\n\n        Retries are attempted for transient network exceptions (connection errors,\n        timeouts, chunked-encoding errors) and for retryable HTTP statuses\n        (429, 502, 503, 504), using exponential backoff. When the server sends a\n        ``Retry-After`` header, that value is honored instead of the computed delay.\n\n        Args:\n            method (str): The HTTP method to use.\n            path (str): The API endpoint path.\n            params (dict, optional): Query parameters for the request. Defaults to None.\n            data (dict, optional): The request body data. Defaults to None.\n            max_retries (int, optional): Maximum number of attempts. Defaults to 3.\n            backoff_factor (float, optional): Base delay (seconds) for exponential\n                backoff. Delay for attempt n is backoff_factor * 2**(n-1). Defaults to 1.0.\n            raw_response (bool, optional): Whether to return the raw response object. Defaults to False.\n\n        Returns:\n            dict or requests.Response: The parsed response or the raw response object.\n        \"\"\"\n        url = f'{self.base_url}{path}'\n        response = None\n        last_exc = None\n        for attempt in range(1, max_retries + 1):\n            try:\n                response = self.session.request(\n                    method,\n                    url,\n                    auth=self.auth,\n                    params=params,\n                    json=data,\n                    verify=self.verify_ssl,\n                    timeout=self.timeout\n                )\n            except self._RETRY_EXCEPTIONS as exc:\n                last_exc = exc\n                if attempt &gt;= max_retries:\n                    raise\n                delay = self._retry_delay(attempt, backoff_factor)\n                print(f\"Request to {url} failed ({exc.__class__.__name__}: {exc}); \"\n                      f\"retrying in {delay:.1f}s (attempt {attempt}\/{max_retries})...\")\n                time.sleep(delay)\n                continue\n\n            # Retry transient server-side statuses while attempts remain.\n            if response.status_code in self._RETRY_STATUSES and attempt &lt; max_retries:\n                delay = self._retry_delay(attempt, backoff_factor, response=response)\n                print(f\"Request to {url} returned HTTP {response.status_code}; \"\n                      f\"retrying in {delay:.1f}s (attempt {attempt}\/{max_retries})...\")\n                time.sleep(delay)\n                continue\n\n            break\n\n        if response is None:\n            # Every attempt raised a network exception; surface the last one.\n            raise last_exc\n\n        if raw_response:\n            return response\n        result = self._parse(response)\n        self._check_response(response, url)\n        return self._extract_main(result)\n\n    def _retry_delay(self, attempt, backoff_factor, response=None):\n        \"\"\"Compute the delay before the next retry.\n\n        Honors a ``Retry-After`` response header (seconds) when present, otherwise\n        falls back to exponential backoff: backoff_factor * 2**(attempt - 1).\n        \"\"\"\n        if response is not None:\n            retry_after = response.headers.get('Retry-After')\n            if retry_after:\n                try:\n                    return float(retry_after)\n                except (TypeError, ValueError):\n                    pass\n        return backoff_factor * (2 ** (attempt - 1))\n\n    def _build_path(self, template, ogg_service=None, path_params=None):\n        path_params = dict(path_params or {})\n        if \"{version}\" in template and \"version\" not in path_params:\n            path_params&#091;\"version\"] = self.version\n\n        # If reverse proxy is enabled, the full service must be added before \/v2\/\n        #   - \/services\/ServiceManager\/v2\/... for Service Manager\n        #   - \/services\/deployment_name\/ogg_service\/v2\/... for other services when a deployment is specified\n        if self.reverse_proxy and template != '\/services':\n            if ogg_service == 'ServiceManager' or not self.deployment:\n                template = f'\/services\/ServiceManager\/{template.removeprefix(\"\/services\/\")}'\n            else:\n                template = f'\/services\/{self.deployment}\/{ogg_service}\/{template.removeprefix(\"\/services\/\")}'\n        return template.format(**path_params)\n\n    def _call(self, method, template, *, ogg_service=None, path_params=None, params=None,\n              data=None, body_params=None, raw_response=False, if_exists='fail'):\n        if self.reverse_proxy and ogg_service == '' and self.deployment:\n            # This is a common endpoint and a deployment is specified. Choosing adminsrvr service by default.\n            ogg_service = \"adminsrvr\"\n        path = self._build_path(template, ogg_service=ogg_service, path_params=path_params)\n        url = f'{self.base_url}{path}'\n\n        # Merge body_params into data when provided. body_params is a dict mapping\n        # payload field names to values (the generated methods pass their\n        # explicit body params here). Only merge when `data` is a dict or None.\n        if body_params:\n            if data is None:\n                data = {}\n            if isinstance(data, dict):\n                # Copy first so the caller's dict is never mutated.\n                data = dict(data)\n                for k, v in body_params.items():\n                    if v is not None:\n                        data&#091;k] = v\n            if not data:\n                data = None\n\n        # If caller asked to skip on existing resource, inspect the raw response and\n        # treat a 409 (already exists) as a no-op instead of an error. Routing through\n        # _request means this path inherits the same retry handling as normal calls.\n        if if_exists == 'skip':\n            response = self._request(method, path, params=params, data=data, raw_response=True)\n            parsed = self._parse(response)\n\n            if response.status_code == 409:\n                titles = &#091;]\n                if isinstance(parsed, dict):\n                    for m in parsed.get('messages', &#091;]):\n                        if isinstance(m, dict) and m.get('title'):\n                            titles.append(m&#091;'title'])\n                message = '; '.join(titles) if titles else 'Resource exists'\n                print(f\"{message} (if_exists set to skip)\")\n                return {'status': 'skipped', 'message': message, 'http_status': 409, 'raw': parsed}\n\n            # Otherwise behave like normal _call: raise on errors, return parsed or extracted\n            self._check_response(response, url)\n            if raw_response:\n                return parsed\n            return self._extract_main(parsed)\n\n        # Default behavior: use existing request flow\n        result = self._request(method, path, params=params, data=data, raw_response=raw_response)\n        return result\n\n    def _get(self, path, params=None, raw_response=False):\n        return self._request('GET', path, params=params, raw_response=raw_response)\n\n    def _post(self, path, data=None, raw_response=False):\n        return self._request('POST', path, data=data, raw_response=raw_response)\n\n    def _put(self, path, data=None, raw_response=False):\n        return self._request('PUT', path, data=data, raw_response=raw_response)\n\n    def _patch(self, path, data=None, raw_response=False):\n        return self._request('PATCH', path, data=data, raw_response=raw_response)\n\n    def _delete(self, path, raw_response=False):\n        return self._request('DELETE', path, raw_response=raw_response)\n\n    def _check_response(self, response, url):\n        if response.ok:\n            return\n\n        # Parse the body once; _parse returns text (not a dict) for non-JSON bodies.\n        body = self._parse(response)\n        messages = body.get('messages') if isinstance(body, dict) else None\n        if messages:\n            error_messages = &#091;]\n            for message in messages:\n                if isinstance(message, dict):\n                    severity = message.get('severity', 'ERROR')\n                    title = message.get('title', message)\n                else:\n                    severity, title = 'ERROR', message\n                error_messages.append(\n                    f\"{severity} (code {response.status_code}) - {url}: {title}\"\n                )\n            raise RuntimeError(' ; '.join(error_messages))\n\n        print(f'HTTP {response.status_code}: {response.text}')\n        response.raise_for_status()\n\n    def _parse(self, response):\n        try:\n            return response.json()\n        except ValueError:\n            return response.text\n\n    def close(self):\n        self.session.close()\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, *_exc):\n        self.close()\n        return False\n\n    def _extract_main(self, result):\n        if not isinstance(result, dict):\n            return result\n\n        resp = result.get('response', result)\n        if 'items' not in resp:\n            return resp\n\n        exclude = {'links', '$schema'}\n        return &#091;{k: v for k, v in i.items() if k not in exclude} for i in resp&#091;'items']]\n\n    def pretty_print(self, result):\n        pprint(result)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With this, we can connect to the API and generate the same <code>GET<\/code> query as before to retrieve all deployments. This time, we only provide the endpoint, and not the whole URL.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; from ogg_rest_api import OGGRestAPI\n&gt;&gt;&gt; client_blog = OGGRestAPI(url=\"http:\/\/vmmogg:7809\", username=\"ogg\", password=\"ogg\")\n&gt;&gt;&gt; client_blog._get(\"\/services\/v2\/deployments\")\n&#091;{'name': 'ServiceManager', 'status': 'running'}, {'name': 'ogg_test_01', 'status': 'running'}, {'name': 'ogg_test_02', 'status': 'running'}]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As you can imagine, all GoldenGate API functionalities can be integrated in this class, enhancing GoldenGate management and monitoring. Next time you want to automate your GoldenGate processes, please consider using this REST API !<\/p>\n\n\n\n<h2 id=\"h-rest-api-calls-to-a-secured-goldengate-deployment\" class=\"wp-block-heading\">REST API calls to a secured GoldenGate deployment<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your GoldenGate deployment is secure, you can still use this Python class. The requests module will handle it for you. I give two examples below for a secured deployment using a self-signed certificate:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Checking CA automatically (Trusted CA)\n&gt;&gt;&gt; client_blog = OGGRestAPI(url=\"https:\/\/vmogg:7809\", username=\"ogg\", password=\"ogg\")\n\n# Providing RootCA (self-signed certificate)\n&gt;&gt;&gt; client_blog = OGGRestAPI(url=\"https:\/\/vmogg:7809\", username=\"ogg\", password=\"ogg\", ca_cert=\"\/path\/to\/RootCA_cert.pem\", verify_ssl=True)\n\n# Disabling verification\n&gt;&gt;&gt; client_blog = OGGRestAPI(url=\"https:\/\/vmogg:7809\", username=\"ogg\", password=\"ogg\", verify_ssl=False)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oracle GoldenGate REST API has been around for quite some time now, but I&#8217;ve yet to see it used in practice at customers. Every time I tried to introduce it, it was some sort of novelty. Mainly because DBAs tend to dislike automation, but also for technical reasons. Even though the REST API was introduced [&hellip;]<\/p>\n","protected":false},"author":152,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3787,59],"tags":[3182,3560,3827,3804,979,708,328,3229,1089,1521,3767],"type_dbi":[3826,3406,3828,3823,3740,3768,3800,3349],"class_list":["post-42283","post","type-post","status-publish","format-standard","hentry","category-goldengate","category-oracle","tag-3182","tag-23ai","tag-3827","tag-26ai","tag-api","tag-automation","tag-goldengate","tag-microservices","tag-python","tag-rest","tag-restapi","type-3826","type-23ai","type-3828","type-26ai","type-goldengate","type-python","type-rest","type-rest-api"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.8 (Yoast SEO v27.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>GoldenGate REST API basics with Python - dbi Blog<\/title>\n<meta name=\"description\" content=\"Take the most out of your GoldenGate setup by leveraging the power of the REST API in Python !\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GoldenGate REST API basics with Python\" \/>\n<meta property=\"og:description\" content=\"Take the most out of your GoldenGate setup by leveraging the power of the REST API in Python !\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-29T07:10:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-28T04:00:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2026\/01\/ogg_blog_restapi_user_creation_webui.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1284\" \/>\n\t<meta property=\"og:image:height\" content=\"330\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Julien Delattre\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Julien Delattre\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/\"},\"author\":{\"name\":\"Julien Delattre\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/764ab019cc9dec42655b4c6b9b8e474e\"},\"headline\":\"GoldenGate REST API basics with Python\",\"datePublished\":\"2026-01-29T07:10:00+00:00\",\"dateModified\":\"2026-06-28T04:00:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/\"},\"wordCount\":660,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2026\\\/01\\\/ogg_blog_restapi_user_creation_webui-1024x263.png\",\"keywords\":[\"23\",\"23ai\",\"26\",\"26ai\",\"api\",\"Automation\",\"GoldenGate\",\"microservices\",\"Python\",\"rest\",\"restapi\"],\"articleSection\":[\"GoldenGate\",\"Oracle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/\",\"name\":\"GoldenGate REST API basics with Python - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2026\\\/01\\\/ogg_blog_restapi_user_creation_webui-1024x263.png\",\"datePublished\":\"2026-01-29T07:10:00+00:00\",\"dateModified\":\"2026-06-28T04:00:56+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/764ab019cc9dec42655b4c6b9b8e474e\"},\"description\":\"Take the most out of your GoldenGate setup by leveraging the power of the REST API in Python !\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2026\\\/01\\\/ogg_blog_restapi_user_creation_webui.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2026\\\/01\\\/ogg_blog_restapi_user_creation_webui.png\",\"width\":1284,\"height\":330},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/goldengate-rest-api-basics-with-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GoldenGate REST API basics with Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/764ab019cc9dec42655b4c6b9b8e474e\",\"name\":\"Julien Delattre\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97d00e680bbf237126e24b65281cbcb66cd20bd1ed2d14bf928991b2bf68eb5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97d00e680bbf237126e24b65281cbcb66cd20bd1ed2d14bf928991b2bf68eb5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97d00e680bbf237126e24b65281cbcb66cd20bd1ed2d14bf928991b2bf68eb5?s=96&d=mm&r=g\",\"caption\":\"Julien Delattre\"},\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/juliendelattre\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"GoldenGate REST API basics with Python - dbi Blog","description":"Take the most out of your GoldenGate setup by leveraging the power of the REST API in Python !","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/","og_locale":"en_US","og_type":"article","og_title":"GoldenGate REST API basics with Python","og_description":"Take the most out of your GoldenGate setup by leveraging the power of the REST API in Python !","og_url":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/","og_site_name":"dbi Blog","article_published_time":"2026-01-29T07:10:00+00:00","article_modified_time":"2026-06-28T04:00:56+00:00","og_image":[{"width":1284,"height":330,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2026\/01\/ogg_blog_restapi_user_creation_webui.png","type":"image\/png"}],"author":"Julien Delattre","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Julien Delattre","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/"},"author":{"name":"Julien Delattre","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/764ab019cc9dec42655b4c6b9b8e474e"},"headline":"GoldenGate REST API basics with Python","datePublished":"2026-01-29T07:10:00+00:00","dateModified":"2026-06-28T04:00:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/"},"wordCount":660,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2026\/01\/ogg_blog_restapi_user_creation_webui-1024x263.png","keywords":["23","23ai","26","26ai","api","Automation","GoldenGate","microservices","Python","rest","restapi"],"articleSection":["GoldenGate","Oracle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/","url":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/","name":"GoldenGate REST API basics with Python - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2026\/01\/ogg_blog_restapi_user_creation_webui-1024x263.png","datePublished":"2026-01-29T07:10:00+00:00","dateModified":"2026-06-28T04:00:56+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/764ab019cc9dec42655b4c6b9b8e474e"},"description":"Take the most out of your GoldenGate setup by leveraging the power of the REST API in Python !","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2026\/01\/ogg_blog_restapi_user_creation_webui.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2026\/01\/ogg_blog_restapi_user_creation_webui.png","width":1284,"height":330},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/goldengate-rest-api-basics-with-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"GoldenGate REST API basics with Python"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/764ab019cc9dec42655b4c6b9b8e474e","name":"Julien Delattre","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a97d00e680bbf237126e24b65281cbcb66cd20bd1ed2d14bf928991b2bf68eb5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a97d00e680bbf237126e24b65281cbcb66cd20bd1ed2d14bf928991b2bf68eb5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a97d00e680bbf237126e24b65281cbcb66cd20bd1ed2d14bf928991b2bf68eb5?s=96&d=mm&r=g","caption":"Julien Delattre"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/juliendelattre\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/42283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/152"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=42283"}],"version-history":[{"count":30,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/42283\/revisions"}],"predecessor-version":[{"id":45424,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/42283\/revisions\/45424"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=42283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=42283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=42283"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=42283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}