fog 0.3.17 → 0.3.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. data/Gemfile.lock +5 -5
  2. data/README.rdoc +16 -7
  3. data/fog.gemspec +102 -27
  4. data/lib/fog.rb +3 -2
  5. data/lib/fog/aws/cdn.rb +2 -1
  6. data/lib/fog/aws/compute.rb +3 -2
  7. data/lib/fog/aws/iam.rb +8 -0
  8. data/lib/fog/aws/models/compute/flavors.rb +2 -1
  9. data/lib/fog/aws/models/compute/server.rb +3 -0
  10. data/lib/fog/aws/models/compute/volume.rb +9 -8
  11. data/lib/fog/aws/models/storage/file.rb +24 -14
  12. data/lib/fog/aws/models/storage/files.rb +4 -14
  13. data/lib/fog/aws/parsers/cdn/distribution.rb +16 -1
  14. data/lib/fog/aws/parsers/cdn/get_distribution_list.rb +13 -0
  15. data/lib/fog/aws/parsers/compute/describe_volumes.rb +2 -0
  16. data/lib/fog/aws/parsers/iam/create_group.rb +2 -2
  17. data/lib/fog/aws/parsers/iam/create_user.rb +26 -0
  18. data/lib/fog/aws/parsers/iam/list_group_policies.rb +28 -0
  19. data/lib/fog/aws/parsers/iam/list_groups.rb +1 -1
  20. data/lib/fog/aws/parsers/storage/complete_multipart_upload.rb +24 -0
  21. data/lib/fog/aws/parsers/storage/initiate_multipart_upload.rb +24 -0
  22. data/lib/fog/aws/parsers/storage/list_multipart_uploads.rb +56 -0
  23. data/lib/fog/aws/parsers/storage/list_parts.rb +40 -0
  24. data/lib/fog/aws/requests/cdn/get_distribution.rb +11 -1
  25. data/lib/fog/aws/requests/cdn/get_distribution_list.rb +9 -1
  26. data/lib/fog/aws/requests/cdn/post_distribution.rb +16 -5
  27. data/lib/fog/aws/requests/cdn/put_distribution_config.rb +102 -0
  28. data/lib/fog/aws/requests/compute/describe_volumes.rb +1 -0
  29. data/lib/fog/aws/requests/compute/run_instances.rb +1 -1
  30. data/lib/fog/aws/requests/iam/add_user_to_group.rb +42 -0
  31. data/lib/fog/aws/requests/iam/create_group.rb +7 -3
  32. data/lib/fog/aws/requests/iam/create_user.rb +47 -0
  33. data/lib/fog/aws/requests/iam/delete_group.rb +5 -1
  34. data/lib/fog/aws/requests/iam/delete_group_policy.rb +42 -0
  35. data/lib/fog/aws/requests/iam/delete_user.rb +40 -0
  36. data/lib/fog/aws/requests/iam/list_group_policies.rb +47 -0
  37. data/lib/fog/aws/requests/iam/list_groups.rb +9 -4
  38. data/lib/fog/aws/requests/iam/put_group_policy.rb +44 -0
  39. data/lib/fog/aws/requests/iam/remove_user_from_group.rb +42 -0
  40. data/lib/fog/aws/requests/simpledb/put_attributes.rb +2 -2
  41. data/lib/fog/aws/requests/storage/abort_multipart_upload.rb +38 -0
  42. data/lib/fog/aws/requests/storage/complete_multipart_upload.rb +60 -0
  43. data/lib/fog/aws/requests/storage/get_service.rb +1 -1
  44. data/lib/fog/aws/requests/storage/initiate_multipart_upload.rb +55 -0
  45. data/lib/fog/aws/requests/storage/list_multipart_uploads.rb +68 -0
  46. data/lib/fog/aws/requests/storage/list_parts.rb +67 -0
  47. data/lib/fog/aws/requests/storage/put_object.rb +12 -5
  48. data/lib/fog/aws/requests/storage/upload_part.rb +51 -0
  49. data/lib/fog/aws/storage.rb +12 -6
  50. data/lib/fog/brightbox.rb +7 -0
  51. data/lib/fog/brightbox/bin.rb +23 -0
  52. data/lib/fog/brightbox/compute.rb +134 -0
  53. data/lib/fog/brightbox/models/compute/account.rb +51 -0
  54. data/lib/fog/brightbox/models/compute/cloud_ip.rb +43 -0
  55. data/lib/fog/brightbox/models/compute/cloud_ips.rb +34 -0
  56. data/lib/fog/brightbox/models/compute/flavor.rb +33 -0
  57. data/lib/fog/brightbox/models/compute/flavors.rb +28 -0
  58. data/lib/fog/brightbox/models/compute/image.rb +52 -0
  59. data/lib/fog/brightbox/models/compute/images.rb +28 -0
  60. data/lib/fog/brightbox/models/compute/server.rb +94 -0
  61. data/lib/fog/brightbox/models/compute/servers.rb +29 -0
  62. data/lib/fog/brightbox/models/compute/user.rb +39 -0
  63. data/lib/fog/brightbox/models/compute/users.rb +29 -0
  64. data/lib/fog/brightbox/models/compute/zone.rb +21 -0
  65. data/lib/fog/brightbox/models/compute/zones.rb +29 -0
  66. data/lib/fog/brightbox/requests/compute/create_api_client.rb +27 -0
  67. data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +27 -0
  68. data/lib/fog/brightbox/requests/compute/create_image.rb +27 -0
  69. data/lib/fog/brightbox/requests/compute/create_server.rb +27 -0
  70. data/lib/fog/brightbox/requests/compute/destroy_api_client.rb +28 -0
  71. data/lib/fog/brightbox/requests/compute/destroy_cloud_ip.rb +28 -0
  72. data/lib/fog/brightbox/requests/compute/destroy_image.rb +28 -0
  73. data/lib/fog/brightbox/requests/compute/destroy_server.rb +28 -0
  74. data/lib/fog/brightbox/requests/compute/get_account.rb +27 -0
  75. data/lib/fog/brightbox/requests/compute/get_api_client.rb +28 -0
  76. data/lib/fog/brightbox/requests/compute/get_cloud_ip.rb +28 -0
  77. data/lib/fog/brightbox/requests/compute/get_image.rb +28 -0
  78. data/lib/fog/brightbox/requests/compute/get_interface.rb +28 -0
  79. data/lib/fog/brightbox/requests/compute/get_server.rb +28 -0
  80. data/lib/fog/brightbox/requests/compute/get_server_type.rb +28 -0
  81. data/lib/fog/brightbox/requests/compute/get_user.rb +28 -0
  82. data/lib/fog/brightbox/requests/compute/get_zone.rb +28 -0
  83. data/lib/fog/brightbox/requests/compute/list_api_clients.rb +27 -0
  84. data/lib/fog/brightbox/requests/compute/list_cloud_ips.rb +27 -0
  85. data/lib/fog/brightbox/requests/compute/list_images.rb +27 -0
  86. data/lib/fog/brightbox/requests/compute/list_server_types.rb +27 -0
  87. data/lib/fog/brightbox/requests/compute/list_servers.rb +27 -0
  88. data/lib/fog/brightbox/requests/compute/list_users.rb +27 -0
  89. data/lib/fog/brightbox/requests/compute/list_zones.rb +27 -0
  90. data/lib/fog/brightbox/requests/compute/map_cloud_ip.rb +28 -0
  91. data/lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb +27 -0
  92. data/lib/fog/brightbox/requests/compute/resize_server.rb +27 -0
  93. data/lib/fog/brightbox/requests/compute/shutdown_server.rb +28 -0
  94. data/lib/fog/brightbox/requests/compute/snapshot_server.rb +28 -0
  95. data/lib/fog/brightbox/requests/compute/start_server.rb +28 -0
  96. data/lib/fog/brightbox/requests/compute/stop_server.rb +28 -0
  97. data/lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb +28 -0
  98. data/lib/fog/brightbox/requests/compute/update_account.rb +28 -0
  99. data/lib/fog/brightbox/requests/compute/update_api_client.rb +29 -0
  100. data/lib/fog/brightbox/requests/compute/update_image.rb +29 -0
  101. data/lib/fog/brightbox/requests/compute/update_server.rb +29 -0
  102. data/lib/fog/brightbox/requests/compute/update_user.rb +29 -0
  103. data/lib/fog/core/attributes.rb +3 -3
  104. data/lib/fog/core/bin.rb +2 -0
  105. data/lib/fog/core/compute.rb +5 -2
  106. data/lib/fog/core/credentials.rb +2 -0
  107. data/lib/fog/core/service.rb +24 -12
  108. data/lib/fog/google/models/storage/file.rb +23 -14
  109. data/lib/fog/google/models/storage/files.rb +4 -14
  110. data/lib/fog/google/requests/storage/get_bucket.rb +0 -1
  111. data/lib/fog/google/requests/storage/put_object.rb +9 -2
  112. data/lib/fog/rackspace/models/storage/file.rb +3 -3
  113. data/lib/fog/rackspace/models/storage/files.rb +5 -13
  114. data/spec/aws/models/compute/server_spec.rb +0 -3
  115. data/spec/aws/requests/simpledb/get_attributes_spec.rb +11 -0
  116. data/spec/core/attributes_spec.rb +52 -0
  117. data/spec/vcloud/bin_spec.rb +1 -1
  118. data/spec/vcloud/vcloud_spec.rb +1 -1
  119. data/tests/aws/models/compute/flavors_tests.rb +5 -0
  120. data/tests/aws/models/compute/server_tests.rb +6 -0
  121. data/tests/aws/models/compute/servers_tests.rb +6 -0
  122. data/tests/aws/requests/storage/bucket_tests.rb +1 -1
  123. data/tests/aws/requests/storage/multipart_upload_tests.rb +135 -0
  124. data/tests/bluebox/models/compute/flavors_tests.rb +5 -0
  125. data/tests/bluebox/models/compute/server_tests.rb +5 -0
  126. data/tests/bluebox/models/compute/servers_tests.rb +6 -0
  127. data/tests/brightbox/helper.rb +0 -0
  128. data/tests/brightbox/models/compute/flavors_tests.rb +5 -0
  129. data/tests/brightbox/models/compute/server_tests.rb +6 -0
  130. data/tests/brightbox/models/compute/servers_tests.rb +6 -0
  131. data/tests/google/requests/storage/bucket_tests.rb +78 -0
  132. data/tests/google/requests/storage/object_tests.rb +81 -0
  133. data/tests/helper.rb +19 -4
  134. data/tests/helpers/collection_tests.rb +51 -0
  135. data/tests/helpers/compute/flavors_tests.rb +34 -0
  136. data/tests/helpers/compute/server_tests.rb +19 -0
  137. data/tests/helpers/compute/servers_tests.rb +11 -0
  138. data/tests/helpers/model_tests.rb +28 -0
  139. data/tests/helpers/storage/directories_tests.rb +4 -36
  140. data/tests/helpers/storage/directory_tests.rb +8 -22
  141. data/tests/helpers/storage/file_tests.rb +8 -25
  142. data/tests/helpers/storage/files_tests.rb +5 -39
  143. data/tests/local/models/storage/directories_tests.rb +1 -1
  144. data/tests/local/models/storage/directory_tests.rb +1 -1
  145. data/tests/local/models/storage/file_tests.rb +1 -1
  146. data/tests/local/models/storage/files_tests.rb +1 -1
  147. data/tests/rackspace/models/compute/flavors_tests.rb +5 -0
  148. data/tests/rackspace/models/compute/server_tests.rb +6 -0
  149. data/tests/rackspace/models/compute/servers_tests.rb +6 -0
  150. data/tests/rackspace/models/storage/directories_tests.rb +1 -1
  151. data/tests/rackspace/models/storage/directory_tests.rb +1 -1
  152. data/tests/rackspace/models/storage/file_tests.rb +1 -1
  153. data/tests/rackspace/models/storage/files_tests.rb +1 -1
  154. data/tests/slicehost/models/compute/flavors_tests.rb +5 -0
  155. data/tests/slicehost/models/compute/server_tests.rb +6 -0
  156. data/tests/slicehost/models/compute/servers_tests.rb +6 -0
  157. metadata +108 -31
  158. data/spec/aws/models/compute/flavors_spec.rb +0 -14
  159. data/spec/aws/models/compute/servers_spec.rb +0 -21
  160. data/spec/bluebox/models/compute/flavors_spec.rb +0 -17
  161. data/spec/bluebox/models/compute/server_spec.rb +0 -29
  162. data/spec/bluebox/models/compute/servers_spec.rb +0 -31
  163. data/spec/google/requests/storage/copy_object_spec.rb +0 -61
  164. data/spec/google/requests/storage/delete_bucket_spec.rb +0 -35
  165. data/spec/google/requests/storage/delete_object_spec.rb +0 -38
  166. data/spec/google/requests/storage/get_bucket_spec.rb +0 -110
  167. data/spec/google/requests/storage/get_object_spec.rb +0 -58
  168. data/spec/google/requests/storage/get_service_spec.rb +0 -32
  169. data/spec/google/requests/storage/head_object_spec.rb +0 -26
  170. data/spec/google/requests/storage/put_bucket_spec.rb +0 -21
  171. data/spec/google/requests/storage/put_object_spec.rb +0 -43
  172. data/spec/rackspace/models/compute/flavors_spec.rb +0 -18
  173. data/spec/rackspace/models/compute/server_spec.rb +0 -55
  174. data/spec/rackspace/models/compute/servers_spec.rb +0 -22
  175. data/spec/shared_examples/flavors_examples.rb +0 -16
  176. data/spec/shared_examples/server_examples.rb +0 -43
  177. data/spec/shared_examples/servers_examples.rb +0 -37
  178. data/spec/slicehost/models/compute/flavors_spec.rb +0 -18
  179. data/spec/slicehost/models/compute/server_spec.rb +0 -55
  180. data/spec/slicehost/models/compute/servers_spec.rb +0 -26
