<?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: OneView backup in HPE OneView</title>
    <link>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7050150#M4309</link>
    <description>&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;Where do I have --form?&amp;nbsp; I have:&amp;nbsp; --insecure, --header for api version, --header for session id, and --request POST.&amp;nbsp; I tried api versions 1000, 800, and 300.&amp;nbsp; Got the same non-response from all.&amp;nbsp; I am taking another look at the python and ansible libraries.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2019 11:35:42 GMT</pubDate>
    <dc:creator>BradV</dc:creator>
    <dc:date>2019-06-13T11:35:42Z</dc:date>
    <item>
      <title>OneView backup</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7049932#M4293</link>
      <description>&lt;P&gt;I can successfully initiate a backup with:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Start a backup
declare -A BACKUPURI
BACKUPURI=($(curl --insecure \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --request POST ${OneView}/rest/backups | jq -r '.members[] | \"(.uri) \(/.taskUri) \(.downloadUri)"'))
echo "The uri of the backup is:    ${BACKUPURI[0]}"
echo "The uri of the task is:      ${BACKUPURI[1]}"
echo "The uri of the download is:  ${BACKUPURI[2]}"&lt;/LI-CODE&gt;&lt;P&gt;except it is not returning any data.&amp;nbsp; If I just run piping to jq -r '.' nothing is output.&amp;nbsp; This used to work under 800.&amp;nbsp; Did something change in how to handle backups through the rest API?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 11:53:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7049932#M4293</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-06-12T11:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: OneView backup</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7049975#M4299</link>
      <description>&lt;P&gt;What API version are you trying to use?&amp;nbsp; You can still specify the older API with each of your API calls.&amp;nbsp; However, the property you are looking for isn't within the async task that is created you need to monitor.&amp;nbsp; In the async tasks completion, you would want to then get the backup file location from &lt;FONT face="courier new,courier"&gt;associatedResource.resourceUri&lt;/FONT&gt;:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "type": "TaskResourceV2",
    "uri": "/rest/tasks/1D584F0C-96B6-4B19-94C9-8689B5A44A0A",
    "category": "tasks",
    "eTag": "19",
    "created": "2019-06-12T14:24:18.144Z",
    "modified": "2019-06-12T14:24:49.138Z",
    "taskStatus": "Backup completed and ready to download",
    "taskState": "Completed",
    "owner": "Administrator",
    "parentTaskUri": null,
    "userInitiated": true,
    "associatedTaskUri": null,
    "name": "Create backup",
    "taskErrors": [],
    "taskOutput": [],
    "progressUpdates": [],
    "totalSteps": 100,
    "completedSteps": 100,
    "percentComplete": 100,
    "expectedDuration": 0,
    "computedPercentComplete": 100,
    "data": null,
    "taskType": "User",
    "stateReason": "create-backup",
    "associatedResource": {
        "resourceName": "hpov5_backup_2019-06-12_142415",
        "resourceUri": "/rest/backups/appliance_backup_2019-06-12_142415",
        "resourceCategory": "backups",
        "associationType": "MANAGED_BY"
    },
    "hidden": false
}

