<?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 Converting a MESH to a STAR COMMUNITY (mgmt_cli) in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Converting-a-MESH-to-a-STAR-COMMUNITY-mgmt-cli/m-p/159870#M7200</link>
    <description>&lt;P&gt;I've labelled this as converting mesh to star; that being said, our specific issue is that we are adding in a local DR gateway, don't want to lose secrets, and don't want to mesh the two at our end. &amp;nbsp;Historically for this customer, these kinds of point to point VPNs were set up as mesh, which was probably never ideal.&lt;/P&gt;&lt;P&gt;SO.... there is no official way to convert from a mesh to a star. &amp;nbsp;This is a shame. &amp;nbsp;A mesh is very obviously a subset of star, with only centre gateways in use, so it should be possible to upgrade.&lt;/P&gt;&lt;P&gt;A little scripting testing shows that this is possible, and in fact the key differentiator is the "featuresPreset" field on the generic-bject, which seems to allow fairly flexible conversion. &amp;nbsp;In fact, I've basically solved the problem. &amp;nbsp;I'm going to show you the code, and many arms will go up in horror:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#!/bin/bash

mc()
{
	mgmt_cli -s SID -f json $*
}

mgmt_cli -m 127.0.0.1 login |tee SID

COMM="$1"
COMMUID=$(mc show vpn-communities-meshed | jq -r --arg NAME "${COMM}" '."objects"[] | select(."name" == $NAME).uid')

#mc show generic-object uid ${COMMUID}
mc set generic-object uid ${COMMUID} \
	featuresPreset "e2e58d83-37af-3659-ae43-072580b4ea5d" \
	icon VPNCommunities/Star \
	topology STAR

mc logout
rm SID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This actually works much better than I was expecting. &amp;nbsp;I was expecting danger, but I observe that updating featuresPreset to match normally-created star communities works perfectly. &amp;nbsp;Object type fields are automatically adjusted to reflect the new object type. &amp;nbsp;This gives me confidence that this is legitimate. &amp;nbsp;And happily, gateways from the mesh are now listed perfectly as centre gateways in the updated object.&lt;/P&gt;&lt;P&gt;So... other than general latent fear, does anyone know of anything that could go wrong? &amp;nbsp;Any changes that don't cascade correctly from this, or other corruption?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2022 16:28:21 GMT</pubDate>
    <dc:creator>Greg_Harewood</dc:creator>
    <dc:date>2022-10-18T16:28:21Z</dc:date>
    <item>
      <title>Converting a MESH to a STAR COMMUNITY (mgmt_cli)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Converting-a-MESH-to-a-STAR-COMMUNITY-mgmt-cli/m-p/159870#M7200</link>
      <description>&lt;P&gt;I've labelled this as converting mesh to star; that being said, our specific issue is that we are adding in a local DR gateway, don't want to lose secrets, and don't want to mesh the two at our end. &amp;nbsp;Historically for this customer, these kinds of point to point VPNs were set up as mesh, which was probably never ideal.&lt;/P&gt;&lt;P&gt;SO.... there is no official way to convert from a mesh to a star. &amp;nbsp;This is a shame. &amp;nbsp;A mesh is very obviously a subset of star, with only centre gateways in use, so it should be possible to upgrade.&lt;/P&gt;&lt;P&gt;A little scripting testing shows that this is possible, and in fact the key differentiator is the "featuresPreset" field on the generic-bject, which seems to allow fairly flexible conversion. &amp;nbsp;In fact, I've basically solved the problem. &amp;nbsp;I'm going to show you the code, and many arms will go up in horror:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#!/bin/bash

mc()
{
	mgmt_cli -s SID -f json $*
}

mgmt_cli -m 127.0.0.1 login |tee SID

COMM="$1"
COMMUID=$(mc show vpn-communities-meshed | jq -r --arg NAME "${COMM}" '."objects"[] | select(."name" == $NAME).uid')

#mc show generic-object uid ${COMMUID}
mc set generic-object uid ${COMMUID} \
	featuresPreset "e2e58d83-37af-3659-ae43-072580b4ea5d" \
	icon VPNCommunities/Star \
	topology STAR

mc logout
rm SID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This actually works much better than I was expecting. &amp;nbsp;I was expecting danger, but I observe that updating featuresPreset to match normally-created star communities works perfectly. &amp;nbsp;Object type fields are automatically adjusted to reflect the new object type. &amp;nbsp;This gives me confidence that this is legitimate. &amp;nbsp;And happily, gateways from the mesh are now listed perfectly as centre gateways in the updated object.&lt;/P&gt;&lt;P&gt;So... other than general latent fear, does anyone know of anything that could go wrong? &amp;nbsp;Any changes that don't cascade correctly from this, or other corruption?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 16:28:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Converting-a-MESH-to-a-STAR-COMMUNITY-mgmt-cli/m-p/159870#M7200</guid>
      <dc:creator>Greg_Harewood</dc:creator>
      <dc:date>2022-10-18T16:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a MESH to a STAR COMMUNITY (mgmt_cli)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Converting-a-MESH-to-a-STAR-COMMUNITY-mgmt-cli/m-p/159891#M7201</link>
      <description>&lt;P&gt;Cue the disclaimer about using Generic Objects:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;generic-object is a way to manipulate (parts of) objects that don't have a formal API endpoint.&lt;/LI&gt;
&lt;LI&gt;We don't provide formal support for tweaking anything tweaked via generic-object APIs.&lt;/LI&gt;
&lt;LI&gt;Formal API endpoints should be used where possible, which are fully supported and have guaranteed backward compatibility.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Having said all that, it's great that it works. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 20:10:28 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Converting-a-MESH-to-a-STAR-COMMUNITY-mgmt-cli/m-p/159891#M7201</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2022-10-18T20:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a MESH to a STAR COMMUNITY (mgmt_cli)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Converting-a-MESH-to-a-STAR-COMMUNITY-mgmt-cli/m-p/159915#M7205</link>
      <description>&lt;P&gt;Wow, ingenious&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 07:39:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Converting-a-MESH-to-a-STAR-COMMUNITY-mgmt-cli/m-p/159915#M7205</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2022-10-19T07:39:49Z</dc:date>
    </item>
  </channel>
</rss>