@@ -21,9 +21,17 @@ module Fog
21
21
  # * 'MaxItems'<~Integer> - Maximum number of keys specified for query
22
22
  # * 'NextMarker'<~String> - Marker to specify for next page (id of last result of current page)
23
23
  # * 'DistributionSummary'<~Array>:
24
+ # * 'S3Origin'<~Hash>:
25
+ # * 'DNSName'<~String> - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'
26
+ # * 'OriginAccessIdentity'<~String> - Optional: Used when serving private content
27
+ # or
28
+ # * 'CustomOrigin'<~Hash>:
29
+ # * 'DNSName'<~String> - origin to associate with distribution, ie 'www.example.com'
30
+ # * 'HTTPPort'<~Integer> - HTTP port of origin, in [80, 443] or (1024...65535)
31
+ # * 'HTTPSPort'<~Integer> - HTTPS port of origin, in [80, 443] or (1024...65535)
32
+ # * 'OriginProtocolPolicy'<~String> - Policy on using http vs https, in ['http-only', 'match-viewer']
24
33
  # * 'Comment'<~String> - comment associated with distribution
25
34
  # * 'CNAME'<~Array> - array of associated cnames
26
- # * 'DomainName'<~String> - Domain name of distribution
27
35
  # * 'Enabled'<~Boolean> - whether or not distribution is enabled
