Retention class resources
Retention class resources let you create, retrieve information about, modify, and delete retention classes. The table below provides information about these resources.
Trademarks and Legal Disclaimer
© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.
Example: Creating a retention class
Here’s a sample PUT request that creates a retention class named FN-Std-42 for the Accounts-Receivable namespace. The retention class is defined in an XML file named RC-FN-Std-42.xml. The request is made using a tenant-level user account that includes the compliance role.
Request body in XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<retentionClass>
<name>FN-Std-42</name>
<description>Implements Finance department standard #42 - keep for 10
years.</description>
<value>A+10y</value>
<allowDisposition>true</allowDisposition>
</retentionClass>
Request with cURL command line
curl -k -iT RC-FN-Std-42.xml -H "Content-Type: application/xml"
-H "Authorization: HCP bXdoaXRl:ad49ce36d0cec9634ef63b24151be0fb"
"https://finance.hcp.example.com:9090...ce/namespaces/
accounts-receivable/retentionClasses"
Request in Python using PycURL
import pycurl
import os
filehandle = open("RC-FN-Std-42.xml", 'rb')
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Content-Type: application/xml",
"Authorization: HCP \
bXdoaXRl:ad49ce36d0cec9634ef63b24151be0fb"])
curl.setopt(pycurl.URL,
"https://finance.hcp.example.com:9090...nants/finance/" +
"namespaces/accounts-receivable/retentionClasses")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.UPLOAD, 1)
curl.setopt(pycurl.INFILESIZE, os.path.getsize("RC-FN-Std-42.xml"))
curl.setopt(pycurl.READFUNCTION, filehandle.read)
curl.perform()
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()
filehandle.close()
Request headers
PUT /mapi/tenants/finance/namespaces/accounts-receivable/retentionClasses
HTTP/1.1
Host: finance.hcp.example.com:9090
Authorization: HCP bXdoaXRl:ad49ce36d0cec9634ef63b24151be0fb
Content-Type: application/xml
Content-Length: 275
Response headers
HTTP/1.1 200 OK
X-HCP-SoftwareVersion: 8.2.0.2
Content-Length: 0
Trademarks and Legal Disclaimer
© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.
Example: Retrieving a list of retention classes
Here’s a sample GET request that retrieves a list of the retention classes defined for the Accounts-Receivable namespace. The request writes the list of retention classes to a file named AR-retclasses.xml. The request is made using a tenant-level user account that includes the compliance role.
Request with cURL command line
curl -k -H "Accept: application/xml"
-H "Authorization: HCP bXdoaXRl:ad49ce36d0cec9634ef63b24151be0fb"
"https://finance.hcp.example.com:9090...ce/namespaces/
accounts-receivable/retentionClasses?prettyprint" > AR-retclasses.xml
Request in Python using PycURL
import pycurl
filehandle = open("AR-retclasses.xml", 'wb')
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Accept: application/xml",
"Authorization: HCP \
bXdoaXRl:ad49ce36d0cec9634ef63b24151be0fb"])
curl.setopt(pycurl.URL,
"https://finance.hcp.example.com:9090...nants/finance/" +
"namespaces/accounts-receivable/retentionClasses?prettyprint")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.WRITEFUNCTION, filehandle.write)
curl.perform()
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()
filehandle.close()
Request headers
GET /mapi/tenants/finance/namespaces/accounts-receivable/retentionClasses
?prettyprint HTTP/1.1
Host: finance.hcp.example.com:9090
Authorization: HCP bXdoaXRl:ad49ce36d0cec9634ef63b24151be0fb
Accept: application/xml
Response headers
HTTP/1.1 200 OK
Content-Type: application/xml
X-HCP-SoftwareVersion: 8.2.0.2
Content-Length: 136
Response body in XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<retentionClasses>
<name>FN-Std-37</name>
<name>FN-Std-42</name>
</retentionClasses>
Trademarks and Legal Disclaimer
© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.