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

Update a user

Updates a user specified by their database ID.

Resource URL

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

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

Request

Parameters
  Name Type Description
URL path parameters (required) userId integer The ID of the user to update. This is not the Username field in the Users page of the Cloud Cruiser Portal used for logging in, but the ID of the user record in the database.
Content-Type

application/xml

Body

Updated information for the specified user, as XML text with the root element user or JAXB type com.cloudcruiser.server.webservices.v2.dto.User.user.

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

Details for the specified 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

PUT http://localhost:8080/rest/v2/users​​/10006

Java invocation
Request body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user xmlns="http://www.cloudcruiser.com/webservices/v2/User" id="10000">
    <userName>Joe</userName>
    <active>false</active>
    <userGroup name="default" id="10000"/>
    <fullName>Joe User</fullName>
    <emailAddress>josephl@cloudcruiser.com</emailAddress>
    <nativeCCUser>true</nativeCCUser>
    <roles>
        <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="10000">
    <userName>Joe</userName>
    <active>false</active>
    <userGroup name="default" id="10000"/>
    <fullName>Joe User</fullName>
    <emailAddress>josephl@cloudcruiser.com</emailAddress>
    <nativeCCUser>true</nativeCCUser>
    <roles>
        <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