<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Disable/Enable Integration via API/Playbook/Automation in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/disable-enable-integration-via-api-playbook-automation/m-p/567111#M2862</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/337498"&gt;@BHalifa&lt;/a&gt;, 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.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Nov 2023 02:28:02 GMT</pubDate>
    <dc:creator>jfernandes1</dc:creator>
    <dc:date>2023-11-27T02:28:02Z</dc:date>
    <item>
      <title>Disable/Enable Integration via API/Playbook/Automation</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/disable-enable-integration-via-api-playbook-automation/m-p/566883#M2854</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;
&lt;P&gt;I have list of integration instances that i need to disable/enable in one click.&lt;/P&gt;
&lt;P&gt;I didn't see any function or command in the system that can do it.&lt;/P&gt;
&lt;P&gt;There is any other way to do that?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 14:21:03 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/disable-enable-integration-via-api-playbook-automation/m-p/566883#M2854</guid>
      <dc:creator>BHalifa</dc:creator>
      <dc:date>2023-11-23T14:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Disable/Enable Integration via API/Playbook/Automation</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/disable-enable-integration-via-api-playbook-automation/m-p/566950#M2856</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/337498"&gt;@BHalifa&lt;/a&gt;, we do not recommend you do this and the below instructions may only apply for XSOAR 6.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to return the entire integration object to make changes, so you first need to get the integration object.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use &lt;CODE&gt;POST&lt;/CODE&gt; &lt;CODE&gt;/settings/integration/search&lt;/CODE&gt; with payload &lt;CODE&gt;{"query":"&amp;lt;search for integration&amp;gt;"}&lt;/CODE&gt; -&amp;gt; process result which might a huge list of integrations. You need to extract the object for the integration you want to modify.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In the above returned object, you need to change version and enabled before adding as a payload to the below API call.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;CODE&gt;PUT&lt;/CODE&gt; &lt;CODE&gt;/settings/integration&lt;/CODE&gt; + Above payload&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 03:30:00 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/disable-enable-integration-via-api-playbook-automation/m-p/566950#M2856</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2023-11-24T03:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Disable/Enable Integration via API/Playbook/Automation</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/disable-enable-integration-via-api-playbook-automation/m-p/567017#M2857</link>
      <description>&lt;P&gt;Hi, Thank you!&lt;/P&gt;
&lt;P&gt;Why I need to change the version? the version was 4 so I just added 1 (now its 5)&lt;/P&gt;
&lt;P&gt;Im getting:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;{"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}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Without changing the version it works perfect.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;BTW this is my script:&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV&gt;import requests&lt;/DIV&gt;
&lt;DIV&gt;import json&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;xsoar_instance = '&lt;A href="https://172.16.10.20" target="_blank" rel="noopener"&gt;https://my-xsoar&lt;/A&gt;'&lt;/DIV&gt;
&lt;DIV&gt;tenant_name='acc_TSOC'&lt;/DIV&gt;
&lt;DIV&gt;url = f'{xsoar_instance}/{tenant_name}/settings/integration/search'&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;payload = {}&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;headers = {&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; 'Content-Type': 'application/json',&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; 'Authorization': 'mykey'&lt;/DIV&gt;
&lt;DIV&gt;}&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;payload = {"query":"Migdalei"}&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;# Make the API request&lt;/DIV&gt;
&lt;DIV&gt;response = requests.post(url, headers=headers, data=json.dumps(payload),verify=False)&lt;/DIV&gt;
&lt;DIV&gt;instances=response.json()['instances']&lt;/DIV&gt;
&lt;DIV&gt;newpayloads=[]&lt;/DIV&gt;
&lt;DIV&gt;for i in instances:&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; if i['name'] == "My Desire Instance":&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; #i['version'] = i['version'] + 1&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; i['enabled'] = 'true'&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; newpayloads.append(i)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;url = f'{xsoar_instance}/{tenant_name}/settings/integration'&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;for i in newpayloads:&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; response = requests.put(url, headers=headers, data=json.dumps(i),verify=False)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; print (response.text)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 12:17:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/disable-enable-integration-via-api-playbook-automation/m-p/567017#M2857</guid>
      <dc:creator>BHalifa</dc:creator>
      <dc:date>2023-11-24T12:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Disable/Enable Integration via API/Playbook/Automation</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/disable-enable-integration-via-api-playbook-automation/m-p/567111#M2862</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/337498"&gt;@BHalifa&lt;/a&gt;, 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.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 02:28:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/disable-enable-integration-via-api-playbook-automation/m-p/567111#M2862</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2023-11-27T02:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Disable/Enable Integration via API/Playbook/Automation</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/disable-enable-integration-via-api-playbook-automation/m-p/567143#M2863</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/208028"&gt;@jfernandes1&lt;/a&gt;&amp;nbsp;, thanks for the response.&lt;/P&gt;
&lt;P&gt;I Understand what you say, but when I tried to change the version it's doesn't work.&lt;/P&gt;
&lt;P&gt;Without changing it's work great.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 06:07:26 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/disable-enable-integration-via-api-playbook-automation/m-p/567143#M2863</guid>
      <dc:creator>BHalifa</dc:creator>
      <dc:date>2023-11-27T06:07:26Z</dc:date>
    </item>
  </channel>
</rss>