// The following is the reply from GET /rest/backups/appliance_backup_2019-06-12_142415
{
    "type": "BACKUP",
    "uri": "/rest/backups/appliance_backup_2019-06-12_142415",
    "category": "backups",
    "eTag": null,
    "created": "2019-06-12T14:24:15.919Z",
    "modified": "2019-06-12T14:24:51.645Z",
    "id": "hpov5_backup_2019-06-12_142415",
    "percentComplete": 100,
    "hostName": "ci-00155d5fc035",
    "fullyQualifiedHostName": "appliance.domain.com",
    "userName": "Administrator",
    "errorMessage": "",
    "resolutionMessage": "",
    "resolutionKey": "",
    "resolutionParms": [],
    "errorKey": "",
    "errorParms": [],
    "firmwareVersionMajor": "4",
    "firmwareVersionMinor": "20",
    "hardwareModel": "HPE OneView VM",
    "platformType": "vm",
    "status": "SUCCEEDED",
    "backupSize": 14172176,
    "taskUri": "/rest/tasks/1D584F0C-96B6-4B19-94C9-8689B5A44A0A",
    "downloadUri": "/rest/backups/archive/appliance_backup_2019-06-12_142415",
    "downloadStatus": "NOT_DOWNLOADED",
    "downloadUserName": "",
    "downloadTime": "",
    "backupType": "ON_DEMAND",
    "compatibilityVersion": "4.20",
    "softwareVersion": "4.20.01-0380241",
    "uploadedFileName": "",
    "saveUri": "/rest/backups/remotearchive/appliance_backup_2019-06-12_142415",
    "saveStatus": "NOT_SAVED",
    "saveTaskUri": "",
    "saveUserName": "",
    "saveStartTime": "",
    "savePercentComplete": 0,
    "saveCancelUserName": "",
    "saveRemoteServerName": "",
    "compatibilityFamily": "HPE OneView VM",
    "cpu": 4,
    "memory": 16,
    "secureDataAtRest": false,
    "isApplianceEncryptionKeyValid": true,
    "aekId": "4659-4975-5857-7939",
    "backupStartTime": "2019-06-12T14:24:15.919Z"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 14:34:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7049975#M4299</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2019-06-12T14:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: OneView backup</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7049998#M4303</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;Using version 1000.&amp;nbsp; My problem is that even if I just run:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl --insecure \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --request POST ${OneView}/rest/backups | jq -r '.'&lt;/LI-CODE&gt;&lt;P&gt;I'm not getting anything back other than:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; % Total  % Received % Xferd Average Speed  Time  Time    Time   Current
                                                   Dload    Upload  Total  Spent   Left    Speed
 0         0    0      0        0        0          0            0 --:--:--  0:00:01 --:--:--     0&lt;/LI-CODE&gt;&lt;P&gt;.&amp;nbsp; I'm logged in to the gui and I can see the backup process kicking off.&amp;nbsp; So, I know the&amp;nbsp; backup job is running.&amp;nbsp; I'm just not getting back any data to tell me the task uri.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 15:43:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7049998#M4303</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-06-12T15:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: OneView backup</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7050013#M4305</link>
      <description>&lt;P&gt;That output is from cURL uploading the file because you used the -f/-form switch.&amp;nbsp; Upon return of the upload, there will be an HTTP 202 status reply, which you then need to get the async task URI from the Location HTTP header.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/HewlettPackard/python-hpOneView/blob/release/v4.8.0/examples/backups.py" target="_blank" rel="noopener"&gt;Here is the Python example&lt;/A&gt; on the various ways to interact with appliance backup and restore methods.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 16:30:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7050013#M4305</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2019-06-12T16:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: OneView backup</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7050150#M4309</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;Where do I have --form?&amp;nbsp; I have:&amp;nbsp; --insecure, --header for api version, --header for session id, and --request POST.&amp;nbsp; I tried api versions 1000, 800, and 300.&amp;nbsp; Got the same non-response from all.&amp;nbsp; I am taking another look at the python and ansible libraries.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 11:35:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7050150#M4309</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-06-13T11:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: OneView backup</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7053347#M4339</link>
      <description>&lt;P&gt;OK, got the syntax correct.&amp;nbsp; I had to include '--include' in order to see the response headers.&amp;nbsp; So, this kicks off the backup and gives me back the task uri:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;BACKUPURI=$(curl --insecure \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --include \
     --request POST ${OneView}/rest/backups | grep Location | awk '{print $2}')
echo "The uri of the backup task is: ${BACKUPURI}"&lt;/LI-CODE&gt;&lt;P&gt;Now, I just need to work on querying the task status and then downloading the backup.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 16:28:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7053347#M4339</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-07-02T16:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: OneView backup</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7053506#M4345</link>
      <description>&lt;P&gt;Making progress, but actually trying to retrieve the backup is failing.&amp;nbsp; I have:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Start a backup
#
BACKUPURI=$(curl --insecure \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --include \
     --request POST ${OneView}/rest/backups | grep Location | awk '{print $2}')
BACKUPURI=${BACKUPURI%s'\r'}
echo "The uri of the backup task is: ${BACKUPURI}"
#
# Get status of the backup (this will give you status, etc):
curl --insecure \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --request GET ${BACKUPURI} | jq -r '.assciatedResource.resourceUri, (. | {percentComplete,taskStatus,resourceUri})'
#
# Knowing that the backup is complete, we need the resource URI:
RESORCURI=$(curl --insecure \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --request GET ${BACKUPURI} | jq -r '.assciatedResource.resourceUri')
RESORCURI=${RESORCURI%s'\r'}
#
# Now, get the download location:
DOWNLOADLOC=$(curl --insecure \
     --include \
     --header "Accept: application/octetstream;q=0.8,application/json" \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --request GET ${OneView}${DOWNLOADURI} | grep '^Location:' | awk '{ print $2 }")
DOWNLOADLOC=${DOWNLOADLOC%s'\r'}&lt;/LI-CODE&gt;&lt;P&gt;When I try to actually get the download, I get: "curl: (3) Illegal characters found in URL"&amp;nbsp; Not sure what it is complaining about.&amp;nbsp; All of the characters in DOWNLOADLOC are ascii.&amp;nbsp; I am using:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Download the backup:
curl --insecure \
     --include \
     --header "Accept: application/octetstream;q=0.8,application/json" \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --request GET ${DOWNLOADLOC}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 03 Jul 2019 15:32:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7053506#M4345</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-07-03T15:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: OneView backup</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7053791#M4353</link>
      <description>&lt;P&gt;Got it worked out.&amp;nbsp; Here is working code:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Follow instructions in: OneView-API_Get_Session_Credentials.txt
#
# Start a backup
#
BACKUPURI=$(curl --insecure \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --include \
     --request POST ${OneView}/rest/backups | grep Location | awk '{print $2}')
BACKUPURI=${BACKUPURI%s'\r'}
echo "The uri of the backup task is: ${BACKUPURI}"
#
# Get status of the backup (repeat until task status is "Backup completed and ready to download."):
TASKSTATUS=''
while [[ ${TASKSTATUS} != *"completed and ready to download"* ]]; do
   TASKSTATUS=$(curl --insecure \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --request GET ${BACKUPURI} | jq -r '. | {taskStatus}')
   sleep 2
done
#
# Knowing that the backup is complete, we need the resource URI:
RESORCURI=$(curl --insecure \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --request GET ${BACKUPURI} | jq -r '.assciatedResource.resourceUri')
RESORCURI=${RESORCURI%s'\r'}
#
# Now, get the download URI:
DOWNLOADURI=$(curl --insecure \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --request GET ${OneView}${RESORCURI} | jq -r '.downloadUri')
#
# Now, get the download location:
DOWNLOADLOC=$(curl --insecure \
     --include \
     --header "Accept: application/octetstream;q=0.8,application/json" \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --request GET ${OneView}${DOWNLOADURI} | grep '^Location:' | awk '{ print $2 }")
DOWNLOADLOC=$(echo "${DOWNLOADLOC}" | tr -d '\r')
DOWNLDFIL=$(echo "${DOWNLOADURI}" | cut -d/ -f5).bkp
#
# Download the backup:
curl --insecure \
     --fail \
     --location \
     --header "Accept: application/octetstream" \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --output ${DOWNLDFIL} \
     --request GET ${DOWNLOADLOC}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 05 Jul 2019 10:34:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-backup/m-p/7053791#M4353</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-07-05T10:34:00Z</dc:date>
    </item>
  </channel>
</rss>

