### Install Universal DDI Python Client Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/README.md Command to install the Universal DDI Python Client library using pip. This is the initial step before using the client in your Python projects. ```bash pip install universal-ddi-python-client ``` -------------------------------- ### CreateNextAvailableIPResponse Model Example (Python) Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam/docs/CreateNextAvailableIPResponse.md Demonstrates how to instantiate and use the CreateNextAvailableIPResponse model in Python. It covers creating an instance from a JSON string, converting it to a dictionary, and creating an instance from a dictionary. Assumes the 'ipam' library is installed. ```python from ipam.models.create_next_available_ip_response import CreateNextAvailableIPResponse # TODO update the JSON string below json = "{}" # create an instance of CreateNextAvailableIPResponse from a JSON string create_next_available_ip_response_instance = CreateNextAvailableIPResponse.from_json(json) # print the JSON string representation of the object print(CreateNextAvailableIPResponse.to_json()) # convert the object into a dict create_next_available_ip_response_dict = create_next_available_ip_response_instance.to_dict() # create an instance of CreateNextAvailableIPResponse from a dict create_next_available_ip_response_from_dict = CreateNextAvailableIPResponse.from_dict(create_next_available_ip_response_dict) ``` -------------------------------- ### GET /hosts Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/infra_mgmt/README.md Lists all Host resources for an account. ```APIDOC ## GET /hosts ### Description List all the Host resources for an account. ### Method GET ### Endpoint /hosts ### Parameters #### Query Parameters - **_page_info** (ApiPageInfo) - Optional - Provides pagination information for the response. ### Response #### Success Response (200) - **result** (ListHostResponse) - A list of host objects. #### Response Example ```json { "result": { "_page_info": { "_next_page_id": "next_page_cursor", "_total_objects": 100, "_current_object_count": 50, "_previous_page_id": "previous_page_cursor" }, "_embedded": { "hosts": [ { "_id": "host_id_1", "_type": "host", "name": "server1.example.com", "ip_address": "192.168.1.10", "status": "ACTIVE", "tags": [ "production" ] } ] } } } ``` ``` -------------------------------- ### GET /services Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/infra_mgmt/README.md Lists all Service resources for an account. ```APIDOC ## GET /services ### Description List all the Service resources for an account. ### Method GET ### Endpoint /services ### Parameters #### Query Parameters - **_page_info** (ApiPageInfo) - Optional - Provides pagination information for the response. ### Response #### Success Response (200) - **result** (ListServiceResponse) - A list of service objects. #### Response Example ```json { "result": { "_page_info": { "_next_page_id": "next_page_cursor", "_total_objects": 100, "_current_object_count": 50, "_previous_page_id": "previous_page_cursor" }, "_embedded": { "services": [ { "_id": "service_id_1", "_type": "service", "name": "webserver", "application_id": "app_id_1", "host_ids": [ "host_id_1" ], "status": "RUNNING" } ] } } } ``` ``` -------------------------------- ### Instantiate and Use AccessCodesApi in Python Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/fw/README.md Demonstrates how to instantiate the `AccessCodesApi` client from the `fw` library, configure the portal URL (optionally), and make a call to create an access code. It includes error handling for API exceptions and pretty-printing the response. Dependencies: `fw`, `urllib3`, `python-dateutil`, `pydantic`, `os`. ```python import fw from fw.rest import ApiException from pprint import pprint from infoblox_core.config import Configuration import os # Defining the Portal URL is optional and defaults to "https://csp.infoblox.com" # See configuration.py for a list of all supported configuration parameters. configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) # Enter a context with an instance of the API client with fw.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = fw.AccessCodesApi(api_client) body = fw.AccessCode() # AccessCode | The Bypass Code object. try: # Create Access Codes api_response = api_instance.create_access_code(body) print("The response of AccessCodesApi->create_access_code:\n") pprint(api_response) except ApiException as e: print("Exception when calling AccessCodesApi->create_access_code: %s\n" % e) ``` -------------------------------- ### Install Universal DDI Python Client with Pip Source: https://context7.com/infobloxopen/universal-ddi-python-client/llms.txt Installs the Universal DDI Python Client package using pip, with an option to specify a version. This is the primary method for getting the library into your Python environment. ```python pip install universal-ddi-python-client pip install universal-ddi-python-client==0.1.1 ``` -------------------------------- ### Output SecurityPoliciesCreateSecurityPolicy400Response as JSON String - Python Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/fw/docs/SecurityPoliciesCreateSecurityPolicy400Response.md Provides an example of how to get the JSON string representation of a SecurityPoliciesCreateSecurityPolicy400Response object. This is useful for logging, sending the data elsewhere, or saving it. It requires an instantiated model object. ```python from fw.models.security_policies_create_security_policy400_response import SecurityPoliciesCreateSecurityPolicy400Response # Assuming security_policies_create_security_policy400_response_instance is an existing object # print the JSON string representation of the object print(SecurityPoliciesCreateSecurityPolicy400Response.to_json()) ``` -------------------------------- ### Basic Configuration and API Client Setup in Python Source: https://context7.com/infobloxopen/universal-ddi-python-client/llms.txt Sets up the basic configuration for the Universal DDI Python Client, including portal URL and API key. It then initializes an ApiClient instance, demonstrating the use of a context manager for automatic resource cleanup. ```python from universal_ddi_client import Configuration, ApiClient # Create configuration with API key config = Configuration( portal_url="https://csp.infoblox.com", portal_key="your-api-key-here" ) # Create API client client = ApiClient(config) # Use with context manager for automatic cleanup with ApiClient(config) as api_client: # Your API operations here pass ``` -------------------------------- ### Python: Server Model JSON and Dictionary Operations Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam/docs/Server.md Demonstrates how to create a Server instance from a JSON string, serialize it to JSON, convert it to a dictionary, and create a Server instance from a dictionary. This covers essential data handling operations for the Server model. ```python from ipam.models.server import Server # TODO update the JSON string below json = "{}" # create an instance of Server from a JSON string server_instance = Server.from_json(json) # print the JSON string representation of the object print(Server.to_json()) # convert the object into a dict server_dict = server_instance.to_dict() # create an instance of Server from a dict server_from_dict = Server.from_dict(server_dict) ``` -------------------------------- ### Manage Kerberos Keys with Python Source: https://context7.com/infobloxopen/universal-ddi-python-client/llms.txt This example shows how to manage Kerberos keys using the universal_ddi_client library. It covers listing and reading specific Kerberos keys. This requires the 'keys' module and 'universal_ddi_client' to be installed and properly configured. ```python import keys from universal_ddi_client import Configuration, ApiClient config = Configuration(portal_key="your-api-key") with keys.ApiClient(config) as api_client: kerberos_api = keys.KerberosApi(api_client) # List all Kerberos keys kerberos_keys = kerberos_api.list() for key in kerberos_keys.results: print(f"Kerberos Key: {key.principal}") print(f" Domain: {key.domain}") print(f" Version: {key.version}") # Read specific Kerberos key if len(kerberos_keys.results) > 0: key_id = kerberos_keys.results[0].id key_detail = kerberos_api.read(key_id) print(f"Key details:") print(f" Principal: {key_detail.result.principal}") print(f" Encryption: {key_detail.result.algorithm}") ``` -------------------------------- ### Disassociate Config Profile from Objects using Python Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam/docs/ConfigProfileApi.md Provides a Python example for disassociating a config profile from objects. It shows the setup of the ApiClient and Configuration, instantiation of ConfigProfileApi, and the call to disassociate_config_profile_from_objects with the appropriate request body. Includes exception handling. ```python import os from pprint import pprint import ipam from universal_ddi_client.api_client import ApiClient from universal_ddi_client.configuration import Configuration configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) configuration.portal_key = os.getenv("INFOBLOX_PORTAL_KEY") with ApiClient(configuration) as api_client: api_instance = ipam.ConfigProfileApi(api_client) body = ipam.DisassociateConfigProfileFromObjectsRequest() try: api_response = api_instance.disassociate_config_profile_from_objects(body) pprint("The response of ConfigProfileApi->disassociate_config_profile_from_objects:\n") pprint(api_response) except Exception as e: pprint("Exception when calling ConfigProfileApi->disassociate_config_profile_from_objects: %s\n" % e) ``` -------------------------------- ### View Model - Python Example Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/dns_config/docs/View.md Demonstrates how to use the View model from the dns_config.models.view module. It shows creating a View instance from a JSON string, converting it to JSON, converting it to a dictionary, and creating a View instance from a dictionary. ```python from dns_config.models.view import View # TODO update the JSON string below json = "{}" # create an instance of View from a JSON string view_instance = View.from_json(json) # print the JSON string representation of the object print(View.to_json()) # convert the object into a dict view_dict = view_instance.to_dict() # create an instance of View from a dict view_from_dict = View.from_dict(view_dict) ``` -------------------------------- ### OnpremHost Model Documentation Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/anycast/docs/OnpremHost.md This section details the properties of the OnpremHost model, including their types, descriptions, and optionality. It also provides Python code examples for creating and manipulating OnpremHost objects. ```APIDOC ## OnpremHost Model ### Description The OnpremHost model represents an on-premise host, including its network configuration and metadata. ### Properties #### anycast_config_refs - **anycast_config_refs** ([List[AnycastConfigRef]]) - [optional] - List of Anycast configuration references. #### config_bgp - **config_bgp** ([BgpConfig]) - [optional] - BGP configuration for the host. #### config_ospf - **config_ospf** ([OspfConfig]) - [optional] - OSPF configuration for the host. #### config_ospfv3 - **config_ospfv3** ([Ospfv3Config]) - [optional] - OSPFv3 configuration for the host. #### created_at - **created_at** (datetime) - [optional] - Timestamp when the host was created. #### id - **id** (int) - [optional] [readonly] - Unique identifier for the on-prem host. #### ip_address - **ip_address** (str) - IPv4 address of the on-prem host. #### ipv6_address - **ipv6_address** (str) - IPv6 address of the on-prem host. #### name - **name** (str) - Name of the on-prem host. #### updated_at - **updated_at** (datetime) - [optional] - Timestamp when the host was last updated. ### Example Usage ```python from anycast.models.onprem_host import OnpremHost # TODO update the JSON string below json_data = "{}" # create an instance of OnpremHost from a JSON string onprem_host_instance = OnpremHost.from_json(json_data) # print the JSON string representation of the object print(OnpremHost.to_json()) # convert the object into a dict onprem_host_dict = onprem_host_instance.to_dict() # create an instance of OnpremHost from a dict onprem_host_from_dict = OnpremHost.from_dict(onprem_host_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ``` -------------------------------- ### List Associations - API Key Authentication Example Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam/docs/DhcpHostApi.md Demonstrates how to retrieve DHCP host associations using API Key authentication with the Universal DDI Python Client. It shows the necessary imports, configuration setup, and authentication parameters for making the API call. ```python import os from pprint import pprint import ipam from universal_ddi_client.api_client import ApiClient from universal_ddi_client.configuration import Configuration # Defining the Portal URL is optional and defaults to "https://csp.infoblox.com" # See configuration.py for a list of all supported configuration parameters. configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Configure Portal key authorization: ApiKeyAuth configuration.portal_key = os.getenv("INFOBLOX_PORTAL_KEY") ``` -------------------------------- ### Python: CreateMaintenanceWindowResponse Instantiation and Conversion Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/upgrade_policy/docs/CreateMaintenanceWindowResponse.md Demonstrates how to create an instance of CreateMaintenanceWindowResponse from a JSON string, convert it to a dictionary, and create an instance from a dictionary. It requires the `upgrade_policy.models.create_maintenance_window_response` module. The input JSON string is a placeholder and should be updated with actual data. ```python from upgrade_policy.models.create_maintenance_window_response import CreateMaintenanceWindowResponse # TODO update the JSON string below json = "{}" # create an instance of CreateMaintenanceWindowResponse from a JSON string create_maintenance_window_response_instance = CreateMaintenanceWindowResponse.from_json(json) # print the JSON string representation of the object print(CreateMaintenanceWindowResponse.to_json()) # convert the object into a dict create_maintenance_window_response_dict = create_maintenance_window_response_instance.to_dict() # create an instance of CreateMaintenanceWindowResponse from a dict create_maintenance_window_response_from_dict = CreateMaintenanceWindowResponse.from_dict(create_maintenance_window_response_dict) ``` -------------------------------- ### Update Federated Realm using Python Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam_federation/docs/FederatedRealmApi.md This Python code snippet shows how to update a federated realm using the FederatedRealmApi. It requires the realm's ID and a FederatedRealm object as input. The example includes API key authentication setup and exception handling, printing the API response. ```python import os from pprint import pprint import ipam_federation from universal_ddi_client.api_client import ApiClient from universal_ddi_client.configuration import Configuration configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) configuration.portal_key = os.getenv("INFOBLOX_PORTAL_KEY") with ApiClient(configuration) as api_client: api_instance = ipam_federation.FederatedRealmApi(api_client) id = 'id_example' body = ipam_federation.FederatedRealm() try: api_response = api_instance.update(id, body) pprint("The response of FederatedRealmApi->update:\n") pprint(api_response) except Exception as e: pprint("Exception when calling FederatedRealmApi->update: %s\n" % e) ``` -------------------------------- ### Initialize and Use AccountsApi check_config Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/dfp/README.md Demonstrates how to initialize the dfp client, configure the portal URL (optional), and call the `check_config` method from the `AccountsApi`. It handles potential API exceptions and prints the response. Dependencies include `dfp`, `ApiException`, `os`, and `pprint`. ```python import dfp from dfp.rest import ApiException from pprint import pprint import os from dfp.configuration import Configuration # Defining the Portal URL is optional and defaults to "https://csp.infoblox.com" # See configuration.py for a list of all supported configuration parameters. configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) # Enter a context with an instance of the API client with dfp.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = dfp.AccountsApi(api_client) body = dfp.TypesConfigCheckRequest() # TypesConfigCheckRequest | try: # Check Config. api_response = api_instance.check_config(body) print("The response of AccountsApi->check_config:\n") pprint(api_response) except ApiException as e: print("Exception when calling AccountsApi->check_config: %s\n" % e) ``` -------------------------------- ### Python Example: Read Category Filter Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/fw/docs/CategoryFiltersApi.md This Python code demonstrates how to initialize the API client and retrieve information on a specified Category Filter object using the Universal DDI Python Client. It shows the setup for client configuration, including optional portal URL, and imports necessary libraries. ```python import os from pprint import pprint import fw from universal_ddi_client.api_client import ApiClient from universal_ddi_client.configuration import Configuration # Defining the Portal URL is optional and defaults to "https://csp.infoblox.com" # See configuration.py for a list of all supported configuration parameters. configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) ``` -------------------------------- ### Update HA Group using Python Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam/docs/HaGroupApi.md This snippet demonstrates how to update an HA group using the `HaGroupApi` in the Infoblox Python client. It shows the necessary setup for the API client, instantiation of the `HaGroupApi`, and the call to the `update` method with an example ID and a `HAGroup` body. Error handling for the API call is also included. ```python from infoblox.api import ApiClient from infoblox.models import ipam configuration = ... # Assume configuration is set up # Enter a context with an instance of the API client with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ipam.HaGroupApi(api_client) id = 'id_example' # str | An application specific resource identity of a resource body = ipam.HAGroup() # HAGroup | try: # Update the HA group. api_response = api_instance.update(id, body) pprint("The response of HaGroupApi->update:\n") pprint(api_response) except Exception as e: pprint("Exception when calling HaGroupApi->update: %s\n" % e) ``` -------------------------------- ### Create and Manage DetailHostServiceConfig Objects (Python) Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/infra_mgmt/docs/DetailHostServiceConfig.md Demonstrates how to instantiate DetailHostServiceConfig objects from JSON strings and dictionaries, and convert them back to JSON and dictionaries. This is useful for serializing and deserializing service configuration data. ```python from infra_mgmt.models.detail_host_service_config import DetailHostServiceConfig # TODO update the JSON string below json_string = "{}" # create an instance of DetailHostServiceConfig from a JSON string detail_host_service_config_instance = DetailHostServiceConfig.from_json(json_string) # print the JSON string representation of the object print(DetailHostServiceConfig.to_json()) # convert the object into a dict detail_host_service_config_dict = detail_host_service_config_instance.to_dict() # create an instance of DetailHostServiceConfig from a dict detail_host_service_config_from_dict = DetailHostServiceConfig.from_dict(detail_host_service_config_dict) ``` -------------------------------- ### Delete Security Policy using Python Client Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/fw/docs/SecurityPoliciesApi.md This Python code snippet demonstrates how to delete security policies using the universal_ddi_client library. It shows the necessary setup, including configuration and API client instantiation, and provides an example of calling the `delete_security_policy` method. Error handling is included to catch exceptions during the API call. The function requires a `SecurityPolicyDeleteRequest` object as input. ```python import os from pprint import pprint import fw from universal_ddi_client.api_client import ApiClient from universal_ddi_client.configuration import Configuration # Defining the Portal URL is optional and defaults to "https://csp.infoblox.com" # See configuration.py for a list of all supported configuration parameters. configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) # Enter a context with an instance of the API client with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = fw.SecurityPoliciesApi(api_client) body = fw.SecurityPolicyDeleteRequest() # SecurityPolicyDeleteRequest | try: # Delete Security Policies. api_instance.delete_security_policy(body) except Exception as e: pprint("Exception when calling SecurityPoliciesApi->delete_security_policy: %s\n" % e) ``` -------------------------------- ### Infra-Mgmt Client Initialization and Authentication Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/infra_mgmt/README.md Demonstrates how to initialize the infra-mgmt client and configure authentication using API keys. It shows setting the portal URL and API key, which are essential for making authenticated requests to the API. ```python import infra_mgmt from infra_mgmt.rest import ApiException from pprint import pprint from infoblox_core.api.configuration import Configuration import os # Defining the Portal URL is optional and defaults to "https://csp.infoblox.com" # See configuration.py for a list of all supported configuration parameters. configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Configure Portal key authorization: ApiKeyAuth configuration.portal_key = os.getenv("INFOBLOX_PORTAL_KEY") ``` -------------------------------- ### GET /read Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/infra_mgmt/docs/HostsApi.md Retrieves a specific Host resource by its ID. This operation is used to get detailed information about an existing host. ```APIDOC ## GET /read ### Description Get a Host resource by its unique identifier. ### Method GET ### Endpoint /read/{id} ### Parameters #### Path Parameters - **id** (str) - Required - An application specific resource identity of a resource. ### Request Example ```python # This is a conceptual example, actual SDK usage may vary api_response = api_instance.read(id='host_id_123') ``` ### Response #### Success Response (200) - **GetHostResponse** - An object containing the host details. #### Response Example ```json { "id": "host_id_123", "name": "example.com", "address": "192.168.1.1" } ``` ``` -------------------------------- ### POST /hosts Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/infra_mgmt/README.md Creates a new Host resource. ```APIDOC ## POST /hosts ### Description Create a Host resource. ### Method POST ### Endpoint /hosts ### Parameters #### Request Body - **body** (Host) - Required - The host object to create. ### Request Example ```json { "name": "newserver.example.com", "ip_address": "192.168.1.100", "tags": [ "staging" ] } ``` ### Response #### Success Response (200) - **result** (CreateHostResponse) - The created host object, including its resource ID. #### Response Example ```json { "result": { "_id": "host_id_3", "_type": "host", "name": "newserver.example.com", "ip_address": "192.168.1.100", "tags": [ "staging" ], "status": "PROVISIONING" } } ``` ``` -------------------------------- ### Create Anycast Configuration using Python Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/anycast/docs/OnPremAnycastManagerApi.md This Python code snippet demonstrates how to create an Anycast configuration using the `create_anycast_config` method from the `anycast` module. It includes setting up the API client with portal URL and API key, instantiating the API, and handling the response or exceptions. Dependencies include the `universal_ddi_client` library. ```python import os from pprint import pprint import anycast from universal_ddi_client.api_client import ApiClient from universal_ddi_client.configuration import Configuration # Defining the Portal URL is optional and defaults to "https://csp.infoblox.com" # See configuration.py for a list of all supported configuration parameters. configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Configure Portal key authorization: ApiKeyAuth configuration.portal_key = os.getenv("INFOBLOX_PORTAL_KEY") # Enter a context with an instance of the API client with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = anycast.OnPremAnycastManagerApi(api_client) body = anycast.AnycastConfig() # AnycastConfig | try: # Create Anycast Configuration api_response = api_instance.create_anycast_config(body) pprint("The response of OnPremAnycastManagerApi->create_anycast_config:\n") pprint(api_response) except Exception as e: pprint("Exception when calling OnPremAnycastManagerApi->create_anycast_config: %s\n" % e) ``` -------------------------------- ### GET /api/anycast/version/{id} Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/anycast/docs/OnPremAnycastManagerApi.md Retrieves the Anycast version for a specific ID. This endpoint is used to get details about a particular Anycast version. ```APIDOC ## GET /api/anycast/version/{id} ### Description Retrieves the Anycast version for a specific ID. This endpoint is used to get details about a particular Anycast version. ### Method GET ### Endpoint /api/anycast/version/{id} ### Parameters #### Path Parameters - **id** (int) - Required - The unique identifier of the Anycast version. ### Request Example ```json { "example": "Not applicable for GET request without a body." } ``` ### Response #### Success Response (200) - **AnycastVersion** (object) - Contains the details of the Anycast version. #### Response Example ```json { "example": "[Response body structure defined in AnycastVersion.md]" } ``` ``` -------------------------------- ### GET /infobloxopen/universal-ddi-python-client Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam/docs/FilterApi.md Retrieves data related to Universal DDI functionalities. This endpoint is designed for GET operations and returns a list of filters. ```APIDOC ## GET /infobloxopen/universal-ddi-python-client ### Description Retrieves data related to Universal DDI functionalities. This endpoint is designed for GET operations and returns a list of filters. ### Method GET ### Endpoint /infobloxopen/universal-ddi-python-client ### Parameters #### Query Parameters - **filter** (string) - Optional - Filter to apply to the results. #### Request Body This endpoint does not accept a request body. ### Request Example ```json { "example": "No request body" } ``` ### Response #### Success Response (200) - **return_type** (ListFilterResponse) - The response will contain a ListFilterResponse object detailing the available filters. #### Response Example ```json { "example": "{\"filters\": [ \"filter1\", \"filter2\" ]}" } ``` ``` -------------------------------- ### Instantiate and Convert DetailHost (Python) Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/infra_mgmt/docs/DetailHost.md Demonstrates how to create a DetailHost object from a JSON string and convert it to a dictionary using the DetailHost.from_json() and DetailHost.to_dict() methods. It also shows how to create an instance from a dictionary. ```python from infra_mgmt.models.detail_host import DetailHost # TODO update the JSON string below json = "{}" # create an instance of DetailHost from a JSON string detail_host_instance = DetailHost.from_json(json) # print the JSON string representation of the object print(DetailHost.to_json()) # convert the object into a dict detail_host_dict = detail_host_instance.to_dict() # create an instance of DetailHost from a dict detail_host_from_dict = DetailHost.from_dict(detail_host_dict) ``` -------------------------------- ### List Hosts with Services using Python (DetailApi) Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/infra_mgmt/docs/DetailApi.md Demonstrates how to list all hosts along with their associated services using the `hosts_list` method of the DetailApi. It shows authentication setup using API Key and configuration for the Infoblox portal URL. ```python import os from pprint import pprint import infra_mgmt from universal_ddi_client.api_client import ApiClient from universal_ddi_client.configuration import Configuration # Defining the Portal URL is optional and defaults to "https://csp.infoblox.com" # See configuration.py for a list of all supported configuration parameters. configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Configure Portal key authorization: ApiKeyAuth configuration.portal_key = os.getenv("INFOBLOX_PORTAL_KEY") # Enter a context with an instance of the API client with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = infra_mgmt.DetailApi(api_client) try: # List all the Hosts along with its associated Services (applications). api_response = api_instance.hosts_list() pprint("The response of DetailApi->hosts_list:\n") pprint(api_response) except Exception as e: pprint("Exception when calling DetailApi->hosts_list: %s\n" % e) ``` -------------------------------- ### GET /dhcp/host/{id}/associations Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam/docs/DhcpHostApi.md Retrieves DHCP host associations. This endpoint is used to get information about the associations linked to a specific DHCP host identified by its ID. ```APIDOC ## GET /dhcp/host/{id}/associations ### Description Retrieves DHCP host associations. This endpoint is used to get information about the associations linked to a specific DHCP host identified by its ID. ### Method GET ### Endpoint /dhcp/host/{id}/associations #### Path Parameters - **id** (str) - Required - An application specific resource identity of a resource #### Request Body None ### Request Example ```python # Example usage (not a direct request body, but illustrative of context) with ApiClient(configuration) as api_client: api_instance = ipam.DhcpHostApi(api_client) id = 'id_example' api_response = api_instance.list_associations(id) ``` ### Response #### Success Response (200) - **HostAssociationsResponse** (object) - Details of DHCP host associations #### Response Example ```json { "example": "HostAssociationsResponse object" } ``` ``` -------------------------------- ### LeasesCommand JSON and Dictionary Conversion (Python) Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam/docs/LeasesCommand.md Demonstrates how to create a LeasesCommand instance from a JSON string and a dictionary, and how to convert an instance to its JSON string and dictionary representations. This functionality is crucial for data serialization and deserialization when interacting with the API. ```python from ipam.models.leases_command import LeasesCommand # TODO update the JSON string below json = "{}" # create an instance of LeasesCommand from a JSON string leases_command_instance = LeasesCommand.from_json(json) # print the JSON string representation of the object print(LeasesCommand.to_json()) # convert the object into a dict leases_command_dict = leases_command_instance.to_dict() # create an instance of LeasesCommand from a dict leases_command_from_dict = LeasesCommand.from_dict(leases_command_dict) ``` -------------------------------- ### Applications Model - Python Usage Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/infra_mgmt/docs/Applications.md Demonstrates how to use the Applications model from the infra_mgmt.models.applications module. It covers instantiation from JSON, conversion to JSON string, conversion to a dictionary, and instantiation from a dictionary. Ensure the 'infra_mgmt' library is installed. ```python from infra_mgmt.models.applications import Applications # TODO update the JSON string below json = "{}" # create an instance of Applications from a JSON string applications_instance = Applications.from_json(json) # print the JSON string representation of the object print(Applications.to_json()) # convert the object into a dict applications_dict = applications_instance.to_dict() # create an instance of Applications from a dict applications_from_dict = Applications.from_dict(applications_dict) ``` -------------------------------- ### GET /dhcp/hardware_filter/{id} Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam/docs/HardwareFilterApi.md Retrieves a specific hardware filter by its ID. Use this endpoint to get details about a hardware filter that applies options to clients based on hardware addresses. ```APIDOC ## GET /dhcp/hardware_filter/{id} ### Description Retrieve the hardware filter. This endpoint allows fetching details about a specific hardware filter that applies options to clients based on hardware addresses. ### Method GET ### Endpoint /dhcp/hardware_filter/{id} ### Parameters #### Path Parameters - **id** (str) - Required - The unique identifier of the hardware filter to retrieve. ### Response #### Success Response (200) - **HardwareFilter** (object) - The requested hardware filter object. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Field Mask in Update Operations Example Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/anycast/docs/ProtobufFieldMask.md Shows how a field mask determines which fields are updated in a target resource. The example contrasts the result of updating 'f.b' versus 'f.b.d'. ```protobuf target message: f { b { d : 1 x : 2 } c : 1 } update message: f { b { d : 10 } } ``` ```protobuf paths: "f.b" result: f { b { d : 10 } c : 1 } ``` ```protobuf paths: "f.b.d" result: f { b { d : 10 x : 2 } c : 1 } ``` -------------------------------- ### Configure Cloud Discovery Client (Python) Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/cloud_discovery/README.md This snippet shows how to initialize and configure the cloud-discovery client in Python. It demonstrates setting the portal URL and API key for authentication, which are crucial for interacting with the cloud discovery service. ```python import cloud_discovery from cloud_discovery.rest import ApiException from pprint import pprint from infoblox_core.configuration import Configuration import os # Defining the Portal URL is optional and defaults to "https://csp.infoblox.com" # See configuration.py for a list of all supported configuration parameters. configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Configure Portal key authorization: ApiKeyAuth configuration.portal_key = os.getenv("INFOBLOX_PORTAL_KEY") # Example of how to instantiate the API client try: api_client = cloud_discovery.ApiClient(configuration) api_instance = cloud_discovery.DiscoveryConfigurationApi(api_client) # Example API call (replace with actual call) # result = api_instance.get_discovery_configurations() # pprint(result) except ApiException as e: print("Exception when calling Cloud Discovery API: %s\n" % e) ``` -------------------------------- ### Python ASMApi Read Method Example Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam/docs/AsmApi.md Example of using the read method from the AsmApi class to retrieve an ASM object. This requires API Key authentication and configures the client with portal URL and key. It demonstrates fetching suggested updates for Automated Scope Management, including error handling. ```python import os from pprint import pprint import ipam from universal_ddi_client.api_client import ApiClient from universal_ddi_client.configuration import Configuration # Defining the Portal URL is optional and defaults to "https://csp.infoblox.com" # See configuration.py for a list of all supported configuration parameters. configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Configure Portal key authorization: ApiKeyAuth configuration.portal_key = os.getenv("INFOBLOX_PORTAL_KEY") # Enter a context with an instance of the API client with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ipam.AsmApi(api_client) id = 'id_example' # str | An application specific resource identity of a resource try: # Retrieve the suggested update for Automated Scope Management. api_response = api_instance.read(id) pprint("The response of AsmApi->read:\n") pprint(api_response) except Exception as e: pprint("Exception when calling AsmApi->read: %s\n" % e) ``` -------------------------------- ### Instantiate and Use ServiceConfig - Python Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/anycast/docs/ServiceConfig.md Demonstrates how to create a ServiceConfig instance from a JSON string, convert it to a dictionary, and create an instance from a dictionary. It also shows how to convert the object to its JSON and dictionary representations. This requires the 'anycast.models.service_config' module. ```python from anycast.models.service_config import ServiceConfig # TODO update the JSON string below json = "{}" # create an instance of ServiceConfig from a JSON string service_config_instance = ServiceConfig.from_json(json) # print the JSON string representation of the object print(ServiceConfig.to_json()) # convert the object into a dict service_config_dict = service_config_instance.to_dict() # create an instance of ServiceConfig from a dict service_config_from_dict = ServiceConfig.from_dict(service_config_dict) ``` -------------------------------- ### Python API Client Setup with API Key Authentication Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam_federation/docs/FederatedRealmApi.md Demonstrates how to initialize the Universal DDI Python client using API key authentication. It shows setting up the configuration, including the portal URL and API key, which are essential for authenticating requests to the Infoblox API. This setup is a prerequisite for making any API calls. ```python import os from pprint import pprint import ipam_federation from universal_ddi_client.api_client import ApiClient from universal_ddi_client.configuration import Configuration # Defining the Portal URL is optional and defaults to "https://csp.infoblox.com" # See configuration.py for a list of all supported configuration parameters. configuration = Configuration( portal_url = os.getenv('INFOBLOX_PORTAL_URL'), ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Configure Portal key authorization: ApiKeyAuth configuration.portal_key = os.getenv("INFOBLOX_PORTAL_KEY") ``` -------------------------------- ### GET /detail_services Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/infra_mgmt/README.md Lists all Services (applications) along with their associated Hosts. ```APIDOC ## GET /detail_services ### Description List all the Services (applications) along with its associated Hosts. ### Method GET ### Endpoint /detail_services ### Parameters #### Query Parameters - **_page_info** (ApiPageInfo) - Optional - Provides pagination information for the response. ### Response #### Success Response (200) - **result** (ListDetailServicesResponse) - A list of detailed service objects. #### Response Example { "result": { "_page_info": { "_next_page_id": "next_page_cursor", "_total_objects": 100, "_current_object_count": 50, "_previous_page_id": "previous_page_cursor" }, "_embedded": { "services": [ { "_id": "service_id_1", "_type": "detail.service", "name": "webserver", "status": "RUNNING", "hosts": [ { "_id": "host_id_1", "_type": "detail.host", "name": "server1.example.com", "status": "ACTIVE" } ] } ] } } } ``` -------------------------------- ### GET /v2/maintenance_windows Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/upgrade_policy/README.md List all the maintenance windows. ```APIDOC ## GET /v2/maintenance_windows ### Description List all the maintenance windows. ### Method GET ### Endpoint /v2/maintenance_windows ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of maintenance windows to return. - **offset** (integer) - Optional - The number of maintenance windows to skip before returning results. ### Request Example ```json { "example": "No request body needed for listing" } ``` ### Response #### Success Response (200) - **example** (array) - A list of maintenance window objects. #### Response Example ```json { "example": [ "maintenance window object 1", "maintenance window object 2" ] } ``` ``` -------------------------------- ### Server Model Instantiation and Conversion (Python) Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/dns_config/docs/Server.md Demonstrates how to create a Server object from a JSON string, convert it to a JSON string, and also convert it to and from a dictionary. This snippet requires the 'dns_config.models.server.Server' class. ```python from dns_config.models.server import Server # TODO update the JSON string below json = "{}" # create an instance of Server from a JSON string server_instance = Server.from_json(json) # print the JSON string representation of the object print(Server.to_json()) # convert the object into a dict server_dict = server_instance.to_dict() # create an instance of Server from a dict server_from_dict = Server.from_dict(server_dict) ``` -------------------------------- ### GET /dns/forward_zone Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/dns_config/docs/ForwardZoneApi.md List Forward Zone objects. ```APIDOC ## GET /dns/forward_zone ### Description List Forward Zone objects. ### Method GET ### Endpoint /dns/forward_zone ### Parameters #### Query Parameters - **limit** (int) - Optional - The maximum number of records to return. - **offset** (int) - Optional - The number of records to skip before starting to collect the result set. - **fields** (string) - Optional - Specifies the fields to be returned in the response. ### Response #### Success Response (200) - **ForwardZoneList** (ForwardZoneList) - A list of Forward Zone objects. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### GET /ipam/ip_space Source: https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam/README.md Retrieve a list of all IP spaces. ```APIDOC ## GET /ipam/ip_space ### Description Retrieve ```