Cloud Cruiser became HPE Consumption Analytics on Nov. 1st. You'll still see the old name in places while we update this site.

 

 

Consumption Analytics Documentation

Home > Cloud Cruiser 4 > REST API reference > Users and user groups > Import users from CSV

Import users from CSV

Imports CSV-formatted user data.

Resource URL

In version 4.0: POST http://<ccServerURL>/rest/v2/users/import

In version 4.1 and later: POST http://<ccServerURL>/rest/v2/ccusers/import

Request

Parameters
  Name Type Description
URL query parameters (optional) activateNewUsers boolean If true, enables access to the users. If false, disables access to the user. The default is true.
allowAllAccounts boolean If true, all customer accounts are viewable for the users. The default is false.
defaultAccountView string Default account structure view for new users
defaultRole string Default role for new users. This can be ADMINCUST_BUDGETDEMOLICENSEPOST_USAGE, and REPORT_USER. The default is REPORT_USER.
defaultUserGroup string Group to assign to users who do not have one specified in the import file. If the user group does not exist, it will be created.
newUserPassword string Specifies whether new users will be created with the default password or no password. Valid values are SYSTEM_DEFAULT and NONE. The default is SYSTEM_DEFAULT.
updateDuplicates boolean Whether to update an existing user when the source data contains a duplicate. When false, the duplicate source row is ignored. The default is false.
Content-Type

text/csv

Body

The customers to import, in User CSV file format.

Response

Content-Type

application/xml

Body

Details for the result of the import, as XML text with the root element itemImportResult or JAXB type com.cloudcruiser.server.webservices.v2.dto.common.ItemImportResult.

Schema

Version 4.0
Version 4.1 and later

For Cloud Cruiser 4.1 and later, this XML schema describes user and user group objects.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.cloudcruiser.com/webservices/v2/User" attributeFormDefault="unqualified" elementFormDefault="qualified"targetNamespace="http://www.cloudcruiser.com/webservices/v2/User">
  <xs:import/>
  <xs:element name="user" type="tns:User"/>
  <xs:element name="userGroup" type="tns:UserGroup"/>
  <xs:element name="userGroupList">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:userGroup"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="userList">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:user"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="userSummaryList" type="tns:UserSummaryList"/>
  <xs:complexType name="User">
    <xs:sequence>
      <xs:element name="userName" type="xs:string"/>
      <xs:element minOccurs="0" name="password" type="xs:string"/>
      <xs:element default="true" name="active" type="xs:boolean"/>
      <xs:element name="userGroup">
        <xs:complexType>
          <xs:sequence/>
          <xs:attribute name="name" type="xs:string" use="required"/>
          <xs:attribute name="id" type="xs:int"/>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="fullName" type="xs:string"/>
      <xs:element minOccurs="0" name="domainName" type="xs:string"/>
      <xs:element minOccurs="0" name="emailAddress" type="xs:string"/>
      <xs:element default="true" name="nativeCCUser" type="xs:boolean"/>
      <xs:element name="roles">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="unbounded" minOccurs="0" name="role" type="tns:Role"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="userflag1" type="xs:string"/>
      <xs:element minOccurs="0" name="userflag2" type="xs:string"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int"/>
  </xs:complexType>
  <xs:complexType name="Role">
    <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element name="type" type="xs:string"/>
      <xs:element minOccurs="0" name="description" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="UserGroup">
    <xs:sequence>
      <xs:element name="groupName" type="xs:string"/>
      <xs:element minOccurs="0" name="title" type="xs:string"/>
      <xs:element maxOccurs="unbounded" name="accountView" type="tns:AccountView"/>
      <xs:element default="true" name="allAccounts" type="xs:boolean"/>
      <xs:element minOccurs="0" name="allowedAccounts">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="unbounded" name="accountid" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="users">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="unbounded" name="user" type="tns:UserSummary"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int"/>
  </xs:complexType>
  <xs:complexType name="AccountView">
    <xs:sequence/>
    <xs:attribute name="name" type="xs:string" use="required"/>
    <xs:attribute name="groupDefault" type="xs:boolean"/>
  </xs:complexType>
  <xs:complexType name="UserSummary">
    <xs:sequence/>
    <xs:attribute name="name" type="xs:string"/>
    <xs:attribute name="id" type="xs:int"/>
    <xs:attribute name="active" type="xs:boolean"/>
  </xs:complexType>
  <xs:complexType name="UserSummaryList">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="userGroup" type="tns:UserGroupSummary"/>
    </xs:sequence>
    <xs:attribute name="totalGroups" type="xs:int"/>
    <xs:attribute name="retrievedGroups" type="xs:int"/>
  </xs:complexType>
  <xs:complexType name="UserGroupSummary">
    <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="user" type="tns:UserSummary"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int"/>
    <xs:attribute name="totalUsers" type="xs:int"/>
  </xs:complexType>
</xs:schema>

Example

URL invocation

POST http://localhost:8080/rest/v2/ccusers​​/import

Request body
username,full_name,email,active,role,all_accounts,account,group,password
bill,Bill Horton,bhorton@cloudcruiser.com,true,ADMIN,true,,Admin,
devmgr,Devin McManager,dmcmanager@cloudcruiser.com,true,ADMIN,true,,Admin,
storagemgr,Steve Thompson,sthompson@cloudcruiser.com,true,ADMIN,true,,Admin,
vpitfinance,Vicki Fagaro,vfagaro@cloudcruiser.com,true,ADMIN,true,,Admin,
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<itemImportResult xmlns="http://www.cloudcruiser.com/webservices/v2/Common">
    <importedSummary>
        <totalItems>4</totalItems>
        <newItems>4</newItems>
        <duplicateItems>0</duplicateItems>
        <updatedItems>0</updatedItems>
    </importedSummary>
    <newItemNames>
        <newItemName>storagemgr</newItemName>
        <newItemName>devmgr</newItemName>
        <newItemName>bill</newItemName>
        <newItemName>vpitfinance</newItemName>
    </newItemNames>
</itemImportResult>
Last modified

Tags

Classifications

This page has no classifications.
© Copyright 2018 Hewlett Packard Enterprise Development LP