- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
11-23-2023 06:17 AM - edited 11-23-2023 06:21 AM
Hi Guys,
I have list of integration instances that i need to disable/enable in one click.
I didn't see any function or command in the system that can do it.
There is any other way to do that?
11-23-2023 07:30 PM
Hi @BHalifa, we do not recommend you do this and the below instructions may only apply for XSOAR 6.
You need to return the entire integration object to make changes, so you first need to get the integration object.
Use POST
/settings/integration/search
with payload {"query":"<search for integration>"}
-> process result which might a huge list of integrations. You need to extract the object for the integration you want to modify.
In the above returned object, you need to change version and enabled before adding as a payload to the below API call.
PUT
/settings/integration
+ Above payload
You can run the above calls using the Core REST API integration. If you are unsure about Cortex APIs and Python do not use this method.
11-24-2023 03:43 AM - edited 11-24-2023 04:17 AM
Hi, Thank you!
Why I need to change the version? the version was 4 so I just added 1 (now its 5)
Im getting:
{"id":"errOptimisticLock","status":400,"title":"Optimistic lock error","detail":"Optimistic lock error","error":"DB Version '4' and Insert version '5' do not match for id: 2bafa3b3-1fd7-48a9-85d3-145e1b12e323 on bucket [modules] [moduleInstances] (15)","encrypted":false,"multires":null}
Without changing the version it works perfect.
BTW this is my script:
import requestsimport jsonxsoar_instance = 'https://my-xsoar'tenant_name='acc_TSOC'url = f'{xsoar_instance}/{tenant_name}/settings/integration/search'payload = {}headers = {'Content-Type': 'application/json','Authorization': 'mykey'}payload = {"query":"Migdalei"}# Make the API requestresponse = requests.post(url, headers=headers, data=json.dumps(payload),verify=False)instances=response.json()['instances']newpayloads=[]for i in instances:if i['name'] == "My Desire Instance":#i['version'] = i['version'] + 1i['enabled'] = 'true'newpayloads.append(i)url = f'{xsoar_instance}/{tenant_name}/settings/integration'for i in newpayloads:response = requests.put(url, headers=headers, data=json.dumps(i),verify=False)print (response.text)
11-26-2023 06:28 PM
Hi @BHalifa, XSOAR maintains version control internally. You need to bump the version number up in order to commit the changes. The also help since content can be changed from multiple sources.
11-26-2023 10:07 PM
Hi @jfernandes1 , thanks for the response.
I Understand what you say, but when I tried to change the version it's doesn't work.
Without changing it's work great.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!