<?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 Using REST API for snapmirror update in ONTAP Rest API Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Using-REST-API-for-snapmirror-update/m-p/439805#M379</link>
    <description>&lt;P&gt;I have a ZAPI script that makes one call to 'snapmirror-update' so that a client can trigger a snapmirror after their data is written. One permissions granted through security login role: 'snapmirror update -destination-path SVMNAME:VOLUMENAME' with access all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In trying to convert this to REST using the python client library, additional permissions were added:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;'snapmirror show -destination-path SVMNAME:VOLUMENAME' with access readonly(which also granted 'snapmirror create')&lt;/LI&gt;&lt;LI&gt;'job show' with access readonly&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script is effectively:&lt;/P&gt;&lt;PRE&gt;config.CONNECTION = HostConnection(connect, username=user, password=password, verify=verify)&lt;BR /&gt;relationship=SnapmirrorRelationship.find(**{'destination.path':f'{svm}:{volume}'})&lt;BR /&gt;transfer=SnapmirrorTransfer(relationship=relationship)&lt;BR /&gt;transfer.post()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when the post is issued, it fails with:&lt;/P&gt;&lt;P&gt;HTTPError('403 Client Error:&lt;BR /&gt;Forbidden for url: &lt;A href="https://filer:443/api/snapmirror/relationships/e8b27bcf-8bee-11eb-94d0-00a098aad316/transfers" target="_blank"&gt;https://filer:443/api/snapmirror/relationships/e8b27bcf-8bee-11eb-94d0-00a098aad316/transfers&lt;/A&gt;',): not&lt;BR /&gt;authorized for that command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change 'snapmirror show' from readonly access to all access, it works, but that introduces privilege concerns since that now allows the user to create snapmirror relationships.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any ideas what I'm missing here?&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 09:55:33 GMT</pubDate>
    <dc:creator>benkorvemaker</dc:creator>
    <dc:date>2025-06-04T09:55:33Z</dc:date>
    <item>
      <title>Using REST API for snapmirror update</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Using-REST-API-for-snapmirror-update/m-p/439805#M379</link>
      <description>&lt;P&gt;I have a ZAPI script that makes one call to 'snapmirror-update' so that a client can trigger a snapmirror after their data is written. One permissions granted through security login role: 'snapmirror update -destination-path SVMNAME:VOLUMENAME' with access all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In trying to convert this to REST using the python client library, additional permissions were added:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;'snapmirror show -destination-path SVMNAME:VOLUMENAME' with access readonly(which also granted 'snapmirror create')&lt;/LI&gt;&lt;LI&gt;'job show' with access readonly&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script is effectively:&lt;/P&gt;&lt;PRE&gt;config.CONNECTION = HostConnection(connect, username=user, password=password, verify=verify)&lt;BR /&gt;relationship=SnapmirrorRelationship.find(**{'destination.path':f'{svm}:{volume}'})&lt;BR /&gt;transfer=SnapmirrorTransfer(relationship=relationship)&lt;BR /&gt;transfer.post()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when the post is issued, it fails with:&lt;/P&gt;&lt;P&gt;HTTPError('403 Client Error:&lt;BR /&gt;Forbidden for url: &lt;A href="https://filer:443/api/snapmirror/relationships/e8b27bcf-8bee-11eb-94d0-00a098aad316/transfers" target="_blank"&gt;https://filer:443/api/snapmirror/relationships/e8b27bcf-8bee-11eb-94d0-00a098aad316/transfers&lt;/A&gt;',): not&lt;BR /&gt;authorized for that command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change 'snapmirror show' from readonly access to all access, it works, but that introduces privilege concerns since that now allows the user to create snapmirror relationships.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any ideas what I'm missing here?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 09:55:33 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Using-REST-API-for-snapmirror-update/m-p/439805#M379</guid>
      <dc:creator>benkorvemaker</dc:creator>
      <dc:date>2025-06-04T09:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using REST API for snapmirror update</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Using-REST-API-for-snapmirror-update/m-p/439807#M380</link>
      <description>&lt;P&gt;This seems to be a limitation for the way the RBAC is defined between the snapmirror/relationships endpoint and the /transfers endpoint under that. The implementation for both of these endpoints specifies that a user must have permissions on the snapmirror command to access both of these endpoints. Since you're doing a POST on the transfers endpoint, that means you need all access on the snapmirror command which then allows relationship creation as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do agree that it could be beneficial for a user/role to have one and not the other. I don't know of a workaround though. I think a request to the development team through support would be needed to assess if this granularity could be added.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 16:29:52 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Using-REST-API-for-snapmirror-update/m-p/439807#M380</guid>
      <dc:creator>RobertBlackhart</dc:creator>
      <dc:date>2022-11-11T16:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using REST API for snapmirror update</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Using-REST-API-for-snapmirror-update/m-p/439910#M384</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; Is there a reference somewhere that shows what permissions under 'security login role' are needed for a given REST call?&amp;nbsp; I made educated guesses in this particular case, but it continues to come up.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 16:25:56 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Using-REST-API-for-snapmirror-update/m-p/439910#M384</guid>
      <dc:creator>benkorvemaker</dc:creator>
      <dc:date>2022-11-17T16:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using REST API for snapmirror update</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Using-REST-API-for-snapmirror-update/m-p/439911#M385</link>
      <description>&lt;P&gt;Not that I know of. I inferred this from looking at the source code. Generally speaking, it shouldn't be necessary for a user to know more granularly than the endpoint itself. The "security login rest-role create" command accepts a "-api" argument which is the endpoint you want to give permissions to and that seems to be the expected interface. When that isn't working as expected, I think it should be treated as a support ticket and a bug.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 16:36:51 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Using-REST-API-for-snapmirror-update/m-p/439911#M385</guid>
      <dc:creator>RobertBlackhart</dc:creator>
      <dc:date>2022-11-17T16:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using REST API for snapmirror update</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Using-REST-API-for-snapmirror-update/m-p/440052#M391</link>
      <description>&lt;P&gt;Thanks. We're heavily using 'security login role' because 'security login rest-role' lacks the necessary granularity to limit access to a subset of volumes and SVMs for most commands.&amp;nbsp; Maybe we'll get something similar to 'show-ontapi' eventually.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 20:57:50 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Using-REST-API-for-snapmirror-update/m-p/440052#M391</guid>
      <dc:creator>benkorvemaker</dc:creator>
      <dc:date>2022-11-24T20:57:50Z</dc:date>
    </item>
  </channel>
</rss>