28
36
  # * 'Id'<~String> - Id of distribution
29
37
  # * 'LastModifiedTime'<~String> - Timestamp of last modification of distribution
@@ -8,8 +8,18 @@ module Fog
8
8
  # create a new distribution in CloudFront
9
9
  #
10
10
  # ==== Parameters
11
- # * origin<~String> - s3 bucket, ie 'mybucket.s3.amazonaws.com'
12
- # * config<~Hash> - config for distribution. Defaults to {}.
11
+ # * options<~Hash> - config for distribution. Defaults to {}.
12
+ # REQUIRED:
13
+ # * 'S3Origin'<~Hash>:
14
+ # * 'DNSName'<~String> - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'
15
+ # * 'OriginAccessIdentity'<~String> - Optional: Used when serving private content
16
+ # or
17
+ # * 'CustomOrigin'<~Hash>:
18
+ # * 'DNSName'<~String> - origin to associate with distribution, ie 'www.example.com'
19
+ # * 'HTTPPort'<~Integer> - HTTP port of origin, in [80, 443] or (1024...65535)
20
+ # * 'HTTPSPort'<~Integer> - HTTPS port of origin, in [80, 443] or (1024...65535)
21
+ # * 'OriginProtocolPolicy'<~String> - Policy on using http vs https, in ['http-only', 'match-viewer']
22
+ # OPTIONAL:
13
23
  # * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
