Skip to main content

We've Moved!

Product Documentation has moved to docs.hitachivantara.com
Hitachi Vantara Knowledge

Tenant resources


Tenant resources let you create, retrieve information about, modify, and delete tenants. The table below provides information about these resources.

NoteWebHelp.png

Note: The management API is automatically enabled for tenants you create through the management API.

Data type

Method

Use

Access

Notes

.../tenants

tenant

PUT

Create an HCP tenant or the default tenant and namespace

System-level user account with the administrator role

You can create the default tenant and namespace only if this is allowed by the HCP system configuration.

For information about required and optional query parameters for creating tenants, see Query parameters for creating tenants.

List

GET

Retrieve a list of the tenants defined in an HCP system

System-level user account with the monitor or administrator role

The listed tenants are identified by tenant name.

In XML, the element that identifies each tenant is name. The root element for the list of tenants is tenants.

In JSON, the name in the name/value pair that lists the tenants is name.

.../tenants/tenant-name

tenant

GET

Retrieve information about a tenant

For an HCP tenant, system-level user account with the monitor or administrator role or tenant-level user account with the monitor or administrator role

For the default tenant, system-level user account with the monitor or administrator role

For an HCP tenant, the information returned depends on whether you’re using a system-level or tenant-level user account.

N/A

HEAD

Check for the existence of a tenant

For an HCP tenant, system-level user account with the monitor or administrator role or tenant-level user account with the monitor or administrator role

For the default tenant, system-level user account with the monitor or administrator role

 

tenant

POST

Modify a tenant

For an HCP tenant, system-level user account with the administrator role or tenant-level user account with the administrator role

For the default tenant, system-level user account with the administrator role

For an HCP tenant, the information you can modify depends on whether you’re using a system-level or tenant-level user account.

N/A

DELETE

Delete a tenant

System-level user account with the administrator role

The tenant cannot own any namespaces.

Not valid for the default tenant.

.../tenants/tenant-name/availableServicePlans

List

GET

Retrieve a list of the service plans that are available for the tenant to assign to its namespaces

For an HCP tenant, system-level user account with the monitor or administrator role or tenant-level user account with the monitor or administrator role

For the default tenant, system-level user account with the monitor or administrator role

Valid only if the tenant is configured to allow service plan selection.

The listed service plans are identified by service plan name.

In XML, each listed service plan is the value of an element named name. In JSON, the name in the name/value pair that lists the service plans is name.

.../tenants/tenant-name/availableServicePlans/service-plan-name

available
  ServicePlan

GET

Retrieve information about a service plan that’s available for the tenant to assign to its namespaces

For an HCP tenant, system-level user account with the monitor or administrator role or tenant-level user account with the monitor or administrator role

For the default tenant, system-level user account with the monitor or administrator role

Valid only if the tenant is configured to allow service plan selection.

.../tenants/tenant-name/chargebackReport

chargeback
  Report

GET

Generate a chargeback report for a tenant

System-level user account with the administrator role or tenant-level user account with the monitor or administrator role

Not valid for the default tenant.

Supported output formats are XML, JSON, and CSV.

For information about optional query parameters for generating chargeback reports, see Query parameters for generating chargeback reports.

For information about chargeback reports, see About chargeback reports.

.../tenants/tenant-name/consoleSecurity

consoleSecurity

GET

Retrieve the Tenant Management Console configuration for a tenant

Tenant-level user account with the security role

Not valid for the default tenant.

POST

Modify the Tenant Management Console configuration for a tenant

Tenant-level user account with the security role

.../tenants/tenant-name/contactInfo

contactInfo

GET

Retrieve the contact information for a tenant

For an HCP tenant, tenant-level user account with the monitor or administrator role

For the default tenant, system-level user account with the monitor or administrator role

 

POST

Modify the contact information for a tenant

For an HCP tenant, tenant-level user account with the administrator role

For the default tenant, system-level user account with the administrator role

 

.../tenants/tenant-name/emailNotification

email
  Notification

GET

Retrieve the email notification configuration for a tenant

For an HCP tenant, tenant-level user account with the monitor or administrator role

For the default tenant, system-level user account with the with the monitor or administrator role

 

POST

Modify the email notification configuration for a tenant

For an HCP tenant, tenant-level user account with the administrator role

For the default tenant, system-level user account with the administrator role

 

.../tenants/tenant-name/namespaceDefaults

namespace
Defaults

GET

Retrieve the default settings for namespace creation for a tenant

Tenant-level user account with the monitor or administrator role

Not valid for the default tenant.

POST

Modify the default settings for namespace creation for a tenant

Tenant-level user account with the administrator role

.../tenants/tenant-name/permissions

List

GET

Retrieve the list of permissions in the data access permission mask for a tenant

