fog-profitbricks 3.0.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +0 -3
  3. data/README.md +437 -3
  4. data/lib/fog/profitbricks/compute.rb +138 -80
  5. data/lib/fog/profitbricks/helpers/compute/data_helper.rb +1 -1
  6. data/lib/fog/profitbricks/models/compute/contract_resource.rb +35 -0
  7. data/lib/fog/profitbricks/models/compute/contract_resources.rb +19 -0
  8. data/lib/fog/profitbricks/models/compute/group.rb +66 -0
  9. data/lib/fog/profitbricks/models/compute/groups.rb +26 -0
  10. data/lib/fog/profitbricks/models/compute/lan.rb +3 -0
  11. data/lib/fog/profitbricks/models/compute/location.rb +1 -0
  12. data/lib/fog/profitbricks/models/compute/resource.rb +30 -0
  13. data/lib/fog/profitbricks/models/compute/resources.rb +32 -0
  14. data/lib/fog/profitbricks/models/compute/share.rb +59 -0
  15. data/lib/fog/profitbricks/models/compute/shares.rb +33 -0
  16. data/lib/fog/profitbricks/models/compute/user.rb +75 -0
  17. data/lib/fog/profitbricks/models/compute/users.rb +45 -0
  18. data/lib/fog/profitbricks/models/compute/volume.rb +2 -0
  19. data/lib/fog/profitbricks/requests/compute/add_share.rb +64 -0
  20. data/lib/fog/profitbricks/requests/compute/add_user_to_group.rb +89 -0
  21. data/lib/fog/profitbricks/requests/compute/create_group.rb +85 -0
  22. data/lib/fog/profitbricks/requests/compute/create_lan.rb +1 -0
  23. data/lib/fog/profitbricks/requests/compute/create_user.rb +83 -0
  24. data/lib/fog/profitbricks/requests/compute/create_volume.rb +1 -0
  25. data/lib/fog/profitbricks/requests/compute/delete_group.rb +43 -0
  26. data/lib/fog/profitbricks/requests/compute/delete_share.rb +42 -0
  27. data/lib/fog/profitbricks/requests/compute/delete_user.rb +43 -0
  28. data/lib/fog/profitbricks/requests/compute/get_all_contract_resources.rb +55 -0
  29. data/lib/fog/profitbricks/requests/compute/get_all_groups.rb +62 -0
  30. data/lib/fog/profitbricks/requests/compute/get_all_lans.rb +1 -0
  31. data/lib/fog/profitbricks/requests/compute/get_all_resources.rb +66 -0
  32. data/lib/fog/profitbricks/requests/compute/get_all_shares.rb +46 -0
  33. data/lib/fog/profitbricks/requests/compute/get_all_users.rb +70 -0
  34. data/lib/fog/profitbricks/requests/compute/get_group.rb +64 -0
  35. data/lib/fog/profitbricks/requests/compute/get_group_users.rb +78 -0
  36. data/lib/fog/profitbricks/requests/compute/get_lan.rb +1 -0
  37. data/lib/fog/profitbricks/requests/compute/get_resource_by_type.rb +73 -0
  38. data/lib/fog/profitbricks/requests/compute/get_resources_by_type.rb +44 -0
  39. data/lib/fog/profitbricks/requests/compute/get_share.rb +52 -0
  40. data/lib/fog/profitbricks/requests/compute/get_user.rb +72 -0
  41. data/lib/fog/profitbricks/requests/compute/remove_user_from_group.rb +49 -0
  42. data/lib/fog/profitbricks/requests/compute/update_group.rb +85 -0
  43. data/lib/fog/profitbricks/requests/compute/update_lan.rb +1 -0
  44. data/lib/fog/profitbricks/requests/compute/update_share.rb +67 -0
  45. data/lib/fog/profitbricks/requests/compute/update_user.rb +94 -0
  46. data/lib/fog/profitbricks/version.rb +1 -1
  47. data/tests/profitbricks/models/compute/compute_tests.rb +6 -0
  48. data/tests/profitbricks/requests/compute/location_tests.rb +4 -4
  49. data/tests/profitbricks/requests/compute/nic_tests.rb +7 -19
  50. data/tests/profitbricks/requests/compute/server_tests.rb +9 -21
  51. metadata +58 -28
  52. data/gemfiles/Gemfile.1.9.2- +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6db38014892bf2bdce49625f871aec559f4d8f24
