Get List of Users Assigned to User Group

To get a list of users assigned to a user group:

1
2
GET /user_groups/:id/users.xml
GET /user_groups/:id/users.json

XML Request Example

1
curl -i -u user:userpass -X GET http://onapp.test/user_groups/12/users.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request Example

1
curl -i -u user:userpass -X GET http://onapp.test/user_groups/12/users.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<users type="array">
    <user>
        <activated_at type="datetime">2012-04-03T14:30:34+00:00</activated_at>
        <avatar nil="true"/>
        <bucket_id type="integer">201</bucket_id>
        <cdn_account_status>ACTIVE</cdn_account_status>
        <cdn_status>ACTIVE</cdn_status>
        <created_at type="datetime">2012-04-03T14:30:34+00:00</created_at>
        <deleted_at nil="true"/>
        <email>admin@example.com</email>
        <firewall_id type="integer">4</firewall_id>
        <first_name>John</first_name>
        <group_id>12</group_id>
        <id type="integer">1</id>
        <image_template_group_id nil="true"/>
        <infoboxes>
            <hidden_infoboxes type="array">
                <hidden_infobox>4840313084eef1f8e1dada293eb1b1ae</hidden_infobox>
            </hidden_infoboxes>
            <display_infoboxes type="boolean">true</display_infoboxes>
        </infoboxes>
        <last_name>Smith</last_name>
        <locale>en</locale>
        <login>admin</login>
        <password_changed_at type="datetime">2014-08-21T16:00:15+03:00</password_changed_at>
        <registered_yubikey>true</registered_yubikey>
        <status>active</status>
        <supplied type="boolean">false</supplied>
        <suspend_at nil="true"/>
        <system_theme>dark</system_theme>
        <time_zone/>
        <total_amount type="float">83787.4296875</total_amount>
        <updated_at type="datetime">2012-05-21T11:30:20+00:00</updated_at>
        <use_gravatar type="boolean">false</use_gravatar>
        <user_group_id nil="true"/>
        <outstanding_amount type="float">925.13000972271</outstanding_amount>
        <payment_amount type="decimal">0.0</payment_amount>
        <roles type="array">
            <role>
                <created_at type="datetime">2012-04-03T14:30:31+00:00</created_at>
                <id type="integer">1</id>
                <identifier>admin</identifier>
                <label>Administrator</label>
                <updated_at type="datetime">2012-04-20T10:28:32+00:00</updated_at>
                <permissions type="array">
                    <permission>
                        <created_at type="datetime">2012-04-03T14:30:31+00:00</created_at>
                        <id type="integer">110</id>
                        <identifier>autobackup_templates</identifier>
                        <label>Any action on autobackup templates</label>
                        <updated_at type="datetime">2012-04-03T14:30:31+00:00</updated_at>
                    </permission>
                </permissions>
            </role>
            <role>
            </role>
        </roles>
        <used_cpus type="integer">0</used_cpus>
        <used_memory type="integer">0</used_memory>
        <used_cpu_shares type="integer">0</used_cpu_shares>
        <used_disk_size type="integer">0</used_disk_size>
        <used_ip_addresses type="array">
            <ip_address>
                <address>109.123.105.147</address>
                <broadcast>109.123.105.159</broadcast>
                <created_at type="datetime">2012-07-25T21:49:41-10:00</created_at>
                <customer_network_id nil="true"/>
                <disallowed_primary type="boolean">false</disallowed_primary>
                <gateway>109.123.105.145</gateway>
                <hypervisor_id nil="true"/>
                <id type="integer">652</id>
                <ip_address_pool_id nil="true"/>
                <network_address>109.123.105.144</network_address>
                <network_id type="integer">36</network_id>
                <pxe type="boolean">false</pxe>
                <updated_at type="datetime">2012-07-26T02:32:13-10:00</updated_at>
                <user_id nil="true"/>
                <free type="boolean">false</free>
                <netmask>255.255.255.240</netmask>
            </ip_address>
        </used_ip_addresses>
        <memory_available type="integer">3091</memory_available>
        <disk_space_available type="integer">278</disk_space_available>
        <cdn_reference type="integer">945453445</cdn_reference>
        <additional_fields type="array">
            <additional_field>
                <name>add_field1</name>
                <value>0</value>
            </additional_field>
        </additional_fields>
    </user>
    <user>...</user>
