Home > Cloud Cruiser 4 > REST API reference > Users and user groups > Create a user

Create a user

Creates a new user based on the provided information.

Resource URL

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

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

Request

Parameters

None

Content-Type

application/xml

Body

The user to create, as XML text with root element user or JAXB type com.cloudcruiser.server.webservices.v2.dto.User.user. The user's id attribute must be empty.

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>

Response

Content-Type

application/xml

Body

The new user, as XML text with the root element user or JAXB type com.cloudcruiser.server.webservices.v2.dto.User.user.

Schema

Same as for the request, above.

Example

URL invocation

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

Request body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user xmlns="http://www.cloudcruiser.com/webservices/v2/User">
    <userName>Sally</userName>
    <active>true</active>
    <userGroup name="admin" id="2"/>
    <fullName>Administrator</fullName>
    <domainName>bigorg</domainName>
    <emailAddress>sallysales@cloudcruiser.com</emailAddress>
    <nativeCCUser>true</nativeCCUser>
    <roles>
        <role>
            <name>Admin</name>
            <type>ADMIN</type>
            <description>Full access to all application functions</description>
        </role>
        <role>
            <name>Advanced Analytics</name>
            <type>ANALYTICS</type>
            <description>Access advanced analytics functionality</description>
        </role>
        <role>
            <name>Customer Budget</name>
            <type>CUST_BUDGET</type>
            <description>Access to customer budgets</description>
        </role>
        <role>
            <name>Post Usage Data</name>
            <type>POST_USAGE</type>
            <description>Post usage data via REST service</description>
        </role>
        <role>
            <name>Report User</name>
            <type>REPORT_USER</type>
            <description>Access only to running reports</description>
        </role>
    </roles>
</user>
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user xmlns="http://www.cloudcruiser.com/webservices/v2/User" id="10003">
    <userName>Sally</userName>
    <active>true</active>
    <userGroup name="admin" id="2"/>
    <fullName>Administrator</fullName>
    <domainName>bigorg</domainName>
    <emailAddress>sallysales@cloudcruiser.com</emailAddress>
    <nativeCCUser>true</nativeCCUser>
    <roles>
        <role>
            <name>Admin</name>
            <type>ADMIN</type>
            <description>Full access to all application functions</description>
        </role>
        <role>
            <name>Advanced Analytics</name>
            <type>ANALYTICS</type>
            <description>Access advanced analytics functionality</description>
        </role>
        <role>
            <name>Customer Budget</name>
            <type>CUST_BUDGET</type>
            <description>Access to customer budgets</description>
        </role>
        <role>
            <name>Post Usage Data</name>
            <type>POST_USAGE</type>
            <description>Post usage data via REST service</description>
        </role>
        <role>
            <name>Report User</name>
            <type>REPORT_USER</type>
            <description>Access only to running reports</description>
        </role>
    </roles>
</user>
Last modified

Tags

Classifications

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