fortinetdev / terraform-provider-fortimanager

Mozilla Public License 2.0
10 stars 9 forks source link

Potential lack of API for Manipulating "Template Groups" #52

Open Almujalled opened 3 months ago

Almujalled commented 3 months ago

I have encountered a potential gap in the available resources. It appears that there is no API or Terraform resource available for manipulating "Template Groups" that are under "Provisioning Templates" and not to be confused with "CLI Template Groups".

I have attempted to debug the FortiManager CLI while creating a template group through the GUI, but I was unable to identify the URL for the corresponding endpoint.

Could you please confirm if my observation is correct? If there is indeed an endpoint for this operation, could you kindly point me to the correct URL or even better to the corresponding Terrafrom resource?

Here is a screenshot of the GUI where I am trying to create a template group:

Template Group GUI

I appreciate your assistance and look forward to your response.

Thank you.

MaxxLiu22 commented 3 months ago

Hi @Almujalled ,

Thank you for bringing this issue to our attention. At the moment, we don't support that resource because the API team hasn't made it publicly available. I have submitted an internal ticket to request this information from them. As a temporary solution, we can use fortimanager_json_generic_api to address this need. Please let me know if you have any further questions or concerns.

resource "fortimanager_json_generic_api" "tfname" {
  json_content = <<JSON
{
    "method": "add",
    "params": [
        {
            "url": "pm/tmplgrp/adom/root",
            "data": [
                {
                    "name": "test",
                    "type": "tmplgrp",
                    "scope member": [],
                    "template group setting": {
                        "description": "",
                        "cliprofs": [],
                        "wtpprofs": [],
                        "fspprofs": [],
                        "fxtprofs": [],
                        "templates": []
                    }
                }
            ]
        }
    ]
}
JSON
}

Thanks, Maxx