Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Automate a http task (tokens included)

by leostereo (Beadle)
on May 13, 2020 at 23:30 UTC ( #11116769=perlquestion: print w/replies, xml ) Need Help??

leostereo has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys.

Need to manually configure 200 huawei onts through its http gui.

Each config involves login and 3 more clicks.

I would like to automatize this task creating some kind of http agent.

I did this in the past but now cpes have involved and now they request a token generated on browser side on each http transaction.

Question: Is there some recomended way to face this problem ? recomended tool? analisis method ?

Any other idea ? feedback?

Sorry:

I can not share any code since i have any yet.

I think I will start using mechanize with perl as soon as I know how to face token thing.

BTW:

I already tryed using ont cli but it have no all commands I need.

JUST TO BE CLEAR:

I dont whant to broke any system neither hack something. Just need to get rid of this click nightmare.

Regards,

Leandro.

Replies are listed 'Best First'.
Re: Automate a http task (tokens included)
by Marshall (Canon) on May 14, 2020 at 01:02 UTC
    I had to look up what an ONT (Optical Network Terminal) was.
    Your post doesn't have any clear cut thing that I can respond to in a Perl sense.
    However, you appear to be asking about batch provisioning some kind of telecom device.
    I would start with a google search on "huawei ont api".
    I suspect that there is an efficient way to configure 1,000 of these things in one batch.

    Update:
    The first google hit I got claims: "Huawei-Ont-Provisioning. Python3 script for mass provisioning ont for huawei olt using telnet."

    Look for an API when trying to access a huge site
    An API will work far better than trying to automate a thousand user sessions.

      Look for an API when trying to access a huge site
      I would agree, but what is quite common in this (telco-)area is
      • proprietary and undocumented APIs
      • batch APIs are file based
      • unclean separation of concerns, i.e. part of the business logic is running in the browser (JS or even ActiveX)
      Under these circumstances, automating the GUI is less awkward than paying some 100k or doing reverse-engineering in a grey zone.

        Since it's Huawei there's likely another way to get in a do stuff :P

        I used to work for a PBX (Private Branch Exchange) provider. There were in the day (and even better now) tools to configure thousands of end user terminals in a batch way.
Re: Automate a http task (tokens included)
by Anonymous Monk on May 14, 2020 at 00:50 UTC
Re: Automate a http task (tokens included)
by Perlbotics (Bishop) on May 14, 2020 at 18:40 UTC

    When your company owns 200 Huawei ONT devices, it has most probably also access to Huawei support. Ask them (or search their KB) for Robotics Process Automation tool.

Re: Automate a http task (tokens included)
by leostereo (Beadle) on Jun 20, 2020 at 18:23 UTC
    Ok ... sorry for the lack or missing explanation about the problem.-
    There is no api ... nothing , only way to interact with those devices is over http protocol.
    Thank you for all your advices ,
    I founded pupetteer (for nodejs) that helped my out.
    Regards.
    Leandro.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11116769]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2022-06-28 03:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (89 votes). Check out past polls.

    Notices?