Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to Add FortiAP/FortiSwitch Device Model with this? #15

Open
Nugeorge opened this issue Aug 11, 2022 · 2 comments
Open

Is it possible to Add FortiAP/FortiSwitch Device Model with this? #15

Nugeorge opened this issue Aug 11, 2022 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Nugeorge
Copy link

As per title, I'm wondering if it's possible to API call adding a FortiAP or FortiSW? Cheers.

@akshaymane920 akshaymane920 added the enhancement New feature or request label Aug 14, 2022
@akshaymane920
Copy link
Owner

Hey @Nugeorge, Thanks for commenting.
I haven't worked on FortiAP or FortiSwitch yet for the project. I will tag it as an Enhancement task
But we can try using "custom_api_call" method, if you know the api call.
If it is successful, you can create a method out of it.
I shall work on it as well.

@akshaymane920 akshaymane920 added the help wanted Extra attention is needed label Feb 26, 2023
@20012455
Copy link

20012455 commented Apr 4, 2023

Hello,
I managed to get the AP's and switches devices.

def get_fortiSwitch(self):
        session = self.login()
        payload = {
            "method":"get","params":[
                {
                    "url":f"pm/config/adom/{self.adom}/obj/fsp/managed-switch",
                    "scope member":[{"name":"All_FortiGate"}]
                }
            ]
        }

        payload.update({"session": self.sessionid})
        get_devices = session.post(
            url=self.base_url, json=payload, verify=False)
        return get_devices.json()
    def get_fortiAp(self):
        session = self.login()
        payload = {
            "method":"get","params":[
                {
                    "url":f"pm/config/adom/{self.adom}/obj/wireless-controller/wtp",
                    "scope member":[{"name":"All_FortiGate"}],
                    "expand datasrc":[{"name":"wtp-profile",
                    "datasrc":[{"obj type":"wireless-controller wtp-profile",
                    "sub fetch":{"platform":{"subfetch hidden":1},
                    "lan":{"subfetch hidden":1},
                    "lbs":{"subfetch hidden":1},
                    "radio-1":{},
                    "radio-2":{},
                    "radio-3":{}},
                    "subfetch filter":1}]}],"data":None
                }
            ]
        }

        payload.update({"session": self.sessionid})
        get_devices = session.post(
            url=self.base_url, json=payload, verify=False)
        return get_devices.json()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants