Welcome to the IBM TechXchange Community, a place to collaborate, share knowledge, & support one another in everyday challenges. Connect with your fellow members through forums, blogs, files, & face-to-face networking.
Resources
Master the art of AI and Analytics and leverage the power of AI responsibly and ethically to enhance business decisions
Come for answers, stay for best practices. Join the Automation community today to connect with experts.
IBM's data portfolio simplifies your data ecosystem by letting you connect to your data, govern it, find it, and use it for analysis
The mission of the IBM Security Community is to provide clients with an online user community of industry peers and IBM experts, to exchange tips and tricks, best practices, and product knowledge. We hope the information you find here helps you maximize the value of your IBM Security solutions.
Security Threat Management
Data Security
Identity & Access Management
Helping users become data-driven in everything they do.
Discuss IBM Cloud products and technologies with IT ops managers, solution architects, SREs, and other cloud professionals
Cloud
IBM Z and LinuxONE offers rich communities, business and technical experts, blogs, and forums to exchange ideas, connect through shared interests and develop expertise. Join and network today!
Connect, learn, share, and engage with the IBM Power Community
Connect with Data protection software, file & object storage, HCI, tape storage, and other storage experts to gain insight into your product, discuss issues, and solve problems.
IBM Champions are more than 1450+ top non-IBMer experts, thought leaders, and advocates for IBM products and offerings. Connect with them, learn from the content they share, join their events, and get their input.
An online community platform that supports the activities of IBM Community Japan
Getting Started
Learn more about TechXchange Dev Days virtual and in-person events here
Share on LinkedIn
Observer: File-Observer, Environment: AIOps - Topology Manager/ASM running on OCP.
Ask - How to update/overwrite existing file-observer file before each run via command line?
This one is a 3 step process : 1) Identify unique_id of the existing observer job 2) Replace the existing file using either same/different file name 3) Run the job using the values of 1st and 2nd steps.
The syntax for curl, and list of all possible parameters can be found at swagger ui , you can find respective URL at - https://www.ibm.com/docs/en/nasm/1.1.10?topic=reference-swagger
In my example, the URL for file-observer is: https://noi-topology.noi.apps.hybrid.cp.fyre.ibm.com/1.0/file-observer/swagger#!/ . You can find syntax reference under ‘Files -> PUT’ section on how to overwrite, rename files using cURL:
As stated in above screen-shot, if you are trying to replace existing file, you can’t use POST, you’ll end up with below error:
# curl -Ls -k -u $ASM_USER:$ASM_PASS -X POST --header 'Accept: application/json' --header 'X-TenantID: cfd95b7e-3bc7-4006-a4a8-a73a79c71255' --url 'https://noi-topology.noi.apps.hybrid.cp.fyre.ibm.com/1.0/file-observer/files' --form 'job_file=@/tmp/ first-vcenter.txt;filename=first-vcenter.txt’
{"_error":{"message":"File already exist.","level":"warning"}}
Here is the syntax you should use to overwrite existing file using ‘PUT’:
# curl -Ls -k -u $ASM_USER:$ASM_PASS -X PUT --header 'Accept: application/json' --header 'X-TenantID: cfd95b7e-3bc7-4006-a4a8-a73a79c71255' --url 'https://noi-topology.noi.apps.hybrid.cp.fyre.ibm.com/1.0/file-observer/files' --form 'job_file=@/tmp/ first-vcenter.txt;filename=first-vcenter.txt'
["Updated successfully"]3) One the file is updated, you can kick off job via CLI using following:
#curl -Ls -k -u $ASM_USER:$ASM_PASS -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-TenantID: cfd95b7e-3bc7-4006-a4a8-a73a79c71255' -d '{ "unique_id": "first-vcenter.txt", "parameters": { "provider": "NCIM1", "file": "first-vcenter.txt"}, "scheduleRequest": true }' 'https://noi-topology.noi.apps. hybrid.cp.fyre.ibm.com/1.0/file-observer/jobs/load'
You can validate job history via UI by navigating to specific observer job:
Or if you want to track via log – you could run following to confirm job status:
# oc logs -f noi-topology-file-observer-5c89f47665-r6tb6 | grep FINISHED
INFO [2022-03-02 17:55:46,137] [cfd95b7e-3bc7-4006-a4a8-a73a79c71255:first-vcenter.txt] c.i.i.t.o.p.e.EndOfObservation - cfd95b7e-3bc7-4006-a4a8-a73a79c71255:first-vcenter.txt Waiting for state FINISHED
INFO [2022-03-02 17:55:46,580] [pool-12-thread-2] c.i.i.t.o.p.e.EndOfObservation - cfd95b7e-3bc7-4006-a4a8-a73a79c71255:first-vcenter.txt Kafka message detected state change from FINISHING to FINISHED