Search code examples
node.jsibm-cloud-infrastructure

How to get fortigate device access using sl api


I am trying to get list of fortigate devices from a specific account using nodejs . I have added a function that uses methods and objects available in the SL api but getting below error:

{ error: 'Function ("GetNetworkVlanFirewall") is not a valid method for this service.',

The API method I'm calling is GetNetworkVlanFirewall under service Network_Vlan

This is the .path I am using:

.path('Network_Vlan','GetNetworkVlanFirewall')

Any help would be appreciated.


Solution

  • It seems that the method name is wrong and the vlan identifier is missing too. Try using the below example:

    .path('Network_Vlan',vlanId,'getNetworkVlanFirewall')
    

    Reference:

    https://softlayer.github.io/reference/services/SoftLayer_Network_Vlan/getNetworkVlanFirewall/

    If you want to know the list of Multi-Vlan-Firewalls in the account you can use the following rest api call:

    Method: GET

    https://api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkGateways?objectMask=mask[id,name,networkFirewall[id,customerManagedFlag,datacenter.name],publicIpAddress.ipAddress,publicVlan[id,primaryRouter.hostname],privateIpAddress.ipAddress,insideVlans[id],memberCount,status.keyName]
    

    To know just the single vlan-firewalls list use the below example:

    Method: GET

    https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Account/getNetworkVlans?objectMask=mask[networkVlanFirewall[billingItem[id,categoryCode,item],firewallType]]
    

    To get the specific information for a network vlan firewall use the following example:

    Method: GET

    https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Network_Vlan_Firewall/[firewallId]/getObject?objectMask=mask[billingItem,customerManagedFlag,fullyQualifiedDomainName,managementCredentials,networkVlan[id,firewallInterfaces,primaryRouter[hostname,id],vlanNumber],primaryIpAddress, bypassRequestStatus]