4
- data.tar.gz: 2fb1020757ff1989716c6542a579a84d7205dcd5
3
+ metadata.gz: 8f5debfdaf3a325763e5c2bbab6cfe3579ba9b59
4
+ data.tar.gz: d393b090eb06d77179d0e0ee328fe1fefa58b5b7
5
5
  SHA512:
6
- metadata.gz: 5d7a53c0ca044dffc906058619d7b107429aedee43fac6b178c3a5bf44ab5f93bf4380947fa2020820c77b912ce993caefdda090bb100c81720f0e0e477c335f
7
- data.tar.gz: fdc7e4267399855ad2924c148edcc0a9aa695d82a7c025a9d3978034830b1cc00c1086fcd57fec180e81e9f03335e8348006a05600c149366b5222160318144f
6
+ metadata.gz: 9686e4a271e84a6ce971cbb061d3b14c865da0b226d1aa9de2848dc3f49215a5d01cb2aae37b4961a22fef957a0d1f1d28251162c6aa96a31cd45f7875238365
7
+ data.tar.gz: 8fb85e43f65b3ae9a78b7521270e6e9ce5d1382f61ac2881c639a57d03ba73d3d2c6050a4ecb88e416cfde902f82a985bafcda98b888cddbad65394dace447e5
@@ -9,9 +9,6 @@ matrix:
9
9
  include:
10
10
  - rvm: 1.8.7
11
11
  gemfile: gemfiles/Gemfile.1.8.7
12
- - rvm: 1.9.2
13
- gemfile: gemfiles/Gemfile.1.9.2-
14
- env: COVERAGE=true
15
12
  - rvm: 1.9.3
16
13
  gemfile: gemfiles/Gemfile.1.9.2+
17
14
  env: COVERAGE=true
data/README.md CHANGED
@@ -90,6 +90,30 @@ Module for the 'fog' gem to support ProfitBricks Cloud API.
90
90
  * [Get a LAN](#get-a-lan)
91
91
  * [Update a LAN](#update-a-lan)
92
92
  * [Delete a LAN](#delete-a-lan)
93
+ * [Contract Resources](#contract-resources)
94
+ * [List Contract Resources](#list-contract-resources)
95
+ * [User Management](#user-management)
96
+ * [List Groups](#list-groups)
97
+ * [Retrieve a Group](#retrieve-a-group)
98
+ * [Create a Group](#create-a-group)
99
+ * [Update a Group](#update-a-group)
100
+ * [Delete a Group](#delete-a-group)
101
+ * [List Shares](#list-shares)
102
+ * [Retrieve a Share](#retrieve-a-share)
103
+ * [Add a Share](#add-a-share)
104
+ * [Update a Share](#update-a-share)
105
+ * [Delete a Share](#delete-a-share)
106
+ * [List Users in a Group](#list-users-in-a-group)
107
+ * [Add User to Group](#add-user-to-group)
108
+ * [Remove User from a Group](#remove-user-from-a-group)
109
+ * [List Users](#list-users)
110
+ * [Retrieve a User](#retrieve-a-user)
111
+ * [Create a User](#create-a-user)
112
+ * [Update a User](#update-a-user)
113
+ * [Delete a User](#delete-a-user)
114
+ * [List Resources](#list-resources)
115
+ * [List All Resources of a Type](#list-all-resources-of-a-type)
116
+ * [List a Specific Resource Type](#list-a-specific-resource-type)
93
117
  * [Contributing](#contributing)
94
118
 
95
119
  ## Getting Started
@@ -161,6 +185,7 @@ The following table outlines the locations currently supported:
161
185
  | VALUE| COUNTRY | CITY |
162
186
  |---|---|---|
163
187
  | us/las | United States | Las Vegas |
188
+ | us/ewr | United States | Newark |
164
189
  | de/fra | Germany | Frankfurt |
165
190
  | de/fkb | Germany | Karlsruhe |
166
191
 
@@ -292,6 +317,7 @@ The following table outlines the various licence types you can define:
292
317
  | LICENCE TYPE | COMMENT |
293
318
  |---|---|
294
319
  | WINDOWS | You must specify this if you are using your own, custom Windows image due to Microsoft's licensing terms. |
320
+ | WINDOWS2016 | You must specify this if you are using your own, custom Windows image due to Microsoft's licensing terms. |
295
321
  | LINUX ||
296
322
  | UNKNOWN | If you are using an image uploaded to your account your OS Type will inherit as UNKNOWN. |
297
323
 
@@ -637,7 +663,7 @@ The following table describes the request arguments:
637
663
  | bus | string | The bus type of the volume (VIRTIO or IDE). Default: VIRTIO. | No |
638
664
  | image | string | The image or snapshot ID. | Yes* |
639
665
  | type | string | The volume type, HDD or SSD. | Yes |
640
- | licenceType | string | The licence type of the volume. Options: LINUX, WINDOWS, UNKNOWN, OTHER | Yes* |
666
+ | licenceType | string | The licence type of the volume. Options: LINUX, WINDOWS, WINDOWS2016, UNKNOWN, OTHER | Yes* |
641
667
  | imagePassword | string | One-time password is set on the Image for the appropriate account. This field may only be set in creation requests. When reading, it always returns null. Password has to contain 8-50 characters. Only these characters are allowed: [abcdefghjkmnpqrstuvxABCDEFGHJKLMNPQRSTUVX23456789] | Yes* |
642
668
  | sshKeys | string | SSH keys to allow access to the volume via SSH | Yes* |
643
669
  | availabilityZone | string | The storage availability zone assigned to the volume. Valid values: AUTO, ZONE_1, ZONE_2, or ZONE_3. This only applies to HDD volumes. Leave blank or set to AUTO when provisioning SSD volumes. | No |
@@ -769,7 +795,7 @@ The following table describes the request arguments:
769
795
  | discVirtioHotUnplug | bool | This volume is capable of Virt-IO drive hot unplug (no reboot required) ||
770
796
  | discScsiHotPlug | bool | This volume is capable of SCSI drive hot plug (no reboot required) ||
771
797
  | discScsiHotUnplug | bool | This volume is capable of SCSI drive hot unplug (no reboot required) ||
772
- | licencetype | string | The snapshot's licence type: LINUX, WINDOWS, or UNKNOWN. ||
798
+ | licencetype | string | The snapshot's licence type: LINUX, WINDOWS, WINDOWS2016, or UNKNOWN. ||
773
799
 
774
800
  After retrieving a snapshot, either by getting it by id, or as a create response object, you can change it's properties and call the `update` method:
775
801
 
@@ -1118,7 +1144,7 @@ The following table describes the request arguments:
1118
1144
  | image-id | string | The unique ID of the image. | Yes |
1119
1145
  | name | string | The name of the image. ||
1120
1146
  | description | string | The description of the image. ||
1121
- | licencetype | string | The image's licence type: LINUX, WINDOWS, or UNKNOWN. ||
1147
+ | licencetype | string | The image's licence type: LINUX, WINDOWS, WINDOWS2016, or UNKNOWN. ||
1122
1148
  | cpuHotPlug | bool | This volume is capable of CPU hot plug (no reboot required) ||
1123
1149
  | cpuHotUnplug | bool | This volume is capable of CPU hot unplug (no reboot required) ||
1124
1150
  | ramHotPlug | bool | This volume is capable of memory hot plug (no reboot required) ||
@@ -1486,6 +1512,413 @@ lan.delete
1486
1512
 
1487
1513
  ---
1488
1514
 
1515
+ ### Contract Resources
1516
+
1517
+ Checking the amount of available resources under a contract can help you to avoid provisioning errors resulting from the attempt to provision more resources than are available.
1518
+
1519
+ #### List Contract Resources
1520
+
1521
+ Returns information about the resource limits for a particular contract and the current resource usage.
1522
+
1523
+ ```
1524
+ compute.contract_resources.all
1525
+ ```
1526
+
1527
+ The amount of data included in the response payload will vary slightly depending on the credentials supplied when making the request. If the credentials supplied belong to the "Contract Owner", then all the available information is returned.
1528
+
1529
+ ---
1530
+
1531
+ ### User Management
1532
+
1533
+ #### List Groups
1534
+
1535
+ Retrieve a full list of all groups.
1536
+
1537
+ ```
1538
+ compute.groups.all
1539
+ ```
1540
+
1541
+ ---
1542
+
1543
+ #### Retrieve a Group
1544
+
1545
+ Retrieves detailed information about a specific group.
1546
+
1547
+ The following table describes the request arguments:
1548
+
1549
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1550
+ |---|---|---|---|
1551
+ | group-id | string | The ID of the specific group to retrieve. | Yes |
1552
+
1553
+ ```
1554
+ compute.groups.get('group-id')
1555
+ ```
1556
+
1557
+ ---
1558
+
1559
+ #### Create a Group
1560
+
1561
+ Create a new group and set group privileges.
1562
+
1563
+ The following table describes the request arguments:
1564
+
1565
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1566
+ |---|---|---|---|
1567
+ | name | string | A name for the group. | Yes |
1568
+ | createDataCenter | bool | The group will be allowed to create virtual data centers. Defaults to `false`. ||
1569
+ | createSnapshot | bool | The group will be allowed to create snapshots. Defaults to `false`. ||
1570
+ | reserveIp | bool | The group will be allowed to reserve IP addresses. Defaults to `false`. ||
1571
+ | accessActivityLog | bool | The group will be allowed to access the activity log. Defaults to `false`. ||
1572
+
1573
+ ```
1574
+ compute.groups.create(:name => 'fogTestGroup', :create_datacenter => true)
1575
+ ```
1576
+
1577
+ ---
1578
+
1579
+ #### Update a Group
1580
+
1581
+ Perform updates to attributes of a group.
1582
+
1583
+ The following table describes the request arguments:
1584
+
1585
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1586
+ |---|---|---|---|
1587
+ | group-id | string | The ID of the specific group to update. | Yes |
1588
+ | name | string | A name for the group. | Yes |
1589
+ | createDataCenter | bool | The group will be allowed to create virtual data centers. Defaults to `false`. ||
1590
+ | createSnapshot | bool | The group will be allowed to create snapshots. Defaults to `false`. ||
1591
+ | reserveIp | bool | The group will be allowed to reserve IP addresses. Defaults to `false`. ||
1592
+ | accessActivityLog | bool | The group will be allowed to access the activity log. Defaults to `false`. ||
1593
+
1594
+ After retrieving a group, either by getting it by id, or as a create response object, you can change it's properties and call the `update` method:
1595
+
1596
+ ```
1597
+ group = compute.groups.get('group-id')
1598
+ group.name = 'fogTestGroupUpdated'
1599
+ group.reserve_ip = true
1600
+ group.update
1601
+ ```
1602
+
1603
+ ---
1604
+
1605
+ #### Delete a Group
1606
+
1607
+ Delete a single group.</br></br>Resources that are assigned to the group are NOT deleted, but are no longer accessible to the group members unless the member is a Contract Owner, Admin, or Resource Owner.
1608
+
1609
+ The following table describes the request arguments:
1610
+
1611
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1612
+ |---|---|---|---|
1613
+ | group-id | string | The ID of the specific group to delete. | Yes |
1614
+
1615
+ After retrieving a group, either by getting it by id, or as a create response object, you can call the `delete` method directly on the object:
1616
+
1617
+ ```
1618
+ group = compute.groups.get('group-id')
1619
+ group.delete
1620
+ ```
1621
+
1622
+ ---
1623
+
1624
+ #### List Shares
1625
+
1626
+ Retrieves a full list of all the resources that are shared through this group and lists the permissions granted to the group members for each shared resource.
1627
+
1628
+ The following table describes the request arguments:
1629
+
1630
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1631
+ |---|---|---|---|
1632
+ | group-id | string | The ID of the specific group. | Yes |
1633
+
1634
+
1635
+ ```
1636
+ compute.shares.all(group-id )
1637
+ ```
1638
+
1639
+ ---
1640
+
1641
+ #### Retrieve a Share
1642
+
1643
+ Retrieves the details of a specific shared resource available to the specified group.
1644
+
1645
+ The following table describes the request arguments:
1646
+
1647
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1648
+ |---|---|---|---|
1649
+ | group-id | string | The ID of the specific group. | Yes |
1650
+ | resource-id | string | The ID of the specific resource. | Yes |
1651
+
1652
+
1653
+ ```
1654
+ compute.shares.get(group-id, resource-id)
1655
+ ```
1656
+
1657
+ ---
1658
+
1659
+ #### Add a Share
1660
+
1661
+ Adds a specific resource share to a group and optionally allows the setting of permissions for that resource. As an example, you might use this to grant permissions to use an image or snapshot to a specific group.
1662
+
1663
+ The following table describes the request arguments:
1664
+
1665
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1666
+ |---|---|---|---|
1667
+ | group-id | string | The ID of the specific group to add a resource to. | Yes |
1668
+ | resource-id | string | The ID of the specific resource to add. | Yes |
1669
+ | editPrivilege | bool | The group has permission to edit privileges on this resource. ||
1670
+ | sharePrivilege | bool | The group has permission to share this resource. ||
1671
+
1672
+
1673
+ ```
1674
+ compute.shares.create(:group_id => group-id, :resource_id => resource-id, :share_privilege => true)
1675
+ ```
1676
+
1677
+ ---
1678
+
1679
+ #### Update a Share
1680
+
1681
+ Update the permissions that a group has for a specific resource share.
1682
+
1683
+ The following table describes the request arguments:
1684
+
1685
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1686
+ |---|---|---|---|
1687
+ | group-id | string | The ID of the specific group to add a resource to. | Yes |
1688
+ | resource-id | string | The ID of the specific resource to add. | Yes |
1689
+ | editPrivilege | bool | The group has permission to edit privileges on this resource. ||
1690
+ | sharePrivilege | bool | The group has permission to share this resource. ||
1691
+
1692
+ After retrieving a group, either by getting it by id, or as a create response object, you can change it's properties and call the `update` method:
1693
+
1694
+ ```
1695
+ share = compute.shares.get(group-id, resource-id)
1696
+ share.edit_privilege = true
1697
+ share.update
1698
+ ```
1699
+
1700
+ ---
1701
+
1702
+ #### Delete a Share
1703
+
1704
+ Remove a resource share from a specified group.
1705
+
1706
+ The following table describes the request arguments:
1707
+
1708
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1709
+ |---|---|---|---|
1710
+ | group-id | string | The ID of the specific group to add a resource to. | Yes |
1711
+ | resource-id | string | The ID of the specific resource to add. | Yes |
1712
+
1713
+ After retrieving a group, either by getting it by id, or as a create response object, you can call the `delete` method directly on the object:
1714
+
1715
+ ```
1716
+ share = compute.shares.get(group-id, resource-id)
1717
+ share.delete
1718
+ ```
1719
+
1720
+ ---
1721
+
1722
+ #### List Users in a Group
1723
+
1724
+ Retrieves a full list of all the users that are members of a particular group.
1725
+
1726
+ The following table describes the request arguments:
1727
+
1728
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1729
+ |---|---|---|---|
1730
+ | group-id | string | The ID of the specific group to retrieve a user list for. | Yes |
1731
+
1732
+
1733
+ ```
1734
+ compute.users.list_group_users(group-id)
1735
+ ```
1736
+
1737
+ ---
1738
+
1739
+ #### Add User to Group
1740
+
1741
+ Add an existing user to a group.
1742
+
1743
+ The following table describes the request arguments:
1744
+
1745
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1746
+ |---|---|---|---|
1747
+ | group-id | string | The ID of the specific group you want to add a user to. | Yes |
1748
+ | user-id | string | The ID of the specific user to add to the group. | Yes |
1749
+
1750
+ ```
1751
+ compute.users.add_group_user(group-id, user-id)
1752
+ ```
1753
+
1754
+ ---
1755
+
1756
+ #### Remove User from a Group
1757
+
1758
+ Remove a user from a group.
1759
+
1760
+ The following table describes the request arguments:
1761
+
1762
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1763
+ |---|---|---|---|
1764
+ | group-id | string | The ID of the specific group you want to remove a user from. | Yes |
1765
+ | user-id | string | The ID of the specific user to remove from the group. | Yes |
1766
+
1767
+ ```
1768
+ compute.users.remove_group_user(group-id, user-id)
1769
+ ```
1770
+
1771
+ ---
1772
+
1773
+ #### List Users
1774
+
1775
+ Retrieve a list of all the users that have been created under a contract.
1776
+
1777
+ ```
1778
+ compute.users.all
1779
+ ```
1780
+
1781
+ ---
1782
+
1783
+ #### Retrieve a User
1784
+
1785
+ Retrieve details about a specific user including what groups and resources the user is associated with.
1786
+
1787
+ The following table describes the request arguments:
1788
+
1789
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1790
+ |---|---|---|---|
1791
+ | user-id | string | The ID of the specific user to retrieve information about. | Yes |
1792
+
1793
+ ```
1794
+ compute.users.get(user-id)
1795
+ ```
1796
+
1797
+ ---
1798
+
1799
+ #### Create a User
1800
+
1801
+ Creates a new user under a particular contract.
1802
+
1803
+ The following table describes the request arguments:
1804
+
1805
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1806
+ |---|---|---|---|
1807
+ | firstname | string | User's first name. | Yes |
1808
+ | lastname | string | User's last name. | Yes |
1809
+ | email | string | User's e-mail address. | Yes |
1810
+ | password | string | A password for the user. | Yes |
1811
+ | administrator | bool | Assign administrative rights to the user. ||
1812
+ | forceSecAuth | bool | Indicates if secure (two-factor) authentication should be enforced for the user. ||
1813
+
1814
+ ```
1815
+ compute.users.create(:firstname => 'Fog', :lastname => 'Testuser', :email => 'email@address.com', :password => 'P4$$w0rd', :administrator => false, :force_sec_auth => false)
1816
+ ```
1817
+
1818
+ ---
1819
+
1820
+ #### Update a User
1821
+
1822
+ Update details about a specific user including their privileges.</br></br>**Note**: The password attribute is immutable. It is not allowed in update requests. It is recommended that a new user log into the DCD and change their password.
1823
+
1824
+ The following table describes the request arguments:
1825
+
1826
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1827
+ |---|---|---|---|
1828
+ | firstname | string | User's first name. | Yes |
1829
+ | lastname | string | User's last name. | Yes |
1830
+ | email | string | User's e-mail address. | Yes |
1831
+ | administrator | bool | Assign administrative rights to the user. | Yes |
1832
+ | forceSecAuth | bool | Indicates if secure (two-factor) authentication should be enforced for the user. | Yes |
1833
+
1834
+ After retrieving a user, either by getting it by id, or as a create response object, you can change it's properties and call the `update` method:
1835
+
1836
+ ```
1837
+ user = compute.users.get(user-id)
1838
+ user.force_sec_auth = true
1839
+ user.update
1840
+ ```
1841
+
1842
+ ---
1843
+
1844
+ #### Delete a User
1845
+
1846
+ Blacklists the user, disabling them. The user is not completely purged, therefore if a need to create a user with the same name in the future is anticipated, we suggest renaming the user before it is deleted.
1847
+
1848
+ The following table describes the request arguments:
1849
+
1850
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1851
+ |---|---|---|---|
1852
+ | user-id | string | The ID of the specific user to delete. | Yes |
1853
+
1854
+ After retrieving a user, either by getting it by id, or as a create response object, you can call the `delete` method directly on the object:
1855
+
1856
+ ```
1857
+ user = compute.users.get(user-id)
1858
+ user.delete
1859
+ ```
1860
+
1861
+ ---
1862
+
1863
+ #### List Resources
1864
+
1865
+ Retrieve a list of all resources and optionally their group associations.</br></br>**Please Note**: This API call can take a significant amount of time to return when there are a large number of provisioned resources. You may wish to consult the next section on how to list resources of a particular type.
1866
+
1867
+ ```
1868
+ compute.resources.all
1869
+ ```
1870
+
1871
+ ---
1872
+
1873
+ #### List All Resources of a Type
1874
+
1875
+ Retrieve a list of all resources and optionally their group associations.</br></br>**Please Note**: This API call can take a significant amount of time to return when there are a large number of provisioned resources. You may wish to consult the next section on how to list resources of a particular type.
1876
+
1877
+ The following table describes the request arguments:
1878
+
1879
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1880
+ |---|---|---|---|
1881
+ | resource-type | string | The specific type of resources to retrieve information about. | Yes |
1882
+
1883
+ The values available for resource-type are listed in this table:
1884
+
1885
+ | RESOURCETYPE| DESCRIPTION |
1886
+ |---|---|
1887
+ | datacenter | A virtual data center. |
1888
+ | image | A private image that has been uploaded to ProfitBricks. |
1889
+ | snapshot | A snapshot of a storage volume. |
1890
+ | ipblock | An IP block that has been reserved. |
1891
+
1892
+ ```
1893
+ compute.resources.get_by_type('datacenter')
1894
+ ```
1895
+
1896
+ ---
1897
+
1898
+ #### List a Specific Resource Type
1899
+
1900
+ The following table describes the request arguments:
1901
+
1902
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1903
+ |---|---|---|---|
1904
+ | resource-type | string | The specific type of resources to retrieve information about. | Yes |
1905
+ | resource-id | string | The ID of the specific resource to retrieve information about. | Yes |
1906
+
1907
+ The values available for resource-type are listed in this table:
1908
+
1909
+ | RESOURCETYPE| DESCRIPTION |
1910
+ |---|---|
1911
+ | datacenter | A virtual data center. |
1912
+ | image | A private image that has been uploaded to ProfitBricks. |
1913
+ | snapshot | A snapshot of a storage volume. |
1914
+ | ipblock | An IP block that has been reserved. |
1915
+
1916
+ ```
1917
+ compute.resources.get_resource_by_type('datacenter', resource-id)
1918
+ ```
1919
+
1920
+ ---
1921
+
1489
1922
  ## Contributing
1490
1923
 
1491
1924
  1. Fork it ( https://github.com/fog/fog-profitbricks/fork )
@@ -1493,3 +1926,4 @@ lan.delete
1493
1926
  3. Commit your changes (`git commit -am 'Add some feature'`)
1494
1927
  4. Push to the branch (`git push origin my-new-feature`)
1495
1928
  5. Create a new Pull Request
1929
+