Read now works, and terraform directory contains example code
This commit is contained in:
1 parent
ef498e4a72
commit
a6f1019175
43 files changed
+4341
-38
No files matched your search
@@ -0,0 +1 @@
|
||||
/terraform-provider-hpe1810
|
||||
@@ -0,0 +1,34 @@
|
||||
module terraform-provider-hpe1810
|
||||
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/PuerkitoBio/goquery v1.12.0
|
||||
github.com/hashicorp/terraform-plugin-framework v1.19.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/andybalholm/cascadia v1.3.3 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/hashicorp/go-hclog v1.6.3 // indirect
|
||||
github.com/hashicorp/go-plugin v1.7.0 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
||||
github.com/hashicorp/terraform-plugin-go v0.31.0 // indirect
|
||||
github.com/hashicorp/terraform-plugin-log v0.10.0 // indirect
|
||||
github.com/hashicorp/terraform-registry-address v0.4.0 // indirect
|
||||
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
|
||||
github.com/hashicorp/yamux v0.1.2 // indirect
|
||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
||||
github.com/oklog/run v1.1.0 // indirect
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
|
||||
golang.org/x/net v0.52.0 // indirect
|
||||
golang.org/x/sys v0.42.0 // indirect
|
||||
golang.org/x/text v0.35.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
|
||||
google.golang.org/grpc v1.79.2 // indirect
|
||||
google.golang.org/protobuf v1.36.11 // indirect
|
||||
)
|
||||
@@ -0,0 +1,168 @@
|
||||
github.com/PuerkitoBio/goquery v1.12.0 h1:pAcL4g3WRXekcB9AU/y1mbKez2dbY2AajVhtkO8RIBo=
|
||||
github.com/PuerkitoBio/goquery v1.12.0/go.mod h1:802ej+gV2y7bbIhOIoPY5sT183ZW0YFofScC4q/hIpQ=
|
||||
github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM=
|
||||
github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA=
|
||||
github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw=
|
||||
github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-plugin v1.7.0 h1:YghfQH/0QmPNc/AZMTFE3ac8fipZyZECHdDPshfk+mA=
|
||||
github.com/hashicorp/go-plugin v1.7.0/go.mod h1:BExt6KEaIYx804z8k4gRzRLEvxKVb+kn0NMcihqOqb8=
|
||||
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
|
||||
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/terraform-plugin-framework v1.19.0 h1:q0bwyhxAOR3vfdgbk9iplv3MlTv/dhBHTXjQOtQDoBA=
|
||||
github.com/hashicorp/terraform-plugin-framework v1.19.0/go.mod h1:YRXOBu0jvs7xp4AThBbX4mAzYaMJ1JgtFH//oGKxwLc=
|
||||
github.com/hashicorp/terraform-plugin-go v0.31.0 h1:0Fz2r9DQ+kNNl6bx8HRxFd1TfMKUvnrOtvJPmp3Z0q8=
|
||||
github.com/hashicorp/terraform-plugin-go v0.31.0/go.mod h1:A88bDhd/cW7FnwqxQRz3slT+QY6yzbHKc6AOTtmdeS8=
|
||||
github.com/hashicorp/terraform-plugin-log v0.10.0 h1:eu2kW6/QBVdN4P3Ju2WiB2W3ObjkAsyfBsL3Wh1fj3g=
|
||||
github.com/hashicorp/terraform-plugin-log v0.10.0/go.mod h1:/9RR5Cv2aAbrqcTSdNmY1NRHP4E3ekrXRGjqORpXyB0=
|
||||
github.com/hashicorp/terraform-registry-address v0.4.0 h1:S1yCGomj30Sao4l5BMPjTGZmCNzuv7/GDTDX99E9gTk=
|
||||
github.com/hashicorp/terraform-registry-address v0.4.0/go.mod h1:LRS1Ay0+mAiRkUyltGT+UHWkIqTFvigGn/LbMshfflE=
|
||||
github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ=
|
||||
github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc=
|
||||
github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8=
|
||||
github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns=
|
||||
github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94=
|
||||
github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU=
|
||||
github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8=
|
||||
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
|
||||
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||
go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48=
|
||||
go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8=
|
||||
go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0=
|
||||
go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs=
|
||||
go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18=
|
||||
go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew=
|
||||
go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI=
|
||||
go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
||||
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
|
||||
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
|
||||
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8=
|
||||
golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
|
||||
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=
|
||||
google.golang.org/grpc v1.79.2 h1:fRMD94s2tITpyJGtBBn7MkMseNpOZU8ZxgC3MMBaXRU=
|
||||
google.golang.org/grpc v1.79.2/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
@@ -0,0 +1,160 @@
|
||||
// Package client is a Go port of the reference Python implementation's
|
||||
// switch_client.py (see ~/code/experiments/hpe/switch_client.py).
|
||||
package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/cookiejar"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
BaseURL string
|
||||
httpClient *http.Client
|
||||
password string
|
||||
}
|
||||
|
||||
func NewClient(host string, https bool, password string) (*Client, error) {
|
||||
scheme := "http"
|
||||
if https {
|
||||
scheme = "https"
|
||||
}
|
||||
jar, err := cookiejar.New(nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("creating cookie jar: %w", err)
|
||||
}
|
||||
return &Client{
|
||||
BaseURL: fmt.Sprintf("%s://%s", scheme, host),
|
||||
httpClient: &http.Client{Jar: jar},
|
||||
password: password,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *Client) resolveURL(path string) string {
|
||||
if strings.HasPrefix(path, "http://") || strings.HasPrefix(path, "https://") {
|
||||
return path
|
||||
}
|
||||
if strings.HasPrefix(path, "/") {
|
||||
return c.BaseURL + path
|
||||
}
|
||||
return c.BaseURL + "/" + path
|
||||
}
|
||||
|
||||
// Login POSTs to /hp_login.html and establishes the session cookie.
|
||||
//
|
||||
// A bare POST occasionally comes back without setting SID (the switch seems
|
||||
// to want a session cookie already present, even an empty one, before it
|
||||
// will issue a real one) -- a GET first makes login reliable.
|
||||
//
|
||||
// Unlike the Python version, there's no on-disk session cache here: this
|
||||
// provider process lives for the whole plan/apply run, so Configure() logs
|
||||
// in once and every resource/data source reuses the same *Client.
|
||||
func (c *Client) Login() error {
|
||||
if _, err := c.httpClient.Get(c.resolveURL("/")); err != nil {
|
||||
return fmt.Errorf("priming session: %w", err)
|
||||
}
|
||||
|
||||
form := url.Values{
|
||||
"pwd": {c.password},
|
||||
"login": {"Login"},
|
||||
"err_flag": {""},
|
||||
"err_msg": {""},
|
||||
}
|
||||
resp, err := c.httpClient.PostForm(c.resolveURL("/hp_login.html"), form)
|
||||
if err != nil {
|
||||
return fmt.Errorf("login request: %w", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return fmt.Errorf("reading login response: %w", err)
|
||||
}
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return fmt.Errorf("login request returned status %d", resp.StatusCode)
|
||||
}
|
||||
if strings.Contains(strings.ToLower(string(body)), "<title>login</title>") {
|
||||
snippet := string(body)
|
||||
if len(snippet) > 500 {
|
||||
snippet = snippet[:500]
|
||||
}
|
||||
return fmt.Errorf("login failed, response still looks like the login page: %q", snippet)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Fetch GETs BaseURL+path (path may be relative or absolute) and returns the body.
|
||||
func (c *Client) Fetch(path string) (string, error) {
|
||||
resp, err := c.httpClient.Get(c.resolveURL(path))
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("fetching %s: %w", path, err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("reading response for %s: %w", path, err)
|
||||
}
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return "", fmt.Errorf("fetching %s returned status %d", path, resp.StatusCode)
|
||||
}
|
||||
return string(body), nil
|
||||
}
|
||||
|
||||
var errFlagRejectedRe = regexp.MustCompile(`(?i)name="err_flag"[^>]*value="1"`)
|
||||
var errMsgRe = regexp.MustCompile(`(?i)name="err_msg"[^>]*value="([^"]*)"`)
|
||||
|
||||
// SubmitForm POSTs fields to path, merged with the firmware's standard
|
||||
// bookkeeping fields (submit_flag, submit_target, err_flag, err_msg,
|
||||
// clazz_information), and returns the response body.
|
||||
//
|
||||
// Returns an error if the response's err_flag comes back "1" -- the
|
||||
// firmware's own validation-failure signal. NOTE: most value validation in
|
||||
// this firmware happens client-side in JS, not on the server -- an invalid
|
||||
// enum value, for example, is just silently ignored (state left unchanged)
|
||||
// rather than reported via err_flag. So this check catches *some* rejected
|
||||
// writes, but a caller that needs certainty should read the value back
|
||||
// afterwards and compare, rather than trusting the absence of an error.
|
||||
func (c *Client) SubmitForm(path string, fields map[string]string) (string, error) {
|
||||
target := strings.TrimPrefix(path, "/")
|
||||
form := url.Values{
|
||||
// 8 == xui_operation_submit (per the firmware's own _xe_jsvars.js);
|
||||
// 1 is xui_operation_reload and silently applies nothing.
|
||||
"submit_flag": {"8"},
|
||||
"submit_target": {target},
|
||||
"err_flag": {"0"},
|
||||
"err_msg": {""},
|
||||
"clazz_information": {target},
|
||||
}
|
||||
for k, v := range fields {
|
||||
form.Set(k, v)
|
||||
}
|
||||
|
||||
resp, err := c.httpClient.PostForm(c.resolveURL(path), form)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("submitting form to %s: %w", path, err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("reading response for %s: %w", path, err)
|
||||
}
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return "", fmt.Errorf("submitting form to %s returned status %d", path, resp.StatusCode)
|
||||
}
|
||||
|
||||
bodyStr := string(body)
|
||||
if errFlagRejectedRe.MatchString(bodyStr) {
|
||||
msg := "unknown error"
|
||||
if m := errMsgRe.FindStringSubmatch(bodyStr); m != nil {
|
||||
msg = m[1]
|
||||
}
|
||||
return "", fmt.Errorf("switch rejected write to %q: %s", path, msg)
|
||||
}
|
||||
return bodyStr, nil
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- (C) Copyright Broadcom Corporation 2000-2020 : This file is auto-generated by XE - DON'T EDIT -->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<TITLE>
|
||||
HP ProCurve Forwarding Database Search
|
||||
</TITLE>
|
||||
<link href="/50021801/css/style1.css" rel="stylesheet" type="text/css" id="fastpath">
|
||||
<script type="text/javascript" src="/50021801/scripts/xui_common.js"></script>
|
||||
<script type="text/javascript" src="/50021801/scripts/globalStyleJS.js"></script>
|
||||
<script type="text/javascript" src="/50021801/scripts/globalStyleJS.js"></script>
|
||||
<script type="text/javascript" >
|
||||
xuiIncludeCommonJSFiles("/50021801/scripts/");
|
||||
xuiIncludeJSFile("/50021801/scripts/_xe_FDBSearch.js");
|
||||
</script>
|
||||
</HEAD>
|
||||
<BODY onload="formLoad();" CLASS=page>
|
||||
<FORM method=post ACTION="/FDBSearch.html">
|
||||
<DIV ID="topdiv">
|
||||
<script type="text/javascript" >
|
||||
</script>
|
||||
<script type="text/javascript" >
|
||||
</script>
|
||||
<DIV id=scalar DIV_XID = 1><TABLE ID=1><CAPTION>MAC Table</CAPTION>
|
||||
<TR id=1_3 class=def>
|
||||
<TD class=defleft id=1_3_1>Maximum Entries Supported</TD>
|
||||
<TD class=defright id=1_3_1><INPUT xid=1_3_1 TYPE=hidden NAME=v_1_3_1 VALUE="8192"></TD>
|
||||
</TR>
|
||||
<TR id=1_2 class=def>
|
||||
<TD class=defleft id=1_2_1>Current Entries</TD>
|
||||
<TD class=defright id=1_2_1><INPUT xid=1_2_1 TYPE=hidden NAME=v_1_2_1 VALUE="2"></TD>
|
||||
</TR>
|
||||
</TABLE></DIV><br>
|
||||
<DIV id=summary NORENDER DIV_XID = 1_1><TABLE ID=1_1><CAPTION></CAPTION>
|
||||
<TH id=1_1_1 style="display:none">MAC Address</TH>
|
||||
<TH id=1_1_5>MAC Address</TH>
|
||||
<TH id=1_1_4>VLAN</TH>
|
||||
<TH id=1_1_2>Source Port</TH>
|
||||
<TH id=1_1_3>MAC Type</TH>
|
||||
|
||||
<tr><td CLASS="tabledata0" style="display: none;">00:01:4C:EA:41:63:04:1B</td><td CLASS="tabledata0">4C:EA:41:63:04:1B</td><td CLASS="tabledata0">1</td><td CLASS="tabledata0">5</td><td CLASS="tabledata0">Learned</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1" style="display: none;">00:01:B4:99:BA:DA:3A:20</td><td CLASS="tabledata1">B4:99:BA:DA:3A:20</td><td CLASS="tabledata1">1</td><td CLASS="tabledata1">CPU</td><td CLASS="tabledata1">Management</td></tr>
|
||||
|
||||
|
||||
|
||||
</TABLE></DIV><br>
|
||||
<script type="text/javascript" >
|
||||
</script>
|
||||
<!-- redirection elements -->
|
||||
<INPUT TYPE="hidden" NAME="submit_flag" XC=hidden VALUE="0">
|
||||
<INPUT TYPE="hidden" NAME="submit_target" XC=hidden VALUE="FDBSearch.html">
|
||||
<INPUT TYPE="hidden" NAME="err_flag" XC=hidden SIZE="16" MAXLENGTH="15" VALUE="0">
|
||||
<INPUT TYPE="hidden" NAME="err_msg" XC=hidden SIZE="80" MAXLENGTH="79" VALUE="">
|
||||
<INPUT TYPE="hidden" NAME="clazz_information" XC=hidden VALUE="FDBSearch.html">
|
||||
<center>
|
||||
<DIV ID="buttons" style="visibility:visible;">
|
||||
<TABLE><TR align=center>
|
||||
</TR></TABLE>
|
||||
</DIV>
|
||||
</center>
|
||||
</DIV>
|
||||
</FORM>
|
||||
</BODY>
|
||||
</HTML>
|
||||
+434
@@ -0,0 +1,434 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- (C) Copyright Broadcom Corporation 2000-2020 : This file is auto-generated by XE - DON'T EDIT -->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<TITLE>
|
||||
HP ProCurve Port Summary
|
||||
</TITLE>
|
||||
<link href="/50021801/css/style1.css" rel="stylesheet" type="text/css" id="fastpath">
|
||||
<script type="text/javascript" src="/50021801/scripts/xui_common.js"></script>
|
||||
<script type="text/javascript" src="/50021801/scripts/globalStyleJS.js"></script>
|
||||
<script type="text/javascript" src="/50021801/scripts/globalStyleJS.js"></script>
|
||||
<script type="text/javascript" >
|
||||
xuiIncludeCommonJSFiles("/50021801/scripts/");
|
||||
xuiIncludeJSFile("/50021801/scripts/_xe_PortSummary.js");
|
||||
</script>
|
||||
</HEAD>
|
||||
<BODY onload="formLoad();" CLASS=page>
|
||||
<FORM method=post ACTION="/PortSummary.html">
|
||||
<DIV ID="topdiv">
|
||||
<script type="text/javascript" >
|
||||
</script>
|
||||
<script type="text/javascript" >
|
||||
</script>
|
||||
<DIV id=summary DIV_XID = 1_1><TABLE ID=1_1><CAPTION>Port Summary</CAPTION>
|
||||
<TH id=1_1_21 style="display:none">UnitIndex</TH>
|
||||
<TH id=1_1_22>Interface</TH>
|
||||
<TH id=1_1_1 style="display:none">Interface</TH>
|
||||
<TH id=1_1_2>Physical Type</TH>
|
||||
<TH id=1_1_3>Port Status</TH>
|
||||
<TH id=1_1_4>AutoNeg Status</TH>
|
||||
<TH id=1_1_5>Link Speed</TH>
|
||||
<TH id=1_1_6>MTU</TH>
|
||||
|
||||
<TR p="1.0.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.0.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.0.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.0.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.0.24.v_1_1_22 VALUE="1"></TD>
|
||||
<TD style="display:none" class="def" p="1.0.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.0.24.v_1_1_1 VALUE="1"></TD>
|
||||
<TD class="def" p="1.0.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.0.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.0.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.0.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.0.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.0.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.0.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.0.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.0.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.0.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.1.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.1.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.1.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.1.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.1.24.v_1_1_22 VALUE="2"></TD>
|
||||
<TD style="display:none" class="def" p="1.1.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.1.24.v_1_1_1 VALUE="2"></TD>
|
||||
<TD class="def" p="1.1.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.1.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.1.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.1.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.1.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.1.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.1.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.1.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.1.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.1.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.2.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.2.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.2.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.2.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.2.24.v_1_1_22 VALUE="3"></TD>
|
||||
<TD style="display:none" class="def" p="1.2.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.2.24.v_1_1_1 VALUE="3"></TD>
|
||||
<TD class="def" p="1.2.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.2.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.2.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.2.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.2.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.2.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.2.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.2.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.2.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.2.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.3.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.3.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.3.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.3.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.3.24.v_1_1_22 VALUE="4"></TD>
|
||||
<TD style="display:none" class="def" p="1.3.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.3.24.v_1_1_1 VALUE="4"></TD>
|
||||
<TD class="def" p="1.3.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.3.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.3.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.3.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.3.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.3.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.3.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.3.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.3.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.3.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.4.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.4.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.4.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.4.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.4.24.v_1_1_22 VALUE="5"></TD>
|
||||
<TD style="display:none" class="def" p="1.4.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.4.24.v_1_1_1 VALUE="5"></TD>
|
||||
<TD class="def" p="1.4.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.4.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.4.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.4.24.v_1_1_3 VALUE="Link Up"></TD>
|
||||
<TD class="def" p="1.4.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.4.24.v_1_1_4 VALUE="Disable"></TD>
|
||||
<TD class="def" p="1.4.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.4.24.v_1_1_5 VALUE="100MbpsFullDuplex"></TD>
|
||||
<TD class="def" p="1.4.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.4.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.5.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.5.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.5.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.5.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.5.24.v_1_1_22 VALUE="6"></TD>
|
||||
<TD style="display:none" class="def" p="1.5.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.5.24.v_1_1_1 VALUE="6"></TD>
|
||||
<TD class="def" p="1.5.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.5.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.5.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.5.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.5.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.5.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.5.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.5.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.5.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.5.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.6.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.6.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.6.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.6.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.6.24.v_1_1_22 VALUE="7"></TD>
|
||||
<TD style="display:none" class="def" p="1.6.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.6.24.v_1_1_1 VALUE="7"></TD>
|
||||
<TD class="def" p="1.6.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.6.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.6.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.6.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.6.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.6.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.6.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.6.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.6.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.6.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.7.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.7.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.7.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.7.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.7.24.v_1_1_22 VALUE="8"></TD>
|
||||
<TD style="display:none" class="def" p="1.7.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.7.24.v_1_1_1 VALUE="8"></TD>
|
||||
<TD class="def" p="1.7.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.7.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.7.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.7.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.7.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.7.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.7.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.7.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.7.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.7.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.8.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.8.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.8.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.8.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.8.24.v_1_1_22 VALUE="9"></TD>
|
||||
<TD style="display:none" class="def" p="1.8.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.8.24.v_1_1_1 VALUE="9"></TD>
|
||||
<TD class="def" p="1.8.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.8.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.8.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.8.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.8.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.8.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.8.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.8.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.8.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.8.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.9.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.9.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.9.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.9.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.9.24.v_1_1_22 VALUE="10"></TD>
|
||||
<TD style="display:none" class="def" p="1.9.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.9.24.v_1_1_1 VALUE="10"></TD>
|
||||
<TD class="def" p="1.9.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.9.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.9.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.9.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.9.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.9.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.9.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.9.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.9.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.9.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.10.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.10.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.10.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.10.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.10.24.v_1_1_22 VALUE="11"></TD>
|
||||
<TD style="display:none" class="def" p="1.10.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.10.24.v_1_1_1 VALUE="11"></TD>
|
||||
<TD class="def" p="1.10.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.10.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.10.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.10.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.10.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.10.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.10.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.10.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.10.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.10.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.11.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.11.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.11.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.11.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.11.24.v_1_1_22 VALUE="12"></TD>
|
||||
<TD style="display:none" class="def" p="1.11.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.11.24.v_1_1_1 VALUE="12"></TD>
|
||||
<TD class="def" p="1.11.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.11.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.11.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.11.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.11.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.11.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.11.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.11.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.11.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.11.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.12.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.12.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.12.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.12.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.12.24.v_1_1_22 VALUE="13"></TD>
|
||||
<TD style="display:none" class="def" p="1.12.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.12.24.v_1_1_1 VALUE="13"></TD>
|
||||
<TD class="def" p="1.12.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.12.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.12.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.12.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.12.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.12.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.12.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.12.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.12.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.12.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.13.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.13.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.13.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.13.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.13.24.v_1_1_22 VALUE="14"></TD>
|
||||
<TD style="display:none" class="def" p="1.13.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.13.24.v_1_1_1 VALUE="14"></TD>
|
||||
<TD class="def" p="1.13.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.13.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.13.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.13.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.13.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.13.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.13.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.13.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.13.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.13.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.14.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.14.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.14.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.14.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.14.24.v_1_1_22 VALUE="15"></TD>
|
||||
<TD style="display:none" class="def" p="1.14.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.14.24.v_1_1_1 VALUE="15"></TD>
|
||||
<TD class="def" p="1.14.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.14.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.14.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.14.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.14.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.14.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.14.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.14.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.14.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.14.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.15.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.15.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.15.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.15.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.15.24.v_1_1_22 VALUE="16"></TD>
|
||||
<TD style="display:none" class="def" p="1.15.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.15.24.v_1_1_1 VALUE="16"></TD>
|
||||
<TD class="def" p="1.15.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.15.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.15.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.15.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.15.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.15.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.15.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.15.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.15.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.15.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.16.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.16.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.16.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.16.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.16.24.v_1_1_22 VALUE="17"></TD>
|
||||
<TD style="display:none" class="def" p="1.16.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.16.24.v_1_1_1 VALUE="17"></TD>
|
||||
<TD class="def" p="1.16.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.16.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.16.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.16.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.16.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.16.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.16.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.16.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.16.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.16.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.17.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.17.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.17.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.17.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.17.24.v_1_1_22 VALUE="18"></TD>
|
||||
<TD style="display:none" class="def" p="1.17.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.17.24.v_1_1_1 VALUE="18"></TD>
|
||||
<TD class="def" p="1.17.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.17.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.17.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.17.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.17.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.17.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.17.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.17.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.17.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.17.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.18.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.18.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.18.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.18.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.18.24.v_1_1_22 VALUE="19"></TD>
|
||||
<TD style="display:none" class="def" p="1.18.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.18.24.v_1_1_1 VALUE="19"></TD>
|
||||
<TD class="def" p="1.18.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.18.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.18.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.18.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.18.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.18.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.18.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.18.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.18.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.18.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.19.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.19.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.19.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.19.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.19.24.v_1_1_22 VALUE="20"></TD>
|
||||
<TD style="display:none" class="def" p="1.19.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.19.24.v_1_1_1 VALUE="20"></TD>
|
||||
<TD class="def" p="1.19.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.19.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.19.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.19.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.19.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.19.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.19.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.19.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.19.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.19.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.20.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.20.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.20.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.20.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.20.24.v_1_1_22 VALUE="21"></TD>
|
||||
<TD style="display:none" class="def" p="1.20.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.20.24.v_1_1_1 VALUE="21"></TD>
|
||||
<TD class="def" p="1.20.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.20.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.20.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.20.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.20.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.20.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.20.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.20.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.20.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.20.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.21.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.21.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.21.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.21.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.21.24.v_1_1_22 VALUE="22"></TD>
|
||||
<TD style="display:none" class="def" p="1.21.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.21.24.v_1_1_1 VALUE="22"></TD>
|
||||
<TD class="def" p="1.21.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.21.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.21.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.21.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.21.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.21.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.21.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.21.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.21.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.21.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.22.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.22.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.22.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.22.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.22.24.v_1_1_22 VALUE="23"></TD>
|
||||
<TD style="display:none" class="def" p="1.22.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.22.24.v_1_1_1 VALUE="23"></TD>
|
||||
<TD class="def" p="1.22.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.22.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.22.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.22.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.22.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.22.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.22.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.22.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.22.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.22.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
<TR p="1.23.240" id=1_1>
|
||||
<TD style="display:none" class="def" p="1.23.240" id=1_1_21 ><INPUT xid=1_1_21 TYPE=hidden NAME=1.23.24.v_1_1_21 VALUE="1"></TD>
|
||||
<TD class="def" p="1.23.240" id=1_1_22><INPUT xid=1_1_22 TYPE=hidden NAME=1.23.24.v_1_1_22 VALUE="24"></TD>
|
||||
<TD style="display:none" class="def" p="1.23.240" id=1_1_1 ><INPUT xid=1_1_1 TYPE=hidden NAME=1.23.24.v_1_1_1 VALUE="24"></TD>
|
||||
<TD class="def" p="1.23.240" id=1_1_2><INPUT xid=1_1_2 TYPE=hidden NAME=1.23.24.v_1_1_2 VALUE="RJ45"></TD>
|
||||
<TD class="def" p="1.23.240" id=1_1_3><INPUT xid=1_1_3 TYPE=hidden NAME=1.23.24.v_1_1_3 VALUE="Link Down"></TD>
|
||||
<TD class="def" p="1.23.240" id=1_1_4><INPUT xid=1_1_4 TYPE=hidden NAME=1.23.24.v_1_1_4 VALUE="Enable"></TD>
|
||||
<TD class="def" p="1.23.240" id=1_1_5><INPUT xid=1_1_5 TYPE=hidden NAME=1.23.24.v_1_1_5 VALUE=" "></TD>
|
||||
<TD class="def" p="1.23.240" id=1_1_6><INPUT xid=1_1_6 TYPE=hidden NAME=1.23.24.v_1_1_6 VALUE="1518"></TD>
|
||||
</TR>
|
||||
|
||||
</TABLE></DIV><br>
|
||||
<DIV id=summary NORENDER DIV_XID = 2_3><TABLE ID=2_3><CAPTION>Port Statistics</CAPTION>
|
||||
<TH id=2_3_1>Interface</TH>
|
||||
<TH id=2_3_6 style="display:none">ifIndex</TH>
|
||||
<TH id=2_3_13 style="display:none">ifIndex</TH>
|
||||
<TH id=2_3_2>Received Packets <BR>w/o Error</TH>
|
||||
<TH id=2_3_3>Received Packets <BR>with Error</TH>
|
||||
<TH id=2_3_7>Broadcast<BR>Received Packets</TH>
|
||||
<TH id=2_3_8>Transmitted Packets <BR>w/o Errors</TH>
|
||||
<TH id=2_3_9>Transmitted Packets <BR>with Errors</TH>
|
||||
<TH id=2_3_10>Collisions</TH>
|
||||
<TH id=2_3_11>Transmitted <BR>Pause Frames</TH>
|
||||
<TH id=2_3_12>Received <BR>Pause Frames</TH>
|
||||
|
||||
<tr><td CLASS="tabledata0">1</td><td CLASS="tabledata0" style="display: none;">1</td><td CLASS="tabledata0" style="display: none;">1</td><td CLASS="tabledata0">11338</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">79</td><td CLASS="tabledata0">11918</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1">2</td><td CLASS="tabledata1" style="display: none;">2</td><td CLASS="tabledata1" style="display: none;">2</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata0">3</td><td CLASS="tabledata0" style="display: none;">3</td><td CLASS="tabledata0" style="display: none;">3</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1">4</td><td CLASS="tabledata1" style="display: none;">4</td><td CLASS="tabledata1" style="display: none;">4</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata0">5</td><td CLASS="tabledata0" style="display: none;">5</td><td CLASS="tabledata0" style="display: none;">5</td><td CLASS="tabledata0">4832</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">27</td><td CLASS="tabledata0">5390</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1">6</td><td CLASS="tabledata1" style="display: none;">6</td><td CLASS="tabledata1" style="display: none;">6</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata0">7</td><td CLASS="tabledata0" style="display: none;">7</td><td CLASS="tabledata0" style="display: none;">7</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1">8</td><td CLASS="tabledata1" style="display: none;">8</td><td CLASS="tabledata1" style="display: none;">8</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata0">9</td><td CLASS="tabledata0" style="display: none;">9</td><td CLASS="tabledata0" style="display: none;">9</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1">10</td><td CLASS="tabledata1" style="display: none;">10</td><td CLASS="tabledata1" style="display: none;">10</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata0">11</td><td CLASS="tabledata0" style="display: none;">11</td><td CLASS="tabledata0" style="display: none;">11</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1">12</td><td CLASS="tabledata1" style="display: none;">12</td><td CLASS="tabledata1" style="display: none;">12</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata0">13</td><td CLASS="tabledata0" style="display: none;">13</td><td CLASS="tabledata0" style="display: none;">13</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1">14</td><td CLASS="tabledata1" style="display: none;">14</td><td CLASS="tabledata1" style="display: none;">14</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata0">15</td><td CLASS="tabledata0" style="display: none;">15</td><td CLASS="tabledata0" style="display: none;">15</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1">16</td><td CLASS="tabledata1" style="display: none;">16</td><td CLASS="tabledata1" style="display: none;">16</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata0">17</td><td CLASS="tabledata0" style="display: none;">17</td><td CLASS="tabledata0" style="display: none;">17</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1">18</td><td CLASS="tabledata1" style="display: none;">18</td><td CLASS="tabledata1" style="display: none;">18</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata0">19</td><td CLASS="tabledata0" style="display: none;">19</td><td CLASS="tabledata0" style="display: none;">19</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1">20</td><td CLASS="tabledata1" style="display: none;">20</td><td CLASS="tabledata1" style="display: none;">20</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata0">21</td><td CLASS="tabledata0" style="display: none;">21</td><td CLASS="tabledata0" style="display: none;">21</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1">22</td><td CLASS="tabledata1" style="display: none;">22</td><td CLASS="tabledata1" style="display: none;">22</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata0">23</td><td CLASS="tabledata0" style="display: none;">23</td><td CLASS="tabledata0" style="display: none;">23</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td><td CLASS="tabledata0">0</td></tr>
|
||||
|
||||
|
||||
<tr><td CLASS="tabledata1">24</td><td CLASS="tabledata1" style="display: none;">24</td><td CLASS="tabledata1" style="display: none;">24</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td><td CLASS="tabledata1">0</td></tr>
|
||||
|
||||
|
||||
|
||||
</TABLE></DIV><br>
|
||||
<DIV id=summary NORENDER DIV_XID = 4_3><TABLE ID=4_3><CAPTION>Trunk Statistics</CAPTION>
|
||||
<TH id=4_3_1>Trunk</TH>
|
||||
<TH id=4_3_6 style="display:none">ifIndex</TH>
|
||||
<TH id=4_3_11 style="display:none">ifIndex</TH>
|
||||
<TH id=4_3_2>Received Packets <BR>w/o Error</TH>
|
||||
<TH id=4_3_3>Received Packets <BR>with Error</TH>
|
||||
<TH id=4_3_7>Broadcast<BR>Received Packets</TH>
|
||||
<TH id=4_3_8>Transmitted Packets <BR>w/o Errors</TH>
|
||||
<TH id=4_3_9>Transmitted Packets <BR>with Errors</TH>
|
||||
<TH id=4_3_10>Collisions</TH>
|
||||
|
||||
|
||||
</TABLE></DIV><br>
|
||||
|
||||
<DIV id=buttons DIV_XID = 3><TABLE ID=3><CAPTION> </CAPTION>
|
||||
<TD id=3_1_2 style="display:none" ><INPUT xid=3_1_2 TYPE=hidden NAME=v_3_1_2 VALUE="TRUE"></TD>
|
||||
</TABLE></DIV><br>
|
||||
|
||||
<script type="text/javascript" >
|
||||
allWebEnums.e_v_1_1_21_values = [ "1" ];
|
||||
allWebEnums.e_v_1_1_21_eactions = [];
|
||||
allWebEnums.e_v_1_1_21 = xuiInsertEActionStrings("1_1_21" , allWebEnums.e_v_1_1_21_values,allWebEnums.e_v_1_1_21_eactions);
|
||||
allWebEnums.e_v_1_1_22_values = [ "1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24" ];
|
||||
allWebEnums.e_v_1_1_22_eactions = [];
|
||||
allWebEnums.e_v_1_1_22 = xuiInsertEActionStrings("1_1_22" , allWebEnums.e_v_1_1_22_values,allWebEnums.e_v_1_1_22_eactions);
|
||||
allWebEnums.e_v_1_1_1_values = [ "1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24" ];
|
||||
allWebEnums.e_v_1_1_1_eactions = [];
|
||||
allWebEnums.e_v_1_1_1 = xuiInsertEActionStrings("1_1_1" , allWebEnums.e_v_1_1_1_values,allWebEnums.e_v_1_1_1_eactions);
|
||||
</script>
|
||||
<!-- redirection elements -->
|
||||
<INPUT TYPE="hidden" NAME="submit_flag" XC=hidden VALUE="0">
|
||||
<INPUT TYPE="hidden" NAME="submit_target" XC=hidden VALUE="PortSummary.html">
|
||||
<INPUT TYPE="hidden" NAME="err_flag" XC=hidden SIZE="16" MAXLENGTH="15" VALUE="0">
|
||||
<INPUT TYPE="hidden" NAME="err_msg" XC=hidden SIZE="80" MAXLENGTH="79" VALUE="">
|
||||
<INPUT TYPE="hidden" NAME="clazz_information" XC=hidden VALUE="PortSummary.html">
|
||||
<center>
|
||||
<DIV ID="buttons" style="visibility:visible;">
|
||||
<TABLE><TR align=center>
|
||||
|
||||
<TD id=3_1_1><INPUT xid=3_1_1 DISABLED TYPE=hidden NAME=v_3_1_1 VALUE="Clear"></TD>
|
||||
|
||||
</TR></TABLE>
|
||||
</DIV>
|
||||
</center>
|
||||
</DIV>
|
||||
</FORM>
|
||||
</BODY>
|
||||
</HTML>
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- (C) Copyright Broadcom Corporation 2000-2020 : This file is auto-generated by XE - DON'T EDIT -->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<TITLE>
|
||||
HP ProCurve
|
||||
</TITLE>
|
||||
<link href="/50021801/css/style1.css" rel="stylesheet" type="text/css" id="fastpath">
|
||||
<script type="text/javascript" src="/50021801/scripts/xui_common.js"></script>
|
||||
<script type="text/javascript" src="/50021801/scripts/globalStyleJS.js"></script>
|
||||
<script type="text/javascript" src="/50021801/scripts/globalStyleJS.js"></script>
|
||||
<script type="text/javascript" >
|
||||
xuiIncludeCommonJSFiles("/50021801/scripts/");
|
||||
xuiIncludeJSFile("/50021801/scripts/_xe_SysDescription.js");
|
||||
</script>
|
||||
</HEAD>
|
||||
<BODY onload="formLoad();" CLASS=page>
|
||||
<FORM method=post ACTION="/SysDescription.html">
|
||||
<DIV ID="topdiv">
|
||||
<script type="text/javascript" >
|
||||
xeValData.xv_1_2_1_260 = "Error! Invalid String:Unable to set '$$objName$$' with '$$objValue$$'.";
|
||||
xeValData.xv_1_2_1_340 = "Error! Invalid String:Unable to set '$$objName$$' with '$$objValue$$'. Enter string with alphanumeric characters, hyphens and commas.";
|
||||
xeValData.xv_1_3_1_260 = "Error! Invalid String:Unable to set '$$objName$$' with '$$objValue$$'.";
|
||||
xeValData.xv_1_3_1_340 = "Error! Invalid String:Unable to set '$$objName$$' with '$$objValue$$'. Enter string with alphanumeric characters, hyphens and commas.";
|
||||
xeValData.xv_1_4_1_260 = "Error! Invalid String:Unable to set '$$objName$$' with '$$objValue$$'.";
|
||||
xeValData.xv_1_4_1_340 = "Error! Invalid String:Unable to set '$$objName$$' with '$$objValue$$'. Enter string with alphanumeric characters, hyphens and commas.";
|
||||
</script>
|
||||
<script type="text/javascript" >
|
||||
xeData.arghelp_1_11_1 = "( hh:mm:ss )";
|
||||
</script>
|
||||
<DIV id=scalar DIV_XID = 1><TABLE ID=1><CAPTION>System Description </CAPTION>
|
||||
<TR id=1_1 class=def>
|
||||
<TD class=defleft id=1_1_1>System Description</TD>
|
||||
<TD class=defright id=1_1_1><INPUT xid=1_1_1 TYPE=hidden NAME=v_1_1_1 VALUE=" HP ProCurve 1810G - 24 GE, P.2.24, eCos-2.0, CFE-2.1"></TD>
|
||||
</TR>
|
||||
|
||||
<TR id=1_2 class=def>
|
||||
<TD class=defleft id=1_2_1>System Name</TD>
|
||||
<TD class=defright id=1_2_1><INPUT xid=1_2_1 TYPE=hidden NAME=v_1_2_1 VALUE="Draupnir01"></TD>
|
||||
</TR>
|
||||
|
||||
|
||||
<TR id=1_3 class=def>
|
||||
<TD class=defleft id=1_3_1>System Location</TD>
|
||||
<TD class=defright id=1_3_1><INPUT xid=1_3_1 TYPE=hidden NAME=v_1_3_1 VALUE="Lab"></TD>
|
||||
</TR>
|
||||
|
||||
|
||||
<TR id=1_4 class=def>
|
||||
<TD class=defleft id=1_4_1>System Contact</TD>
|
||||
<TD class=defright id=1_4_1><INPUT xid=1_4_1 TYPE=hidden NAME=v_1_4_1 VALUE=""></TD>
|
||||
</TR>
|
||||
|
||||
|
||||
|
||||
|
||||
<TR id=1_8 class=def>
|
||||
<TD class=defleft id=1_8_1>Software Version</TD>
|
||||
<TD class=defright id=1_8_1><INPUT xid=1_8_1 TYPE=hidden NAME=v_1_8_1 VALUE="P.2.24"></TD>
|
||||
</TR>
|
||||
<TR id=1_9 class=def>
|
||||
<TD class=defleft id=1_9_1>System Object ID</TD>
|
||||
<TD class=defright id=1_9_1><INPUT xid=1_9_1 TYPE=hidden NAME=v_1_9_1 VALUE="1.3.6.1.4.1.11.2.3.7.11.104"></TD>
|
||||
</TR>
|
||||
<TR id=1_10 class=def>
|
||||
<TD class=defleft id=1_10_1>System Up Time</TD>
|
||||
<TD class=defright id=1_10_1><INPUT xid=1_10_1 TYPE=hidden NAME=v_1_10_1 VALUE="0 days, 3 hours, 56 mins, 19 secs"></TD>
|
||||
</TR>
|
||||
<TR id=1_11 class=def>
|
||||
<TD class=defleft id=1_11_1>Current Time</TD>
|
||||
<TD class=defright id=1_11_1><INPUT xid=1_11_1 TYPE=hidden NAME=v_1_11_1 VALUE="04:56:19"></TD>
|
||||
</TR>
|
||||
<TR id=1_12 class=def>
|
||||
<TD class=defleft id=1_12_1>Date</TD>
|
||||
<TD class=defright id=1_12_1><INPUT xid=1_12_1 TYPE=hidden NAME=v_1_12_1 VALUE="01/01/1970"></TD>
|
||||
</TR>
|
||||
</TABLE></DIV><br>
|
||||
|
||||
|
||||
<DIV id=buttons DIV_XID = 2><TABLE ID=2><CAPTION> </CAPTION>
|
||||
</TABLE></DIV><br>
|
||||
|
||||
|
||||
<script type="text/javascript" >
|
||||
</script>
|
||||
<!-- redirection elements -->
|
||||
<INPUT TYPE="hidden" NAME="submit_flag" XC=hidden VALUE="0">
|
||||
<INPUT TYPE="hidden" NAME="submit_target" XC=hidden VALUE="SysDescription.html">
|
||||
<INPUT TYPE="hidden" NAME="err_flag" XC=hidden SIZE="16" MAXLENGTH="15" VALUE="0">
|
||||
<INPUT TYPE="hidden" NAME="err_msg" XC=hidden SIZE="80" MAXLENGTH="79" VALUE="">
|
||||
<INPUT TYPE="hidden" NAME="clazz_information" XC=hidden VALUE="SysDescription.html">
|
||||
<center>
|
||||
<DIV ID="buttons" style="visibility:visible;">
|
||||
<TABLE><TR align=center>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<TD id=2_1_1><INPUT xid=2_1_1 DISABLED TYPE=hidden NAME=v_2_1_1 VALUE="Apply"></TD>
|
||||
|
||||
|
||||
|
||||
</TR></TABLE>
|
||||
</DIV>
|
||||
</center>
|
||||
</DIV>
|
||||
</FORM>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -0,0 +1,137 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/xe_page.py -- see that file's
|
||||
// docstring for the two table shapes this parses.
|
||||
//
|
||||
// Note on traversal: the switch firmware's HTML puts <TH>/<TR> as direct
|
||||
// children of <TABLE> with no <TBODY> wrapper. A strict browser-grade HTML5
|
||||
// parser (which golang.org/x/net/html, underlying goquery, implements) would
|
||||
// normally insert a synthetic <TBODY> around those rows, which would break a
|
||||
// "direct children only" traversal the way the Python version does (Python's
|
||||
// html.parser is lenient and doesn't insert one). We sidestep this by using
|
||||
// Find() (any descendant) instead of direct-children selectors -- safe here
|
||||
// because tables in this firmware are never nested inside one another.
|
||||
package client
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
)
|
||||
|
||||
type Table struct {
|
||||
Caption string
|
||||
Kind string // "scalar" | "tabular"
|
||||
Record map[string]string
|
||||
FieldNames map[string]string
|
||||
Rows []map[string]string
|
||||
ID string
|
||||
}
|
||||
|
||||
func extractCellValue(td *goquery.Selection) string {
|
||||
if inp := td.Find("input").First(); inp.Length() > 0 {
|
||||
if v, exists := inp.Attr("value"); exists {
|
||||
return v
|
||||
}
|
||||
return ""
|
||||
}
|
||||
return strings.TrimSpace(td.Text())
|
||||
}
|
||||
|
||||
func parseTable(table *goquery.Selection) Table {
|
||||
id, _ := table.Attr("id")
|
||||
caption := strings.TrimSpace(table.Find("caption").First().Text())
|
||||
|
||||
var headers []string
|
||||
table.Find("th").Each(func(_ int, th *goquery.Selection) {
|
||||
headers = append(headers, strings.TrimSpace(th.Text()))
|
||||
})
|
||||
|
||||
if len(headers) > 0 {
|
||||
var rows []map[string]string
|
||||
table.Find("tr").Each(func(_ int, tr *goquery.Selection) {
|
||||
tds := tr.Find("td")
|
||||
if tds.Length() != len(headers) {
|
||||
return
|
||||
}
|
||||
row := make(map[string]string, len(headers))
|
||||
tds.Each(func(i int, td *goquery.Selection) {
|
||||
// Later (visible) column wins on a duplicate header label --
|
||||
// see the same caveat noted in extractors/xe_page.py.
|
||||
row[headers[i]] = extractCellValue(td)
|
||||
})
|
||||
rows = append(rows, row)
|
||||
})
|
||||
return Table{Caption: caption, Kind: "tabular", Rows: rows, ID: id}
|
||||
}
|
||||
|
||||
record := make(map[string]string)
|
||||
fieldNames := make(map[string]string)
|
||||
table.Find("tr").Each(func(_ int, tr *goquery.Selection) {
|
||||
defleft := tr.Find("td.defleft").First()
|
||||
defright := tr.Find("td.defright").First()
|
||||
if defleft.Length() == 0 || defright.Length() == 0 {
|
||||
return
|
||||
}
|
||||
label := strings.TrimSpace(defleft.Text())
|
||||
if label == "" {
|
||||
return
|
||||
}
|
||||
record[label] = extractCellValue(defright)
|
||||
if inp := defright.Find("input").First(); inp.Length() > 0 {
|
||||
if name, exists := inp.Attr("name"); exists && name != "" {
|
||||
fieldNames[label] = name
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return Table{
|
||||
Caption: caption,
|
||||
Kind: "scalar",
|
||||
Record: record,
|
||||
FieldNames: fieldNames,
|
||||
ID: id,
|
||||
}
|
||||
}
|
||||
|
||||
// ParseXETables parses every <TABLE> in html, in document order.
|
||||
func ParseXETables(html string) ([]Table, error) {
|
||||
doc, err := goquery.NewDocumentFromReader(strings.NewReader(html))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var tables []Table
|
||||
doc.Find("table").Each(func(_ int, table *goquery.Selection) {
|
||||
tables = append(tables, parseTable(table))
|
||||
})
|
||||
return tables, nil
|
||||
}
|
||||
|
||||
// FetchTables fetches path and returns {caption: table} for every captioned
|
||||
// table. Tables with no/blank caption are dropped -- use FetchAllTables +
|
||||
// Table.ID for those (e.g. the MAC Table entries table on FDBSearch.html).
|
||||
func (c *Client) FetchTables(path string) (map[string]Table, error) {
|
||||
html, err := c.Fetch(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tables, err := ParseXETables(html)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := make(map[string]Table, len(tables))
|
||||
for _, t := range tables {
|
||||
if t.Caption != "" {
|
||||
result[t.Caption] = t
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// FetchAllTables fetches path and returns every table, including
|
||||
// uncaptioned ones, in document order.
|
||||
func (c *Client) FetchAllTables(path string) ([]Table, error) {
|
||||
html, err := c.Fetch(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseXETables(html)
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func loadFixture(t *testing.T, name string) string {
|
||||
t.Helper()
|
||||
data, err := os.ReadFile("testdata/" + name)
|
||||
if err != nil {
|
||||
t.Fatalf("reading fixture %s: %v", name, err)
|
||||
}
|
||||
return string(data)
|
||||
}
|
||||
|
||||
// Expected values below were captured live from the real switch (see
|
||||
// ~/code/experiments/hpe/page_snapshots/current_state.json) at the time
|
||||
// these fixtures were saved -- this test is about the parser's correctness,
|
||||
// not about the switch's current state.
|
||||
|
||||
func TestParseXETables_ScalarShape_SysDescription(t *testing.T) {
|
||||
tables, err := ParseXETables(loadFixture(t, "SysDescription.html"))
|
||||
if err != nil {
|
||||
t.Fatalf("ParseXETables: %v", err)
|
||||
}
|
||||
|
||||
var sysDesc *Table
|
||||
for i := range tables {
|
||||
if tables[i].Caption == "System Description" {
|
||||
sysDesc = &tables[i]
|
||||
}
|
||||
}
|
||||
if sysDesc == nil {
|
||||
t.Fatalf("no table captioned %q found; got captions: %v", "System Description", captions(tables))
|
||||
}
|
||||
if sysDesc.Kind != "scalar" {
|
||||
t.Errorf("Kind = %q, want %q", sysDesc.Kind, "scalar")
|
||||
}
|
||||
|
||||
want := map[string]string{
|
||||
"System Name": "Draupnir01",
|
||||
"System Location": "Lab",
|
||||
"Software Version": "P.2.24",
|
||||
}
|
||||
for label, wantValue := range want {
|
||||
if got := sysDesc.Record[label]; got != wantValue {
|
||||
t.Errorf("Record[%q] = %q, want %q", label, got, wantValue)
|
||||
}
|
||||
}
|
||||
|
||||
if fieldName := sysDesc.FieldNames["System Name"]; fieldName != "v_1_2_1" {
|
||||
t.Errorf("FieldNames[%q] = %q, want %q", "System Name", fieldName, "v_1_2_1")
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseXETables_TabularShape_PortSummary(t *testing.T) {
|
||||
tables, err := ParseXETables(loadFixture(t, "PortSummary.html"))
|
||||
if err != nil {
|
||||
t.Fatalf("ParseXETables: %v", err)
|
||||
}
|
||||
|
||||
var portSummary *Table
|
||||
for i := range tables {
|
||||
if tables[i].Caption == "Port Summary" {
|
||||
portSummary = &tables[i]
|
||||
}
|
||||
}
|
||||
if portSummary == nil {
|
||||
t.Fatalf("no table captioned %q found; got captions: %v", "Port Summary", captions(tables))
|
||||
}
|
||||
if portSummary.Kind != "tabular" {
|
||||
t.Errorf("Kind = %q, want %q", portSummary.Kind, "tabular")
|
||||
}
|
||||
if len(portSummary.Rows) != 24 {
|
||||
t.Fatalf("len(Rows) = %d, want 24", len(portSummary.Rows))
|
||||
}
|
||||
|
||||
first := portSummary.Rows[0]
|
||||
if first["Interface"] != "1" {
|
||||
t.Errorf(`Rows[0]["Interface"] = %q, want "1"`, first["Interface"])
|
||||
}
|
||||
if first["Physical Type"] != "RJ45" {
|
||||
t.Errorf(`Rows[0]["Physical Type"] = %q, want "RJ45"`, first["Physical Type"])
|
||||
}
|
||||
}
|
||||
|
||||
func TestFetchAllTables_BlankCaptionTable_FDBSearch(t *testing.T) {
|
||||
tables, err := ParseXETables(loadFixture(t, "FDBSearch.html"))
|
||||
if err != nil {
|
||||
t.Fatalf("ParseXETables: %v", err)
|
||||
}
|
||||
|
||||
var summary, entries *Table
|
||||
for i := range tables {
|
||||
if tables[i].Caption == "MAC Table" {
|
||||
summary = &tables[i]
|
||||
}
|
||||
if tables[i].ID == "1_1" {
|
||||
entries = &tables[i]
|
||||
}
|
||||
}
|
||||
if summary == nil {
|
||||
t.Fatalf("no table captioned %q found; got captions: %v", "MAC Table", captions(tables))
|
||||
}
|
||||
if summary.Record["Current Entries"] != "2" {
|
||||
t.Errorf(`summary.Record["Current Entries"] = %q, want "2"`, summary.Record["Current Entries"])
|
||||
}
|
||||
|
||||
if entries == nil {
|
||||
t.Fatalf("no table with id %q found", "1_1")
|
||||
}
|
||||
if entries.Kind != "tabular" {
|
||||
t.Errorf("entries.Kind = %q, want %q", entries.Kind, "tabular")
|
||||
}
|
||||
if len(entries.Rows) != 2 {
|
||||
t.Fatalf("len(entries.Rows) = %d, want 2", len(entries.Rows))
|
||||
}
|
||||
if entries.Rows[0]["MAC Address"] != "4C:EA:41:63:04:1B" {
|
||||
t.Errorf(`entries.Rows[0]["MAC Address"] = %q, want "4C:EA:41:63:04:1B"`, entries.Rows[0]["MAC Address"])
|
||||
}
|
||||
}
|
||||
|
||||
func captions(tables []Table) []string {
|
||||
out := make([]string, len(tables))
|
||||
for i, t := range tables {
|
||||
out[i] = t.Caption
|
||||
}
|
||||
return out
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Shared helpers for turning client.Table pieces (plain Go maps/slices) into
|
||||
// the typed map/list values the Plugin Framework wants in state.
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/diag"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
var rowType = types.MapType{ElemType: types.StringType}
|
||||
|
||||
func stringMapToTF(ctx context.Context, m map[string]string) (types.Map, diag.Diagnostics) {
|
||||
return types.MapValueFrom(ctx, types.StringType, m)
|
||||
}
|
||||
|
||||
func rowsToTF(ctx context.Context, rows []map[string]string) (types.List, diag.Diagnostics) {
|
||||
return types.ListValueFrom(ctx, rowType, rows)
|
||||
}
|
||||
|
||||
func tableOfRecordsToTF(ctx context.Context, tables map[string]map[string]string) (types.Map, diag.Diagnostics) {
|
||||
return types.MapValueFrom(ctx, types.MapType{ElemType: types.StringType}, tables)
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/backup_manager.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const backupManagerPath = "/UploadFile.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &backupManagerDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &backupManagerDataSource{}
|
||||
)
|
||||
|
||||
func NewBackupManagerDataSource() datasource.DataSource {
|
||||
return &backupManagerDataSource{}
|
||||
}
|
||||
|
||||
type backupManagerDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type backupManagerModel struct {
|
||||
Values types.Map `tfsdk:"values"`
|
||||
}
|
||||
|
||||
func (d *backupManagerDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_backup_manager"
|
||||
}
|
||||
|
||||
func (d *backupManagerDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's Backup/Upload File page's current form fields (method, server address, etc.). This is a config form, not a data table, so values reflect whatever was last configured or left blank.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"values": schema.MapAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *backupManagerDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *backupManagerDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchTables(backupManagerPath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch Backup page", err.Error())
|
||||
return
|
||||
}
|
||||
table, ok := tables["Backup"]
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table captioned "Backup" not found`)
|
||||
return
|
||||
}
|
||||
|
||||
valuesValue, diags := stringMapToTF(ctx, table.Record)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
state := backupManagerModel{Values: valuesValue}
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/buffered_log.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const bufferedLogPath = "/BufferedLogs.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &bufferedLogDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &bufferedLogDataSource{}
|
||||
)
|
||||
|
||||
func NewBufferedLogDataSource() datasource.DataSource {
|
||||
return &bufferedLogDataSource{}
|
||||
}
|
||||
|
||||
type bufferedLogDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type bufferedLogModel struct {
|
||||
Entries types.List `tfsdk:"entries"`
|
||||
}
|
||||
|
||||
func (d *bufferedLogDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_buffered_log"
|
||||
}
|
||||
|
||||
func (d *bufferedLogDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's Buffered Log page: one entry per log message (Log Index, Severity, Log Time, Component, Description, Message Text).",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"entries": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.MapType{ElemType: types.StringType},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *bufferedLogDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *bufferedLogDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchTables(bufferedLogPath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch Buffered Log page", err.Error())
|
||||
return
|
||||
}
|
||||
table, ok := tables["Log Message"]
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table captioned "Log Message" not found`)
|
||||
return
|
||||
}
|
||||
|
||||
entriesValue, diags := rowsToTF(ctx, table.Rows)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
state := bufferedLogModel{Entries: entriesValue}
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/clock.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const clockPath = "/Clock_Detail.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &clockDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &clockDataSource{}
|
||||
)
|
||||
|
||||
func NewClockDataSource() datasource.DataSource {
|
||||
return &clockDataSource{}
|
||||
}
|
||||
|
||||
type clockDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type clockModel struct {
|
||||
Tables types.Map `tfsdk:"tables"`
|
||||
}
|
||||
|
||||
func (d *clockDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_clock"
|
||||
}
|
||||
|
||||
func (d *clockDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's Clock Detail page: Current Time, Time Zone and Daylight Saving Time, keyed by table caption.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"tables": schema.MapAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.MapType{ElemType: types.StringType},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *clockDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *clockDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchTables(clockPath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch Clock Detail page", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
records := make(map[string]map[string]string, len(tables))
|
||||
for caption, table := range tables {
|
||||
records[caption] = table.Record
|
||||
}
|
||||
|
||||
tablesValue, diags := tableOfRecordsToTF(ctx, records)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
state := clockModel{Tables: tablesValue}
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/dual_image_status.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const dualImageStatusPath = "/dual_image_status.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &dualImageStatusDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &dualImageStatusDataSource{}
|
||||
)
|
||||
|
||||
func NewDualImageStatusDataSource() datasource.DataSource {
|
||||
return &dualImageStatusDataSource{}
|
||||
}
|
||||
|
||||
type dualImageStatusDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type dualImageStatusModel struct {
|
||||
Units types.List `tfsdk:"units"`
|
||||
}
|
||||
|
||||
func (d *dualImageStatusDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_dual_image_status"
|
||||
}
|
||||
|
||||
func (d *dualImageStatusDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's Dual Image Status page: one entry per unit (Active image, Next-Active image). The page's separate \"Dual Image Descriptions\" table uses a header shape the generic parser doesn't handle and is skipped, matching the Python reference implementation.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"units": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.MapType{ElemType: types.StringType},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *dualImageStatusDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *dualImageStatusDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchTables(dualImageStatusPath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch Dual Image Status page", err.Error())
|
||||
return
|
||||
}
|
||||
table, ok := tables["Dual Image Status"]
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table captioned "Dual Image Status" not found`)
|
||||
return
|
||||
}
|
||||
|
||||
unitsValue, diags := rowsToTF(ctx, table.Rows)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
state := dualImageStatusModel{Units: unitsValue}
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/lldp_statistics.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const lldpStatisticsPath = "/LLDPStats.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &lldpStatisticsDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &lldpStatisticsDataSource{}
|
||||
)
|
||||
|
||||
func NewLLDPStatisticsDataSource() datasource.DataSource {
|
||||
return &lldpStatisticsDataSource{}
|
||||
}
|
||||
|
||||
type lldpStatisticsDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type lldpStatisticsModel struct {
|
||||
Global types.Map `tfsdk:"global"`
|
||||
Interfaces types.List `tfsdk:"interfaces"`
|
||||
}
|
||||
|
||||
func (d *lldpStatisticsDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_lldp_statistics"
|
||||
}
|
||||
|
||||
func (d *lldpStatisticsDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's LLDP Statistics page: global counters plus one entry per interface.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"global": schema.MapAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
"interfaces": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.MapType{ElemType: types.StringType},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *lldpStatisticsDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *lldpStatisticsDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchTables(lldpStatisticsPath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch LLDP Statistics page", err.Error())
|
||||
return
|
||||
}
|
||||
global, ok := tables["LLDP Global Statistics"]
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table captioned "LLDP Global Statistics" not found`)
|
||||
return
|
||||
}
|
||||
interfaces, ok := tables["LLDP Interface Statistics"]
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table captioned "LLDP Interface Statistics" not found`)
|
||||
return
|
||||
}
|
||||
|
||||
globalValue, diags := stringMapToTF(ctx, global.Record)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
interfacesValue, diags := rowsToTF(ctx, interfaces.Rows)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
state := lldpStatisticsModel{Global: globalValue, Interfaces: interfacesValue}
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/log_configuration.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const logConfigurationPath = "/Logging.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &logConfigurationDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &logConfigurationDataSource{}
|
||||
)
|
||||
|
||||
func NewLogConfigurationDataSource() datasource.DataSource {
|
||||
return &logConfigurationDataSource{}
|
||||
}
|
||||
|
||||
type logConfigurationDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type logConfigurationModel struct {
|
||||
Values types.Map `tfsdk:"values"`
|
||||
}
|
||||
|
||||
func (d *logConfigurationDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_log_configuration"
|
||||
}
|
||||
|
||||
func (d *logConfigurationDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's Logging Configuration page.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"values": schema.MapAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *logConfigurationDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *logConfigurationDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchTables(logConfigurationPath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch Logging page", err.Error())
|
||||
return
|
||||
}
|
||||
table, ok := tables["Logging"]
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table captioned "Logging" not found`)
|
||||
return
|
||||
}
|
||||
|
||||
valuesValue, diags := stringMapToTF(ctx, table.Record)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
state := logConfigurationModel{Values: valuesValue}
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/loop_protection_status.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const loopProtectionStatusPath = "/LoopProtectionStatus.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &loopProtectionStatusDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &loopProtectionStatusDataSource{}
|
||||
)
|
||||
|
||||
func NewLoopProtectionStatusDataSource() datasource.DataSource {
|
||||
return &loopProtectionStatusDataSource{}
|
||||
}
|
||||
|
||||
type loopProtectionStatusDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type loopProtectionStatusModel struct {
|
||||
Ports types.List `tfsdk:"ports"`
|
||||
}
|
||||
|
||||
func (d *loopProtectionStatusDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_loop_protection_status"
|
||||
}
|
||||
|
||||
func (d *loopProtectionStatusDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's Loop Protection Status page: one entry per port (Interface, Configured Action Taken, Protection Feature Mode, Tx Mode, counters, Loop Detected).",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"ports": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.MapType{ElemType: types.StringType},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *loopProtectionStatusDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *loopProtectionStatusDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchTables(loopProtectionStatusPath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch Loop Protection Status page", err.Error())
|
||||
return
|
||||
}
|
||||
table, ok := tables["Loop Protection Status"]
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table captioned "Loop Protection Status" not found`)
|
||||
return
|
||||
}
|
||||
|
||||
portsValue, diags := rowsToTF(ctx, table.Rows)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
state := loopProtectionStatusModel{Ports: portsValue}
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/mac_table.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const macTablePath = "/FDBSearch.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &macTableDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &macTableDataSource{}
|
||||
)
|
||||
|
||||
func NewMACTableDataSource() datasource.DataSource {
|
||||
return &macTableDataSource{}
|
||||
}
|
||||
|
||||
type macTableDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type macTableModel struct {
|
||||
Summary types.Map `tfsdk:"summary"`
|
||||
Entries types.List `tfsdk:"entries"`
|
||||
}
|
||||
|
||||
func (d *macTableDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_mac_table"
|
||||
}
|
||||
|
||||
func (d *macTableDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's MAC Address Table (FDB Search) page: summary counters plus one entry per learned MAC. The per-entry table has a blank <CAPTION>, so it's looked up by table id (\"1_1\") instead of caption.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"summary": schema.MapAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
"entries": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.MapType{ElemType: types.StringType},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *macTableDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *macTableDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchAllTables(macTablePath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch MAC Table page", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
var summary map[string]string
|
||||
var entries []map[string]string
|
||||
for _, t := range tables {
|
||||
if t.Caption == "MAC Table" {
|
||||
summary = t.Record
|
||||
}
|
||||
if t.ID == "1_1" {
|
||||
entries = t.Rows
|
||||
}
|
||||
}
|
||||
if summary == nil {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table captioned "MAC Table" not found`)
|
||||
return
|
||||
}
|
||||
if entries == nil {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table with id "1_1" not found`)
|
||||
return
|
||||
}
|
||||
|
||||
summaryValue, diags := stringMapToTF(ctx, summary)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
entriesValue, diags := rowsToTF(ctx, entries)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
state := macTableModel{Summary: summaryValue, Entries: entriesValue}
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/network_setup.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const networkSetupPath = "/Network.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &networkSetupDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &networkSetupDataSource{}
|
||||
)
|
||||
|
||||
func NewNetworkSetupDataSource() datasource.DataSource {
|
||||
return &networkSetupDataSource{}
|
||||
}
|
||||
|
||||
type networkSetupDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type networkSetupModel struct {
|
||||
Tables types.Map `tfsdk:"tables"`
|
||||
}
|
||||
|
||||
func (d *networkSetupDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_network_setup"
|
||||
}
|
||||
|
||||
func (d *networkSetupDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's Network Setup page: Network Details, Web Parameters, Management Access and SNMP, keyed by table caption.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"tables": schema.MapAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.MapType{ElemType: types.StringType},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *networkSetupDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *networkSetupDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchTables(networkSetupPath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch Network Setup page", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
records := make(map[string]map[string]string, len(tables))
|
||||
for caption, table := range tables {
|
||||
records[caption] = table.Record
|
||||
}
|
||||
|
||||
tablesValue, diags := tableOfRecordsToTF(ctx, records)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
state := networkSetupModel{Tables: tablesValue}
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/port_summary.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const portSummaryPath = "/PortSummary.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &portSummaryDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &portSummaryDataSource{}
|
||||
)
|
||||
|
||||
func NewPortSummaryDataSource() datasource.DataSource {
|
||||
return &portSummaryDataSource{}
|
||||
}
|
||||
|
||||
type portSummaryDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type portSummaryModel struct {
|
||||
Ports types.List `tfsdk:"ports"`
|
||||
}
|
||||
|
||||
func (d *portSummaryDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_port_summary"
|
||||
}
|
||||
|
||||
func (d *portSummaryDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's Port Summary page: one entry per port (Interface, Physical Type, Port Status, AutoNeg Status, Link Speed, MTU).",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"ports": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.MapType{ElemType: types.StringType},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *portSummaryDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *portSummaryDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchTables(portSummaryPath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch Port Summary page", err.Error())
|
||||
return
|
||||
}
|
||||
table, ok := tables["Port Summary"]
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table captioned "Port Summary" not found`)
|
||||
return
|
||||
}
|
||||
|
||||
portsValue, diags := rowsToTF(ctx, table.Rows)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
state := portSummaryModel{Ports: portsValue}
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/sntp.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const sntpPath = "/SNTP.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &sntpDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &sntpDataSource{}
|
||||
)
|
||||
|
||||
func NewSNTPDataSource() datasource.DataSource {
|
||||
return &sntpDataSource{}
|
||||
}
|
||||
|
||||
type sntpDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type sntpModel struct {
|
||||
Values types.Map `tfsdk:"values"`
|
||||
}
|
||||
|
||||
func (d *sntpDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_sntp"
|
||||
}
|
||||
|
||||
func (d *sntpDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's SNTP Configuration page.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"values": schema.MapAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *sntpDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *sntpDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchTables(sntpPath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch SNTP page", err.Error())
|
||||
return
|
||||
}
|
||||
table, ok := tables["SNTP Configuration"]
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table captioned "SNTP Configuration" not found`)
|
||||
return
|
||||
}
|
||||
|
||||
valuesValue, diags := stringMapToTF(ctx, table.Record)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
state := sntpModel{Values: valuesValue}
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/system_description.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const systemDescriptionPath = "/SysDescription.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &systemDescriptionDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &systemDescriptionDataSource{}
|
||||
)
|
||||
|
||||
func NewSystemDescriptionDataSource() datasource.DataSource {
|
||||
return &systemDescriptionDataSource{}
|
||||
}
|
||||
|
||||
type systemDescriptionDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type systemDescriptionModel struct {
|
||||
Description types.String `tfsdk:"description"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
Location types.String `tfsdk:"location"`
|
||||
Contact types.String `tfsdk:"contact"`
|
||||
SoftwareVersion types.String `tfsdk:"software_version"`
|
||||
ObjectID types.String `tfsdk:"object_id"`
|
||||
UpTime types.String `tfsdk:"up_time"`
|
||||
CurrentTime types.String `tfsdk:"current_time"`
|
||||
Date types.String `tfsdk:"date"`
|
||||
}
|
||||
|
||||
func (d *systemDescriptionDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_system_description"
|
||||
}
|
||||
|
||||
func (d *systemDescriptionDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's System Description page (name, location, contact, uptime, ...).",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"description": schema.StringAttribute{Computed: true},
|
||||
"name": schema.StringAttribute{Computed: true},
|
||||
"location": schema.StringAttribute{Computed: true},
|
||||
"contact": schema.StringAttribute{Computed: true},
|
||||
"software_version": schema.StringAttribute{Computed: true},
|
||||
"object_id": schema.StringAttribute{Computed: true},
|
||||
"up_time": schema.StringAttribute{Computed: true},
|
||||
"current_time": schema.StringAttribute{Computed: true},
|
||||
"date": schema.StringAttribute{Computed: true},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *systemDescriptionDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *systemDescriptionDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchTables(systemDescriptionPath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch System Description page", err.Error())
|
||||
return
|
||||
}
|
||||
table, ok := tables["System Description"]
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table captioned "System Description" not found`)
|
||||
return
|
||||
}
|
||||
record := table.Record
|
||||
|
||||
state := systemDescriptionModel{
|
||||
Description: types.StringValue(record["System Description"]),
|
||||
Name: types.StringValue(record["System Name"]),
|
||||
Location: types.StringValue(record["System Location"]),
|
||||
Contact: types.StringValue(record["System Contact"]),
|
||||
SoftwareVersion: types.StringValue(record["Software Version"]),
|
||||
ObjectID: types.StringValue(record["System Object ID"]),
|
||||
UpTime: types.StringValue(record["System Up Time"]),
|
||||
CurrentTime: types.StringValue(record["Current Time"]),
|
||||
Date: types.StringValue(record["Date"]),
|
||||
}
|
||||
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Port of ~/code/experiments/hpe/extractors/trunk_status.py
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
const trunkStatusPath = "/TrunkStatus.html"
|
||||
|
||||
var (
|
||||
_ datasource.DataSource = &trunkStatusDataSource{}
|
||||
_ datasource.DataSourceWithConfigure = &trunkStatusDataSource{}
|
||||
)
|
||||
|
||||
func NewTrunkStatusDataSource() datasource.DataSource {
|
||||
return &trunkStatusDataSource{}
|
||||
}
|
||||
|
||||
type trunkStatusDataSource struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
type trunkStatusModel struct {
|
||||
Trunks types.List `tfsdk:"trunks"`
|
||||
}
|
||||
|
||||
func (d *trunkStatusDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_trunk_status"
|
||||
}
|
||||
|
||||
func (d *trunkStatusDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Reads the switch's Trunk Status page: one entry per configured trunk. Empty list if no trunks exist.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"trunks": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.MapType{ElemType: types.StringType},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *trunkStatusDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
if req.ProviderData == nil {
|
||||
return
|
||||
}
|
||||
c, ok := req.ProviderData.(*client.Client)
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected data source configure type", fmt.Sprintf("expected *client.Client, got %T", req.ProviderData))
|
||||
return
|
||||
}
|
||||
d.client = c
|
||||
}
|
||||
|
||||
func (d *trunkStatusDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
tables, err := d.client.FetchTables(trunkStatusPath)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to fetch Trunk Status page", err.Error())
|
||||
return
|
||||
}
|
||||
table, ok := tables["Trunk Status"]
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError("Unexpected page layout", `table captioned "Trunk Status" not found`)
|
||||
return
|
||||
}
|
||||
|
||||
trunksValue, diags := rowsToTF(ctx, table.Rows)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
state := trunkStatusModel{Trunks: trunksValue}
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/provider"
|
||||
"github.com/hashicorp/terraform-plugin-framework/provider/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/resource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider/client"
|
||||
)
|
||||
|
||||
var _ provider.Provider = &hpe1810Provider{}
|
||||
|
||||
type hpe1810Provider struct {
|
||||
version string
|
||||
}
|
||||
|
||||
// hpe1810ProviderModel mirrors config.py's three settings (SWITCH_HOST,
|
||||
// SWITCH_HTTPS, SWITCH_PASSWORD) from the Python reference implementation.
|
||||
type hpe1810ProviderModel struct {
|
||||
Host types.String `tfsdk:"host"`
|
||||
HTTPS types.Bool `tfsdk:"https"`
|
||||
Password types.String `tfsdk:"password"`
|
||||
}
|
||||
|
||||
func New(version string) func() provider.Provider {
|
||||
return func() provider.Provider {
|
||||
return &hpe1810Provider{version: version}
|
||||
}
|
||||
}
|
||||
|
||||
func (p *hpe1810Provider) Metadata(_ context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse) {
|
||||
resp.TypeName = "hpe1810"
|
||||
resp.Version = p.version
|
||||
}
|
||||
|
||||
func (p *hpe1810Provider) Schema(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Manages an HP ProCurve/OfficeConnect 1810 switch over its built-in web UI.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"host": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Description: "Switch IP or hostname. Falls back to the HPE1810_HOST env var, then \"192.168.2.10\".",
|
||||
},
|
||||
"https": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
Description: "Use HTTPS instead of HTTP. Falls back to the HPE1810_HTTPS env var, then false.",
|
||||
},
|
||||
"password": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Sensitive: true,
|
||||
Description: "Switch login password. Falls back to the HPE1810_PASSWORD env var, then empty.",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (p *hpe1810Provider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) {
|
||||
var config hpe1810ProviderModel
|
||||
resp.Diagnostics.Append(req.Config.Get(ctx, &config)...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
host := os.Getenv("HPE1810_HOST")
|
||||
if host == "" {
|
||||
host = "192.168.2.10"
|
||||
}
|
||||
if !config.Host.IsNull() {
|
||||
host = config.Host.ValueString()
|
||||
}
|
||||
|
||||
https := false
|
||||
if envHTTPS := os.Getenv("HPE1810_HTTPS"); envHTTPS != "" {
|
||||
https, _ = strconv.ParseBool(envHTTPS)
|
||||
}
|
||||
if !config.HTTPS.IsNull() {
|
||||
https = config.HTTPS.ValueBool()
|
||||
}
|
||||
|
||||
password := os.Getenv("HPE1810_PASSWORD")
|
||||
if !config.Password.IsNull() {
|
||||
password = config.Password.ValueString()
|
||||
}
|
||||
|
||||
c, err := client.NewClient(host, https, password)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Unable to create switch client", err.Error())
|
||||
return
|
||||
}
|
||||
if err := c.Login(); err != nil {
|
||||
resp.Diagnostics.AddError("Unable to log in to switch", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
resp.DataSourceData = c
|
||||
resp.ResourceData = c
|
||||
}
|
||||
|
||||
// DataSources: one entry per extractors/*.py equivalent.
|
||||
func (p *hpe1810Provider) DataSources(_ context.Context) []func() datasource.DataSource {
|
||||
return []func() datasource.DataSource{
|
||||
NewSystemDescriptionDataSource,
|
||||
NewNetworkSetupDataSource,
|
||||
NewPortSummaryDataSource,
|
||||
NewLLDPStatisticsDataSource,
|
||||
NewBufferedLogDataSource,
|
||||
NewMACTableDataSource,
|
||||
NewTrunkStatusDataSource,
|
||||
NewLoopProtectionStatusDataSource,
|
||||
NewDualImageStatusDataSource,
|
||||
NewClockDataSource,
|
||||
NewSNTPDataSource,
|
||||
NewLogConfigurationDataSource,
|
||||
NewBackupManagerDataSource,
|
||||
}
|
||||
}
|
||||
|
||||
// Resources will grow one entry per actions/*.py equivalent (locator first)
|
||||
// as they're ported.
|
||||
func (p *hpe1810Provider) Resources(_ context.Context) []func() resource.Resource {
|
||||
return []func() resource.Resource{}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/providerserver"
|
||||
|
||||
"terraform-provider-hpe1810/internal/provider"
|
||||
)
|
||||
|
||||
// version is overridden at build time via -ldflags, e.g.:
|
||||
//
|
||||
// go build -ldflags "-X main.version=0.1.0"
|
||||
var version = "dev"
|
||||
|
||||
func main() {
|
||||
err := providerserver.Serve(context.Background(), provider.New(version), providerserver.ServeOpts{
|
||||
// Only meaningful once/if this is ever published; for local
|
||||
// development with dev_overrides (~/.tofurc) this address just
|
||||
// needs to match what's referenced there.
|
||||
Address: "local/joachimfriberg/hpe1810",
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err.Error())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user