Home > Cloud Cruiser 3 > REST API reference > Users and user groups > Import users from a CSV file

Import users from a CSV file

Imports CSV-formatted user data.

URL syntax

http://<ccServerURL
>/rest/v1/users/import

HTTP method

POST

Request

Content-Type
text/csv
Request body

Resource data in CSV-formatted text using the following XML schema:

<request>
  <representation mediaType="text/csv"></representation>
  <param name="updateDuplicates" style="header" type="xs:boolean">
    <doc>Whether to update duplicate users (default is 'false').</doc>
  </param>
  <param name="defaultUserGroup" style="header" type="xs:string">
    <doc>Default User group for new users</doc>
  </param>
  <param name="defaultAccountStructure" style="header" type="xs:string">
    <doc>Default account structure for new users</doc>
  </param>
  <param name="defaultRole" style="header" type="xs:string">
    <doc>Default role for new users, valid values are ADMIN, REPORT_USER, DEMO, CUST_BUDGET, LICENSE, POST_USAGE</doc>
  </param>
  <param name="allowAllAccounts" style="header" type="xs:boolean">
    <doc>If true, allow 'all' to be specified for account (default is 'false')</doc>
  </param>
  <param name="activateNewUsers" style="header" type="xs:boolean">
    <doc>If true, new users are active; if false, they are inactive (default is 'true')</doc>
  </param>
  <param name="newUserPassword" style="header" type="xs:string">
    <doc>Specifies whether new users will be created with the default password or no password. Valid values are 'default', 'none' (default is 'default')</doc>
  </param>
</request>

Response

Content-Type
application/xml
Response body

XML text with the root element itemImportResult and the following XML schema:

<xs:element name="itemImportResult" type="tns:ItemImportResult"/>
  <xs:complexType name="ItemImportResult" >
    <xs:sequence>
      <xs:element name="importedSummary">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="totalItems" type="xs:int"/>
     <xs:element name="newItems" type="xs:int"/>
            <xs:element name="duplicateItems" type="xs:int"/>
            <xs:element name="updatedItems" type="xs:int"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="newItemNames">
        <xs:simpleType>
          <xs:list itemType="xs:string"/>
        </xs:simpleType>
      </xs:element>
      <xs:element minOccurs="0" name="duplicateItemNames">
        <xs:simpleType>
          <xs:list itemType="xs:string"/>
        </xs:simpleType>
      </xs:element>
      <xs:element minOccurs="0" name="updatedItemNames">
        <xs:simpleType>
          <xs:list itemType="xs:string"/>
        </xs:simpleType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:element>
JAXB type
com.cloudcruiser.server.webservices.v1.dto.common.ItemImportResult

Example

URL
http://localhost:8080/rest/v1/users/import
Request body
username,full_name,email_address,domain_username,active,role,user_group,acct_structure,account,all_accounts,flag1,flag2
t-usr-A,Test User A,u-usr-A@bigorg.com,bigorg,1,CUST_BUDGET,testGroup-1,Default,,1,,
t-usr-B,Test User B,t-usr-B@bigorg.com,bigorg,1,DEMO,testGroup-2,,B-AA-KKKK,0,,,
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<itemImportResult xmlns="http://www.cloudcruiser.com/webservices/v1/Common">
  <importedSummary>
    <totalItems>2</totalItems>
    <newItems>2</newItems>
    <duplicateItems>0</duplicateItems>
    <updatedItems>0</updatedItems>
  </importedSummary>
  <newItemNames>t-usr-A t-usr-B</newItemNames>
  <duplicateItemNames></duplicateItemNames>
  <updatedItemNames></updatedItemNames>
</itemImportResult>
Last modified

Tags

This page has no custom tags.

Classifications

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