For an HCP tenant, tenant-level user account with the monitor, administrator, or compliance role

For the default tenant, system-level user account with the monitor, administrator, or compliance role

For the format of the permission list, see Permission lists.

List

POST

Modify the list of permissions in the data access permission mask for a tenant

For an HCP tenant, tenant-level user account with the administrator role

For the default tenant, system-level user account with the administrator role

Valid values for permissions are:

DELETE

PRIVILEGED

PURGE

READ

SEARCH

WRITE

These values are case sensitive.

For the format of the permission list, see Permission lists.

The set of permissions specified in the request body replaces the set of permissions currently included in the data access permission mask for the tenant. To remove all permissions, specify an empty list.

If the set of permissions includes PURGE, delete permission is enabled automatically. If the set of permissions includes SEARCH, read permission is enabled automatically.

By default, when you create a tenant, its data access permission mask includes all permissions.

.../tenants/tenant-name/searchSecurity

searchSecurity

GET

Retrieve the Search Console configuration for a tenant

Tenant-level user account with the security role

Not valid for the default tenant.

POST

Modify the Search Console configuration for a tenant

Tenant-level user account with the security role

.../tenants/tenant-name/statistics

statistics

GET

Retrieve statistics about the content of the namespaces owned by a tenant

For an HCP tenant, system-level user account with the administrator role or tenant-level user account with the monitor or administrator role

For the default tenant, system-level user account with the monitor or administrator role

 

© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.

Example: Creating an HCP tenant


Here’s a sample PUT request that creates a tenant named Finance in the HCP system named hcp.example.com. The tenant definition is in an XML file named FinanceTenant.xml. The initial user account for the tenant has a username of lgreen and a password of start123. These are specified by query parameters. The request is made using a system-level user account that includes the administrator role.

This example assumes the existence of a service plan named Short-Term-Activity.

Request body in XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<tenant>
    <name>Finance</name>
    <systemVisibleDescription>Created for the Finance department at Example
        Company by P.D. Grey on 2/9/2017.</systemVisibleDescription>
    <hardQuota>100 GB</hardQuota>
    <softQuota>90</softQuota>
    <namespaceQuota>5</namespaceQuota>
    <authenticationTypes>
        <authenticationType>LOCAL</authenticationType>
        <authenticationType>EXTERNAL</authenticationType>
    </authenticationTypes>
    <complianceConfigurationEnabled>true</complianceConfigurationEnabled>
    <versioningConfigurationEnabled>true</versioningConfigurationEnabled>
    <searchConfigurationEnabled>true</searchConfigurationEnabled>
    <replicationConfigurationEnabled>true</replicationConfigurationEnabled>
    <erasureCodingSelectionEnabled>true</erasureCodingSelectionEnabled>
    <tags>
        <tag>Example Company</tag>
        <tag>pdgrey</tag>
    </tags>
    <servicePlanSelectionEnabled>false</servicePlanSelectionEnabled>
    <servicePlan>Short-Term-Activity</servicePlan>
    <dataNetwork>net127</dataNetwork>
    <managementNetwork>net004</managementNetwork>
</tenant>

Request with cURL command line

curl -k -iT FinanceTenant.xml -H "Content-Type: application/xml"
    -H "Authorization: HCP YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382"
    "https://admin.hcp.example.com:9090/m...sername=lgreen
        &password=start123&forcePasswordChange=false"

Request in Python using PycURL

import pycurl
import os
filehandle = open("FinanceTenant.xml", 'rb')
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Content-Type: application/xml",
  "Authorization: HCP \
  YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382"])
curl.setopt(pycurl.URL,
  "https://admin.hcp.example.com:9090/mapi/tenants?" +
  "username=lgreen&password=start123&forcePasswordChange=false")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.UPLOAD, 1)
curl.setopt(pycurl.INFILESIZE, os.path.getsize("FinanceTenant.xml"))
curl.setopt(pycurl.READFUNCTION, filehandle.read)
curl.perform()
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()
filehandle.close()

Request headers

PUT /mapi/tenants?username=lgreen&password=start123
    &forcePasswordChange=false HTTP/1.1
Host: admin.hcp.example.com:9090
Authorization: HCP YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382
Content-Type: application/xml
Content-Length: 1016

Response headers

HTTP/1.1 200 OK
X-HCP-SoftwareVersion: 8.2.0.2
Content-Length: 0

© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.

Example: Setting Tenant Management Console security for a tenant


Here’s a sample POST request that modifies the Tenant Management Console configuration for the Finance tenant. The Console configuration information is in an XML file named FinanceMgmtConsole.xml. The request is made using a tenant-level user account that includes the security role.