14
24
  # * 'Comment'<~String> - Optional comment about distribution
15
25
  # * 'CNAME'<~Array> - Optional array of strings to set as CNAMEs
@@ -43,7 +53,8 @@ module Fog
43
53
  # ==== See Also
44
54
  # http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/CreateDistribution.html
45
55
 
46
- def post_distribution(origin, options = {})
56
+ def post_distribution(options = {})
57
+ options['CallerReference'] = Time.now.to_i.to_s
47
58
  data = '<?xml version="1.0" encoding="UTF-8"?>'
48
59
  data << "<DistributionConfig xmlns=\"http://cloudfront.amazonaws.com/doc/#{@version}/\">"
49
60
  for key, value in options
@@ -78,11 +89,11 @@ module Fog
78
89
 
79
90
  class Mock # :nodoc:all
80
91
 
81
- def post_distribution(origin, options = {})
92
+ def post_distribution(options = {})
82
93
  Fog::Mock.not_implemented
83
94
  end
84
95
 
85
96
  end
86
97
  end
87
98
  end
88
- end
99
+ end
@@ -0,0 +1,102 @@
1
+ module Fog
2
+ module AWS
3
+ class CDN
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/cdn/distribution'
7
+
8
+ # update a distribution in CloudFront
9
+ #
10
+ # ==== Parameters
11
+ # * distribution_id<~String> - Id of distribution to update config for
12
+ # * options<~Hash> - config for distribution. Defaults to {}.
13
+ # REQUIRED:
14
+ # * 'S3Origin'<~Hash>:
15
+ # * 'DNSName'<~String> - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'
16
+ # * 'OriginAccessIdentity'<~String> - Optional: Used when serving private content
17
+ # or
18
+ # * 'CustomOrigin'<~Hash>:
19
+ # * 'DNSName'<~String> - origin to associate with distribution, ie 'www.example.com'
20
+ # * 'HTTPPort'<~Integer> - HTTP port of origin, in [80, 443] or (1024...65535)
21
+ # * 'HTTPSPort'<~Integer> - HTTPS port of origin, in [80, 443] or (1024...65535)
22
+ # * 'OriginProtocolPolicy'<~String> - Policy on using http vs https, in ['http-only', 'match-viewer']
23
+ # OPTIONAL:
24
+ # * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
25
+ # * 'Comment'<~String> - Optional comment about distribution
26
+ # * 'CNAME'<~Array> - Optional array of strings to set as CNAMEs
27
+ # * 'DefaultRootObject'<~String> - Optional default object to return for '/'
28
+ # * 'Enabled'<~Boolean> - Whether or not distribution should accept requests, defaults to true
29
+ # * 'Logging'<~Hash>: Optional logging config
30
+ # * 'Bucket'<~String> - Bucket to store logs in, ie 'mylogs.s3.amazonaws.com'
31
+ # * 'Prefix'<~String> - Optional prefix for log filenames, ie 'myprefix/'
32
+ # * 'OriginAccessIdentity'<~String> - Used for serving private content, in format 'origin-access-identity/cloudfront/ID'
33
+ # * 'RequiredProtocols'<~String> - Optional, set to 'https' to force https connections
34
+ # * 'TrustedSigners'<~Array> - Optional grant of rights to up to 5 aws accounts to generate signed URLs for private content, elements are either 'Self' for your own account or an AWS Account Number
35
+ #
36
+ # ==== Returns
37
+ # * response<~Excon::Response>:
38
+ # * body<~Hash>:
39
+ # * 'DomainName'<~String>: Domain name of distribution
40
+ # * 'Id'<~String> - Id of distribution
41
+ # * 'LastModifiedTime'<~String> - Timestamp of last modification of distribution
42
+ # * 'Status'<~String> - Status of distribution
43
+ # * 'DistributionConfig'<~Array>:
44
+ # * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
45
+ # * 'CNAME'<~Array> - array of associated cnames
46
+ # * 'Comment'<~String> - comment associated with distribution
47
+ # * 'Enabled'<~Boolean> - whether or not distribution is enabled
48
+ # * 'Logging'<~Hash>:
49
+ # * 'Bucket'<~String> - bucket logs are stored in
50
+ # * 'Prefix'<~String> - prefix logs are stored with
51
+ # * 'Origin'<~String> - s3 origin bucket
52
+ # * 'TrustedSigners'<~Array> - trusted signers
53
+ #
54
+ # ==== See Also
55
+ # http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/CreateDistribution.html
56
+
57
+ def put_distribution_config(distribution_id, etag, options = {})
58
+ data = '<?xml version="1.0" encoding="UTF-8"?>'
59
+ data << "<DistributionConfig xmlns=\"http://cloudfront.amazonaws.com/doc/#{@version}/\">"
60
+ for key, value in options
61
+ case value
62
+ when Array
63
+ for item in value
64
+ data << "<#{key}>#{item}</#{key}>"
65
+ end
66
+ when Hash
67
+ data << "<#{key}>"
68
+ for inner_key, inner_value in value
69
+ data << "<#{inner_key}>#{inner_value}</#{inner_key}>"
70
+ end
71
+ data << "</#{key}>"
72
+ else
73
+ data << "<#{key}>#{value}</#{key}>"
74
+ end
75
+ end
76
+ data << "</DistributionConfig>"
77
+ request({
78
+ :body => data,
79
+ :expects => 200,
80
+ :headers => {
81
+ 'Content-Type' => 'text/xml',
82
+ 'If-Match' => etag
83
+ },
84
+ :idempotent => true,
85
+ :method => 'PUT',
86
+ :parser => Fog::Parsers::AWS::CDN::Distribution.new,
87
+ :path => "/distribution/#{distribution_id}/config"
88
+ })
89
+ end
90
+
91
+ end
92
+
93
+ class Mock # :nodoc:all
94
+
95
+ def put_distribution_config(distribution_id, etag, options = {})
96
+ Fog::Mock.not_implemented
97
+ end
98
+
99
+ end
100
+ end
101
+ end
102
+ end
@@ -22,6 +22,7 @@ module Fog
22
22
  # * 'volumeId'<~String> - Reference to volume
