Comments (10)
+ ... .$($version.results.current.minor).$($version.results.current.patch)"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastParseTargetInvocation
my command from test: Invoke-FGTRestMethod -method "get" -uri "api/v2/monitor/system/interface" -connection $fw3 | Format-Table
-----------------------------------------------------------------------------------------------------------------------
http_method results vdom path name action status serial version build
----------- ------- ---- ---- ---- ------ ------ ------ ------- -----
GET @{wan1=; wan2=; modem=; internal1=; internal2=; internal3=; internal4=; internal5=; usb-wan=} root system interface select success FGT40C0123456789 v5.2.15 766
from powerfgt.
Hi,
the release 5.x is EOL and and it is very limited support of API...
from powerfgt.
and about filtering i think, it is coming with 6.0.x
from powerfgt.
The API works.
I tested many points both by rules and by interfaces.
the only problem is filtration ...
I'm sure you can somehow do filtering without API. but by means of built-in methods of powershell, but my knowledge is not enough for this. ((((
+ ... .$($version.results.current.minor).$($version.results.current.patch)"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastParseTargetInvocation
my command from test2: Get-FGTSystemInterface -connection $fw3 -name wan | Select name, username, password, status, mode , ip , speed, mtu, mtu-override | format-table
-----------------------------------------------------------------------------------------------------------------------
name username password status mode ip speed mtu mtu-override
---- -------- -------- ------ ---- -- ----- --- ------------
GUEST-WIFI ENC XXXX up static 10.0.100.1 255.255.255.0 auto 1500 disable
co-3g-w1 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
co-3g-w2 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
co-4g-w1 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
co-4g-w2 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
co-l3-w1 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
co-l3-w2 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
co-l3-w3 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
co-l3-w4 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
internal1 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
internal2 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
internal3 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
internal4 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
internal5 ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
lan ENC XXXX up static 192.168.1.99 255.255.255.0 auto 1500 disable
modem ENC XXXX down pppoe 0.0.0.0 0.0.0.0 auto 1500 disable
ssl.root ENC XXXX up static 0.0.0.0 0.0.0.0 auto 1500 disable
usb-wan ENC XXXX up dhcp 0.0.0.0 0.0.0.0 auto 1500 disable
wan1 ENC XXXX up dhcp 192.168.0.50 255.255.255.0 auto 1500 disable
wan2 ENC XXXX up dhcp 0.0.0.0 0.0.0.0 auto 1500 disable
from powerfgt.
for version, can you try this command for i get the output..
Invoke-FGTRestMethod -u api/v2/monitor/system/firmware).results.current
name : FortiOS
id : current
version : v7.0.0
major : 7
minor : 0
patch : 0
build : 66
branch-point : 66
release-type : GA
notes : https://docs.fortinet.com/document/fortigate/7.0.0/fortios-release-notes/
source : current
platform-id : FGT60F
for filtering with Powershell, you can use Where-Object
for example
Get-FGTSystemInterface | Where-Object {$_.name -eq "wan1"} | Select name, username, password, status, mode , ip , speed, mtu, mtu-override | ft
name username password status mode ip speed mtu mtu-override
---- -------- -------- ------ ---- -- ----- --- ------------
wan1 up static 192.168.44.144 255.255.255.0 auto 1500 disable
from powerfgt.
Invoke-FGTRestMethod -u api/v2/monitor/system/firmware).results.current
hm.... is this exactly the correct command?
$fs=Connect-FGT 192..168.99 -SkipCertificateCheck -DefaultConnection:$false -Timeout 15
Invoke-FGTRestMethod -method "get" -uri "api/v2/monitor/system/firmware" -connection $fs
+ ... .$($version.results.current.minor).$($version.results.current.patch)"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastParseTargetInvocation
http_method : GET
results : @{current=; available=System.Object[]}
vdom : root
path : system
name : firmware
action : select
status : success
serial : FGT40C0123456789
version : v5.2.15
build : 766
found a book for previous OS
http://www.tuncaybas.com/FOS_JSON_REST_API_523.pdf
this is work Get-FGTSystemInterface | Where-Object {$_.name -eq "wan1"}
+ ... .$($version.results.current.minor).$($version.results.current.patch)"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastParseTargetInvocation
name : wan1
username :
password : ENC XXXX
status : up
mode : dhcp
ip : 10.30.20.10 255.255.255.0
speed : auto
mtu : 1500
mtu-override : disable
from powerfgt.
missing a first parenthese
(Invoke-FGTRestMethod -method "get" -uri "api/v2/monitor/system/firmware" -connection $fs).results
and
(Invoke-FGTRestMethod -method "get" -uri "api/v2/monitor/system/firmware" -connection $fs).results.current
from powerfgt.
+ ... .$($version.results.current.minor).$($version.results.current.patch)"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastParseTargetInvocation
current available
------- ---------
@{name=FortiOS; id=current; version=v5.2.15; build=766; branch-point=766; release-type=GA; notes=http://docs.fortinet.com/d/fortios-5.2.15-release-notes/download; source=current; platform-id=FGT40C} {}
... .$($version.results.current.minor).$($version.results.current.patch)"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastParseTargetInvocation
name : FortiOS
id : current
version : v5.2.15
build : 766
branch-point : 766
release-type : GA
notes : http://docs.fortinet.com/d/fortios-5.2.15-release-notes/download
source : current
platform-id : FGT40C
from powerfgt.
Hi
Thanks,i will add a hack/check for detect release 5.x with a warning about missing some feature (like filtering) for next release
from powerfgt.
Ok, i try to look this issue, it is only with very very old release (like 5.2...) but will see what it will make...
from powerfgt.
Related Issues (20)
- Align Filtering with FortiManager (PowerFMG) HOT 1
- Display the progress BAR HOT 5
- Bug with diacritics HOT 9
- Upgrade Path HOT 3
- Upgrade path error HOT 2
- Backup config isn't working HOT 1
- When using the "Remove-FGTFirewallAddressGroupMember" cmdlet, nothing happens HOT 12
- Reg Connect-FGT HOT 4
- Connecting with FortiToken? HOT 3
- Getting Arp Table HOT 2
- Can you create new users? HOT 9
- Upload and replace renewed SSL Certificate offline HOT 3
- Move-FGTFirewallPolicy function problem HOT 1
- Custom HTTPS port? HOT 1
- Error when using "-since" option with Get-FGTLogTraffic command HOT 2
- Unexpected behavior with log search - Get-FGTLogTraffic HOT 6
- MAC address feature request! HOT 1
- add ability to add security profile to firewall policy HOT 4
- Unable to concatenate -srcip and -dstip in the Get-FGTLogTraffic function. HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerfgt.