<?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 Put request not working in HPE Morpheus Enterprise Software</title>
    <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/put-request-not-working/m-p/7251178#M4352</link>
    <description>&lt;P&gt;Good afternoon,&lt;/P&gt;
&lt;P&gt;Has anyone used a PUT request for &lt;CODE style="background : #f0f1f2;"&gt;tenantPermission&lt;/CODE&gt; in a datastore?&lt;/P&gt;
&lt;P&gt;python&lt;/P&gt;
&lt;P&gt;CopyEdit&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;import requests

url = "https://changeme/api/zones/zoneId/data-stores/id"

payload = {
    "datastore": {
        "visibility": "private",
        "resourcePermissions": {
            "all": True,
            "allPlans": True,
            "sites": [{"id": 1}],
            "plans": [{"id": 1}]
        },
        "active": True,
        "tenantPermissions": [
            {
                "accounts": [1,3],
                "defaultTarget": [1, 3],
                "defaultStore": [1, 3]
            }
        ]
    }
}
headers = {
    "accept": "application/json",
    "content-type": "application/json",
    "authorization": "Bearer xxx"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to point out that this type of request does not work, even though the response returns a &lt;CODE style="background : #f0f1f2;"&gt;200&lt;/CODE&gt; status.&lt;/P&gt;</description>
    <pubDate>Sat, 01 Mar 2025 19:41:07 GMT</pubDate>
    <dc:creator />
    <dc:date>2025-03-01T19:41:07Z</dc:date>
    <item>
      <title>Put request not working</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/put-request-not-working/m-p/7251178#M4352</link>
      <description>&lt;P&gt;Good afternoon,&lt;/P&gt;
&lt;P&gt;Has anyone used a PUT request for &lt;CODE style="background : #f0f1f2;"&gt;tenantPermission&lt;/CODE&gt; in a datastore?&lt;/P&gt;
&lt;P&gt;python&lt;/P&gt;
&lt;P&gt;CopyEdit&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;import requests

url = "https://changeme/api/zones/zoneId/data-stores/id"

payload = {
    "datastore": {
        "visibility": "private",
        "resourcePermissions": {
            "all": True,
            "allPlans": True,
            "sites": [{"id": 1}],
            "plans": [{"id": 1}]
        },
        "active": True,
        "tenantPermissions": [
            {
                "accounts": [1,3],
                "defaultTarget": [1, 3],
                "defaultStore": [1, 3]
            }
        ]
    }
}
headers = {
    "accept": "application/json",
    "content-type": "application/json",
    "authorization": "Bearer xxx"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to point out that this type of request does not work, even though the response returns a &lt;CODE style="background : #f0f1f2;"&gt;200&lt;/CODE&gt; status.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Mar 2025 19:41:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/put-request-not-working/m-p/7251178#M4352</guid>
      <dc:creator />
      <dc:date>2025-03-01T19:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Put request not working</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/put-request-not-working/m-p/7251179#M4353</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hpe.com/u/khalil_gasanov"&gt;@Khalil_Gasanov&lt;/A&gt; ,&lt;/P&gt;
&lt;P&gt;We’re working on correcting the &lt;A href="https://apidocs.morpheusdata.com"&gt;api documentation&lt;/A&gt;. The new changes can be seen in the dev branch of the docs &lt;A href="https://apidocs.morpheusdata.com/v8.0-dev/reference/updateclouddatastores"&gt;here&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In the meantime you have 2 options to pass these values:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;CODE style="background : #f0f1f2;"&gt;"tenantPermissions": [  {"id": 1, "defaultStore": true, , "defaultTarget": true},   {"id": 3, "defaultStore": true, , "defaultTarget": true} ]&lt;/CODE&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Or as an object like: &lt;CODE style="background : #f0f1f2;"&gt;"tenantPermissions": { "accounts": [1] }&lt;/CODE&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 07 Mar 2025 15:37:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/put-request-not-working/m-p/7251179#M4353</guid>
      <dc:creator>cbunge</dc:creator>
      <dc:date>2025-03-07T15:37:41Z</dc:date>
    </item>
  </channel>
</rss>