23
23
  # * 'attachmentSet'<~Array>:
24
24
  # * 'attachmentTime'<~Time> - Timestamp for attachment
25
+ # * 'deleteOnTermination'<~Boolean> - Whether or not to delete volume on instance termination
25
26
  # * 'device'<~String> - How value is exposed to instance
26
27
  # * 'instanceId'<~String> - Reference to attached instance
27
28
  # * 'status'<~String> - Attachment state
@@ -28,7 +28,7 @@ module Fog
28
28
  # * 'Ebs.DeleteOnTermination'<~String> - specifies whether or not to delete the volume on instance termination
29
29
  # * 'ClientToken'<~String> - unique case-sensitive token for ensuring idempotency
30
30
  # * 'SecurityGroup'<~Array> or <~String> - Name of security group(s) for instances (you must omit this parameter if using Virtual Private Clouds)
31
- # * 'InstanceInitiatedShutdownBehaviour'<~String> - specifies whether volumes are stopped or terminated when instance is shutdown
31
+ # * 'InstanceInitiatedShutdownBehaviour'<~String> - specifies whether volumes are stopped or terminated when instance is shutdown, in [stop, terminate]
32
32
  # * 'InstanceType'<~String> - Type of instance to boot. Valid options
33
33
  # in ['m1.small', 'm1.large', 'm1.xlarge', 'c1.medium', 'c1.xlarge', 'm2.2xlarge', 'm2.4xlarge']