</users>

Where:

  • activated_at – time when the user was activated
  • avatar - user’s avatar
  • bucket_id – ID of the bucket assigned to this user
  • cdn_account_status – always returns ACTIVE status; but it is actually activated when CDN was enabled for particular user
  • cdn_status - whether CDN resources are enabled for this user or not
  • created_at – time when the user was created, in [YYYY][MM][DD]T[hh][mm][ss]Z
  • deleted_at – time when the user was deleted
  • email – user’s email
  • firewall_id - the ID of the firewall the user is associated with
  • first_name – user’s first name
  • group_id - deprecated attribute; will be removed in upcoming release
  • id — the ID of a user in the database
  • image_template_group – the ID of associated template group, if any
  • infoboxes - an array of infoboxes with the following details:
    • hidden_infoboxes - an array of hidden infoboxes
      • hidden_infobox - hash of a hidden inobox
    • display_infoboxes - true if the infoboxes are displayed for this user; otherwise, false
  • last_name – the user’s last name
  • locale – locale (language) associated with user
  • login – user’s login name. The login parameter is not returned when API key is used for authentication instead of a login/password combination.
  • password_changed_at - the date when the user’s password was changed in the [YYYY][MM][DD]T[hh][mm][ss]Z format
  • registered_yubikey - true if the user has enabled logging in using a YubiKey; otherwise, false. To view the Yubikey(s) associated with a certain user, refer to Get List of User’s YubiKeys. For the API request that adds a YubiKey, refer to Add YubiKey to User.
  • status – status of the user’s account (active, suspended or deleted)
  • supplied - whether the user was created for the supplier when he published a zone to the Federation. If true, no actions can be performed on this user
  • suspend_at – time when the system should suspend a user
  • system_theme - color scheme of the interface: light or dark
  • time_zone – the time zone of the user
  • total_amount - sum total of outstanding and payment amount
  • updated_at – time when user’s profile data was updated
  • use_gravatar - true if avatar is enabled for the user; otherwise, false
  • user_group_id – ID of the user group assigned to this user
  • outstanding_amount – the amount of money the user is due to pay
  • payment_amount – amount of money the user has actually paid
  • roles — an array of user roles to which this account is assigned to, where
    • created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format
    • id – role ID
    • identifier – role identifier
    • label – role title
    • updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format
    • permissions – an array with permissions assigned to this role
      • created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format
      • id – permission ID
      • identifier – permission identifier
      • label – permission title
      • updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format
  • used_cpus – number of CPU cores allocated to all virtual servers and edge servers of the user
  • used_memory - the amount of RAM used by the user (MB)
  • used_cpu_shares - the amount of CPU shares used
  • used_disk_size – size of all user disks in GB
  • used_ip_addresses – an array of IP addresses associated with the user
    • ip_address - an array of IP address with the following parameters:
      • address - IP address
      • broadcast – broadcast address
      • created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format
      • customer_network_id - the ID of the customer VLAN the IP address belongs to
      • disallowed_primarytrue if not allowed to be used as primary (for VS build); otherwise false
      • gateway – gateway address
      • hypervisor_id - the ID of a compute resource the IP address is associated with
      • id – the ID of the IP address
      • ip_address_pool_id – the address of the IP address pool
      • network_address – the address of the network
      • network_id – the ID of the network
      • pxe - true if this compute resource address can be used for cloudbooting a compute resource
      • updated_at – the date when the network was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format
      • user_id – ID of a user associated with this IP address
      • freetrue if free; otherwise, false
      • netmask – netmask for the IP address
  • memory_available – the amount of RAM available to this user (MB)
  • disk_space_available – disk space available for the user (GB)
    • additional field – user additional field, where:
      • value – the additional field value
      • name – the additional field title