Maintainers
-Current maintainer:
- -This module is part of the cetmix/cetmix-tower project on GitHub.
-You are welcome to contribute.
-This module integrates the OVH Python client, enabling seamless -interaction with OVH cloud services within the Cetmix Tower.
-Table of contents
-Although OVH allows API calls without using an SDK, we found that -integrating the OVH SDK into Cetmix Tower makes provisioning, -configuring, and maintaining OVH instances more convenient for the end -user. However, not all Cetmix Tower users require this functionality, so -to avoid overloading the system, we have included it in a separate -module.
-To use the OVH integration with Cetmix Tower, you need to create OVH API -credentials:
-Create three secrets in Cetmix Tower to store your OVH credentials:
--Note: These secrets will be accessible as -#!cxtower.secret.ovh_application_key!#, -#!cxtower.secret.ovh_application_secret!#, and -#!cxtower.secret.ovh_consumer_key!# in your commands.-
Create a variable to define your OVH API endpoint (region):
--Disclaimer: The following example demonstrates one of many -possible commands you can create and run with this module. The -ovh Python library provides access to the full range of OVHcloud -APIs – this is just a starting point to help you get familiar with -the integration.-
Navigate to Command Creation
-Configure Command Settings
-Add Required Variables
-Add Required Secrets
-Write Python Code
--# List OVHcloud instances using ovh API - result = {"exit_code": 0, "message": None} - -client = ovh.Client( - endpoint={{ ovh_endpoint }}, - application_key=#!cxtower.secret.ovh_application_key!#, - application_secret=#!cxtower.secret.ovh_application_secret!#, - consumer_key=#!cxtower.secret.ovh_consumer_key!# -) - -# Required variables: -# - domain_name: The main domain (e.g., "example.com") -# - subdomain: The subdomain to create (e.g., "test") - -try: - # Create a new subdomain by adding a DNS entry (A record as example) - ip_address = "1.2.3.4" # Replace with the desired IP address - response = client.post( - "/domain/zone/" + domain_name + "/record", - fieldType="A", - subDomain=subdomain, - target=ip_address, - ttl=3600 - ) - # Refresh the zone to apply changes - client.post("/domain/zone/" + domain_name + "/refresh") - result["message"] = "Subdomain '" + subdomain + "." + domain_name + "' created and DNS zone refreshed." -except Exception as e: - result["exit_code"] = 1 - result["message"] = "Error: " + str(e) --
Save the Command
-Bugs are tracked on GitHub Issues. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.
-Do not contact contributors directly about support or help with technical issues.
-Current maintainer:
- -This module is part of the cetmix/cetmix-tower project on GitHub.
-You are welcome to contribute.
-