34
34
  # default is 'm1.small'
@@ -0,0 +1,42 @@
1
+ module Fog
2
+ module AWS
3
+ class IAM
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/iam/basic'
7
+
8
+ # Add a user to a group
9
+ #
10
+ # ==== Parameters
11
+ # * group_name<~String>: name of the group
12
+ # * user_name<~String>: name of user to add
13
+ #
14
+ # ==== Returns
15
+ # * response<~Excon::Response>:
16
+ # * body<~Hash>:
17
+ # * 'RequestId'<~String> - Id of the request
18
+ #
19
+ # ==== See Also
20
+ # http://docs.amazonwebservices.com/IAM/latest/APIReference/API_AddUserToGroup.html
21
+ #
22
+ def add_user_to_group(group_name, user_name)
23
+ request(
24
+ 'Action' => 'AddUserToGroup',
25
+ 'GroupName' => group_name,
26
+ 'UserName' => user_name,
27
+ :parser => Fog::Parsers::AWS::IAM::Basic.new
28
+ )
29
+ end
30
+
31
+ end
32
+
33
+ class Mock
34
+
35
+ def add_user_to_group(group_name, user_name)
36
+ Fog::Mock.not_implemented
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+ end
@@ -8,8 +8,8 @@ module Fog
8
8
  # Create a new group
