<?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: REST API assign server profile from a template in HPE OneView</title>
    <link>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7056955#M4409</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The API you are looking for is documented in the server-profile-templates section of the API docs:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN class="method hp-api-method"&gt;GET&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="uri"&gt;/rest/server-profile-templates/{id}/new-profile&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;"A profile object will be returned with the configuration based on this template. Specify the profile name and server hardware to assign. If template has any fibre channel connection which is configured to boot from user defined targets but boot target is not specified in template, then boot target must be specified for that connection during creation of profile. This profile object can subsequently be used for the POST https://{appl}/rest/server-profiles/ API."&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So basically you will do a GET using this path (with {id} of that of your template), and then modify it as needed (with the server-hardware URI, etc), then POST it back to /rest/server-profiles to create and assign the profile.&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 30 Jul 2019 19:57:16 GMT</pubDate>
    <dc:creator>DaveArko</dc:creator>
    <dc:date>2019-07-30T19:57:16Z</dc:date>
    <item>
      <title>REST API assign server profile from a template</title>
      <link>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7056941#M4408</link>
      <description>&lt;P&gt;Can someone point me to the correct API?&amp;nbsp; I have a server profile template defined.&amp;nbsp; I want to use that to assign/create a server profile for a given server.&amp;nbsp; Not finding the correct reference.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 16:46:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7056941#M4408</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-07-30T16:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: REST API assign server profile from a template</title>
      <link>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7056955#M4409</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The API you are looking for is documented in the server-profile-templates section of the API docs:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN class="method hp-api-method"&gt;GET&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="uri"&gt;/rest/server-profile-templates/{id}/new-profile&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;"A profile object will be returned with the configuration based on this template. Specify the profile name and server hardware to assign. If template has any fibre channel connection which is configured to boot from user defined targets but boot target is not specified in template, then boot target must be specified for that connection during creation of profile. This profile object can subsequently be used for the POST https://{appl}/rest/server-profiles/ API."&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So basically you will do a GET using this path (with {id} of that of your template), and then modify it as needed (with the server-hardware URI, etc), then POST it back to /rest/server-profiles to create and assign the profile.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 30 Jul 2019 19:57:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7056955#M4409</guid>
      <dc:creator>DaveArko</dc:creator>
      <dc:date>2019-07-30T19:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: REST API assign server profile from a template</title>
      <link>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7057010#M4413</link>
      <description>&lt;P&gt;Thanks, but how does one identify the UUID?&amp;nbsp; It says: "Retrieves a server profile template managed by the appliance based on its UUID."&amp;nbsp; However, when I execute: GET ${OneView}/rest/server-profile-templates, I don't see anything labeled as UUID.&amp;nbsp; Would the UUID be the last part of the URI?&amp;nbsp; OK, I just tested that and it works.&amp;nbsp; I think HPE needs to point that out in the API reference and/or modify the API to return the UUID as a seperate value.&amp;nbsp; Thanks again!&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 09:12:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7057010#M4413</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-07-31T09:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: REST API assign server profile from a template</title>
      <link>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7057074#M4415</link>
      <description>&lt;P&gt;I see your point - docs are using UUID and {Id} interchangeably. I submitted a request to have this improved. Thanks for your feedback!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 16:31:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7057074#M4415</guid>
      <dc:creator>DaveArko</dc:creator>
      <dc:date>2019-07-31T16:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: REST API assign server profile from a template</title>
      <link>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7057881#M4449</link>
      <description>&lt;P&gt;When I try this, what am I supposed to get back?&amp;nbsp; The name is null.&amp;nbsp; Uri is null.&amp;nbsp; state says creating.&amp;nbsp; taskuri is null.&amp;nbsp; I look in the gui and there is no new server profile created.&amp;nbsp; I do get back a json that looks like a server profile, but no "handle" that I can see to use to apply this new profile to a host.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 12:49:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7057881#M4449</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-08-07T12:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: REST API assign server profile from a template</title>
      <link>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7057920#M4452</link>
      <description>&lt;P&gt;When you do a GET on https://&amp;lt;ov-appliance//rest/server-profile-templates/&amp;lt;templante-id&amp;gt;/new-profile you get back a profile object that needs some modifications.&amp;nbsp; You need to fill in the missing info such as the "serverHardwareUri" (which you get from the server-hardare list). And "name".&amp;nbsp; I&amp;nbsp; just tried a simple template, and those were the two required things to fill in.&lt;/P&gt;&lt;P&gt;Then do a POST with that object to&amp;nbsp;https://&amp;lt;ov-appliance&amp;gt;/rest/server-profiles&amp;nbsp; and it should apply it to the server-hardware that you set via the&amp;nbsp;serverHardwareUri attribute in the object.&lt;/P&gt;&lt;P&gt;You can ignore the state/taskuri, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 16:49:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7057920#M4452</guid>
      <dc:creator>DaveArko</dc:creator>
      <dc:date>2019-08-07T16:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: REST API assign server profile from a template</title>
      <link>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7058025#M4457</link>
      <description>&lt;P&gt;Oh!&amp;nbsp; That was not at all clear!&amp;nbsp; Thanks!&amp;nbsp; Most of the other functions return a task uri that you then reference.&amp;nbsp; I was expecting something like that or an object reference, not the actual object.&amp;nbsp; I'll work on that and see if I can implement properly.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 11:11:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7058025#M4457</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-08-08T11:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: REST API assign server profile from a template</title>
      <link>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7084469#M5120</link>
      <description>&lt;P&gt;Finally got back to this.&amp;nbsp; Did the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NEWPROF=$(curl --insecure \
   --header "X-API-Version" ${currentVersion}" \
   --header "auth: ${sessionID}" \
   --request GET ${OneView}/rest/server-profile-templates/&amp;lt;id&amp;gt;/new-profile)
# The variable HARDW points to a file where I have extracted all of the hardware from OneView
DATA2=$(jq -r '.members[] | select(.serverName=="myservername")' ${HARDW}
HRDWURI=$(echo ${DATA2} | jq -r '.uri')
NAM=$(echo ${DATA2} | jq -r '.name')
NEWPROF=$(echo ${NEWPROF} | sed -e "s|\name\":\)null|\1\"${NAM}\"|")
NEWPROF=$(echo ${NEWPROF} | sed -e "s|\serverHardwareUri\":\)null|\1\"${HRDWURI}\"|")
curl --insecure
   --header "X-API-Version" ${currentVersion}" \
   --header "auth: ${sessionID}" \
   --header "content-type: application/json" \
   --include \
   --data "${NEWPROF}" \
   --request POST ${OneView}/rest/server-profiles&lt;/LI-CODE&gt;&lt;P&gt;and I get back&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;parse error: Invalid numeric literal at line 1, column 9&lt;/LI-CODE&gt;&lt;P&gt;I echoed ${NEWPROF} | jq -r '.' and it parses just fine.&amp;nbsp; Any idea what might be wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 14:15:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/rest-api-assign-server-profile-from-a-template/m-p/7084469#M5120</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2020-04-08T14:15:04Z</dc:date>
    </item>
  </channel>
</rss>