Request body in XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<consoleSecurity>
    <ipSettings>
        <allowAddresses>
             <ipAddress>192.168.103.18</ipAddress>
            <ipAddress>192.168.103.24</ipAddress>
             <ipAddress>192.168.103.25</ipAddress>
        </allowAddresses>
        <denyAddresses/>
        <allowIfInBothLists>false</allowIfInBothLists>
    </ipSettings>
    <minimumPasswordLength>6</minimumPasswordLength>
    <forcePasswordChangeDays>45</forcePasswordChangeDays>
    <disableAfterAttempts>3</disableAfterAttempts>
    <disableAfterInactiveDays>30</disableAfterInactiveDays>
    <logoutOnInactive>20</logoutOnInactive>
    <loginMessage/>
</consoleSecurity>

Request with cURL command line

curl -k -i -d @FinanceMgmtConsole.xml
    -H "Content-Type: application/xml"
    -H "Authorization: HCP bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6"
    "https://finance.hcp.example.com:9090...onsoleSecurity"

Request in Python using PycURL

import pycurl
import os
filehandle = open("FinanceMgmtConsole.xml", 'rb')
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Content-Type: application/xml",
  "Authorization: HCP \
  bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6"])
curl.setopt(pycurl.URL,
  "https://finance.hcp.example.com:9090...nants/finance/" +
  "consoleSecurity")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.UPLOAD, 1)
curl.setopt(pycurl.CUSTOMREQUEST, "POST")
curl.setopt(pycurl.INFILESIZE,
  os.path.getsize("FinanceMgmtConsole.xml"))
curl.setopt(pycurl.READFUNCTION, filehandle.read)
curl.perform()
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()
filehandle.close()

Request headers

POST /mapi/tenants/finance/consoleSecurity HTTP/1.1
Host: finance.hcp.example.com:9090
Authorization: HCP bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6
Content-Type: application/xml
Content-Length: 620

Response headers

HTTP/1.1 200 OK
Content-Type: application/xml
X-HCP-SoftwareVersion: 8.2.0.2
Content-Length: 0

© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.

Example: Generating a chargeback report for a tenant


Here’s a sample GET request that generates a chargeback report for the tenant named europe that has two namespaces, finance and hr. The report covers the one day, February 17,, 2017. The report is written in CSV format to a file named FinanceStats-2017-02-17.txt. The request is made using a tenant-level user account that includes the administrator role.

Request with cURL command line

curl -k -i -H "Accept: text/csv"
    -H "Authorization: HCP bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6"
    "https://finance.hcp.example.com:9090...nants/finance/
         chargebackReport?start=2017-02-17T00:00:00-0500
         &end=2017-02-17T13:59:59-0500&granularity=day"
    > FinanceStats-2017-02-17.txt

Request in Python using PycURL

import pycurl
filehandle = open("FinanceStats-2017-02-17.txt", 'wb')
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Accept: text/csv",
  "Authorization: HCP \
  bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6"])
curl.setopt(pycurl.URL,
  "https://finance.hcp.example.com:9090...nants/finance/" +
  "chargebackReport?start=2017-02-17T00:00:00-0500" +
  "&end=2017-02-17T13:59:59-0500&granularity=day")
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/chargebackReport?start=2017-02-17T00:00:00-0500&end=2017-02-17T23:59:59-0500&granularity=day HTTP/1.1
Host: finance.hcp.example.com:9090
Authorization: HCP bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6
Accept: text/csv

Response headers

HTTP/1.1 200 OK
Content-Type: text/csv
X-HCP-SoftwareVersion: 8.2.0.2
Content-Length: 883

Response body

systemName,tenantName,namespaceName,startTime,endTime,objectCount,ingestedVolume,storageCapacityUsed,bytesIn,bytesOut,reads,writes,deletes,tieredObjects,tieredBytes,metadataOnlyObjects,metadataOnlyBytes,erasureCodedObjects,multipartObjects,multipartObjectParts,multipartObjectBytes,multipartUploads,multipartUploadParts,multipartUploadBytes,deleted,valid
finance.hcp.example.com,europe,finance,2017-02-17T00:00:00-0500,2017-02-17T23:59:59-0500,6,134243721,134270976,123986263,87561,1,10,0,0,0,0,0,11,2,7,93213889,0,0,0,false,true
finance.hcp.example.com,europe,hr,2017-02-17T00:00:00-0500,2017-02-17T23:59:59-0500,7,9609368,9621504,9609368,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,false,true
finance.hcp.example.com,europe,,2017-02-17T00:00:00-0500,2017-02-17T23:59:59-0500,13,143853089,143892480,133595631,87561,1,17,0,0,0,0,0,11,2,7,93213889,0,0,0,false,true

© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.

 

  • Was this article helpful?