9
9
  #
10
10
  # ==== Parameters
11
- # * 'GroupName'<~String>: name of the group to create (do not include path)
12
- # * 'Path'<~String>: optional path to group, defaults to '/'
11
+ # * group_name<~String>: name of the group to create (do not include path)
12
+ # * path<~String>: optional path to group, defaults to '/'
13
13
  #
14
14
  # ==== Returns
15
15
  # * response<~Excon::Response>:
@@ -20,12 +20,16 @@ module Fog
20
20
  # * GroupName<~String> -
21
21
  # * Path<~String> -
22
22
  # * 'RequestId'<~String> - Id of the request
23
+ #
24
+ # ==== See Also
25
+ # http://docs.amazonwebservices.com/IAM/latest/APIReference/API_CreateGroup.html
26
+ #
23
27
  def create_group(group_name, path = '/')
24
28
  request(
25
29
  'Action' => 'CreateGroup',
26
30
  'GroupName' => group_name,
27
31
  'Path' => path,
28
- :parser => Fog::Parsers::AWS::IAM::CreateGroups.new
32
+ :parser => Fog::Parsers::AWS::IAM::CreateGroup.new
29
33
  )
30
34
  end
31
35
 
@@ -0,0 +1,47 @@
1
+ module Fog
2
+ module AWS
3
+ class IAM
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/iam/create_user'
7
+
8
+ # Create a new user
9
+ #
10
+ # ==== Parameters
11
+ # * user_name<~String>: name of the user to create (do not include path)
12
+ # * path<~String>: optional path to group, defaults to '/'
13
+ #
14
+ # ==== Returns
15
+ # * response<~Excon::Response>:
16
+ # * body<~Hash>:
17
+ # * 'User'<~Hash>:
18
+ # * Arn<~String> -
19
+ # * GroupId<~String> -
20
+ # * GroupName<~String> -
21
+ # * Path<~String> -
22
+ # * 'RequestId'<~String> - Id of the request
23
+ #
24
+ # ==== See Also
25
+ # http://docs.amazonwebservices.com/IAM/latest/APIReference/API_CreateUser.html
26
+ #
27
+ def create_user(user_name, path = '/')
28
+ request(
29
+ 'Action' => 'CreateUser',
30
+ 'UserName' => user_name,
31
+ 'Path' => path,
32
+ :parser => Fog::Parsers::AWS::IAM::CreateUser.new
33
+ )
34
+ end
35
+
36
+ end
37
+
38
+ class Mock
39
+
40
+ def create_user(user_name, path = '/')
41
+ Fog::Mock.not_implemented
42
+ end
43
+
44
+ end
45
+ end
46
+ end
47
+ end
@@ -8,12 +8,16 @@ module Fog
8
8
  # Delete a group
9
9
  #
10
10
  # ==== Parameters
11
- # * 'GroupName'<~String>: name of the group to delete
11
+ # * group_name<~String>: name of the group to delete
12
12
  #
13
13
  # ==== Returns
14
14
  # * response<~Excon::Response>:
15
15
  # * body<~Hash>:
16
16
  # * 'RequestId'<~String> - Id of the request
17
+ #
18
+ # ==== See Also
19
+ # http://docs.amazonwebservices.com/IAM/latest/APIReference/API_DeleteGroup.html
20
+ #
17
21
  def delete_group(group_name)
18
22
  request(
19
23
  'Action' => 'DeleteGroup',
@@ -0,0 +1,42 @@
1
+ module Fog
2
+ module AWS
3
+ class IAM
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/iam/basic'
7
+
8
+ # Remove a policy from a group
9
+ #
10
+ # ==== Parameters
11
+ # * group_name<~String>: name of the group
12
+ # * policy_name<~String>: name of policy document
13
+ #
14
+ # ==== Returns
15
+ # * response<~Excon::Response>:
16
+ # * body<~Hash>:
17
+ # * 'RequestId'<~String> - Id of the request def put_group_policy(group_name, path = '/')
18
+ #
19
+ # ==== See Also
20
+ # http://docs.amazonwebservices.com/IAM/latest/APIReference/API_DeleteGroupPolicy.html
21
+ #
22
+ def delete_group_policy(group_name, policy_name)
23
+ request(
24
+ 'Action' => 'DeleteGroupPolicy',
25
+ 'GroupName' => group_name,
26
+ 'PolicyName' => policy_name,
27
+ :parser => Fog::Parsers::AWS::IAM::Basic.new
28
+ )
29
+ end
30
+
31
+ end
32
+
33
+ class Mock
34
+
35
+ def delete_group_policy(group_name, policy_name)
36
+ Fog::Mock.not_implemented
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,40 @@
1
+ module Fog
2
+ module AWS
3
+ class IAM
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/iam/basic'
7
+
8
+ # Delete a user
9
+ #
10
+ # ==== Parameters
11
+ # * user_name<~String>: name of the user to delete
12
+ #
13
+ # ==== Returns
14
+ # * response<~Excon::Response>:
15
+ # * body<~Hash>:
16
+ # * 'RequestId'<~String> - Id of the request
17
+ #
18
+ # ==== See Also
19
+ # http://docs.amazonwebservices.com/IAM/latest/APIReference/API_DeleteUser.html
20
+ #
21
+ def delete_user(user_name)
22
+ request(
23
+ 'Action' => 'DeleteUser',
24
+ 'UserName' => user_name,
25
+ :parser => Fog::Parsers::AWS::IAM::Basic.new
26
+ )
27
+ end
28
+
29
+ end
30
+
31
+ class Mock
32
+
33
+ def delete_user(user_name)
34
+ Fog::Mock.not_implemented
35
+ end
36
+
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,47 @@
1
+ module Fog
2
+ module AWS
3
+ class IAM
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/iam/list_group_policies'
7
+
8
+ # List policies for a group
9
+ #
10
+ # ==== Parameters
11
+ # * group_name<~String> - Name of group to list policies for
12
+ # * options<~Hash>: Optional
13
+ # * 'Marker'<~String>: used to paginate subsequent requests
14
+ # * 'MaxItems'<~Integer>: limit results to this number per page
15
+ # * 'PathPrefix'<~String>: prefix for filtering results
16
+ #
17
+ # ==== Returns
18
+ # * response<~Excon::Response>:
19
+ # * body<~Hash>:
20
+ # * 'PolicyNames'<~Array> - Matching policy names
21
+ # * 'IsTruncated<~Boolean> - Whether or not results were truncated
22
+ # * 'Marker'<~String> - appears when IsTruncated is true as the next marker to use
23
+ # * 'RequestId'<~String> - Id of the request
24
+ #
25
+ # ==== See Also
26
+ # http://docs.amazonwebservices.com/IAM/latest/APIReference/API_ListGroupPolicies.html
27
+ #
28
+ def list_group_policies(group_name, options = {})
29
+ request({
30
+ 'Action' => 'ListGroupPolicies',
31
+ 'GroupName' => group_name,
32
+ :parser => Fog::Parsers::AWS::IAM::ListGroupPolicies.new
33
+ }.merge!(options))
34
+ end
35
+
36
+ end
37
+
38
+ class Mock
39
+
40
+ def list_group_policies(group_name, options = {})
41
+ Fog::Mock.not_implemented
42
+ end
43
+
44
+ end
45
+ end
46
+ end
47
+ end