Class: Fog::AWS::IAM::Real
- Inherits:
-
Object
- Object
- Fog::AWS::IAM::Real
- Defined in:
- lib/fog/aws/iam.rb,
lib/fog/aws/requests/iam/get_user.rb,
lib/fog/aws/requests/iam/get_group.rb,
lib/fog/aws/requests/iam/list_users.rb,
lib/fog/aws/requests/iam/create_user.rb,
lib/fog/aws/requests/iam/delete_user.rb,
lib/fog/aws/requests/iam/list_groups.rb,
lib/fog/aws/requests/iam/update_user.rb,
lib/fog/aws/requests/iam/create_group.rb,
lib/fog/aws/requests/iam/delete_group.rb,
lib/fog/aws/requests/iam/update_group.rb,
lib/fog/aws/requests/iam/get_user_policy.rb,
lib/fog/aws/requests/iam/put_user_policy.rb,
lib/fog/aws/requests/iam/list_access_keys.rb,
lib/fog/aws/requests/iam/put_group_policy.rb,
lib/fog/aws/requests/iam/add_user_to_group.rb,
lib/fog/aws/requests/iam/create_access_key.rb,
lib/fog/aws/requests/iam/delete_access_key.rb,
lib/fog/aws/requests/iam/update_access_key.rb,
lib/fog/aws/requests/iam/delete_user_policy.rb,
lib/fog/aws/requests/iam/list_user_policies.rb,
lib/fog/aws/requests/iam/delete_group_policy.rb,
lib/fog/aws/requests/iam/list_group_policies.rb,
lib/fog/aws/requests/iam/list_groups_for_user.rb,
lib/fog/aws/requests/iam/remove_user_from_group.rb,
lib/fog/aws/requests/iam/list_signing_certificates.rb,
lib/fog/aws/requests/iam/delete_signing_certificate.rb,
lib/fog/aws/requests/iam/update_signing_certificate.rb,
lib/fog/aws/requests/iam/upload_signing_certificate.rb
Instance Method Summary collapse
-
#add_user_to_group(group_name, user_name) ⇒ Object
Add a user to a group.
-
#create_access_key(options = {}) ⇒ Object
Create a access keys for user (by default detects user from access credentials).
-
#create_group(group_name, path = '/') ⇒ Object
Create a new group.
-
#create_user(user_name, path = '/') ⇒ Object
Create a new user.
-
#delete_access_key(access_key_id, options = {}) ⇒ Object
Delete an access key.
-
#delete_group(group_name) ⇒ Object
Delete a group.
-
#delete_group_policy(group_name, policy_name) ⇒ Object
Remove a policy from a group.
-
#delete_signing_certificate(certificate_id, options = {}) ⇒ Object
Upload signing certificate for user (by default detects user from access credentials).
-
#delete_user(user_name) ⇒ Object
Delete a user.
-
#delete_user_policy(user_name, policy_name) ⇒ Object
Remove a policy from a user.
-
#get_group(group_name, options = {}) ⇒ Object
Get Group.
-
#get_user(options = {}) ⇒ Object
Get User.
-
#get_user_policy(policy_name, user_name) ⇒ Object
Get User Policy.
-
#initialize(options = {}) ⇒ Real
constructor
Initialize connection to IAM.
-
#list_access_keys(options = {}) ⇒ Object
List access_keys.
-
#list_group_policies(group_name, options = {}) ⇒ Object
List policies for a group.
-
#list_groups(options = {}) ⇒ Object
List groups.
-
#list_groups_for_user(user_name, options = {}) ⇒ Object
List groups_for_user.
-
#list_signing_certificates(options = {}) ⇒ Object
List signing certificates for user (by default detects user from access credentials).
-
#list_user_policies(user_name, options = {}) ⇒ Object
List policies for a user.
-
#list_users(options = {}) ⇒ Object
List users.
-
#put_group_policy(group_name, policy_name, policy_document) ⇒ Object
Add or update a policy for a group.
-
#put_user_policy(user_name, policy_name, policy_document) ⇒ Object
Add or update a policy for a user.
- #reload ⇒ Object
-
#remove_user_from_group(group_name, user_name) ⇒ Object
Remove a user from a group.
-
#update_access_key(access_key_id, status, options = {}) ⇒ Object
Update an access key for a user.
-
#update_group(group_name, options = {}) ⇒ Object
Update a Group.
-
#update_signing_certificate(certificate_id, status, options = {}) ⇒ Object
Update a Signing Certificate.
-
#update_user(user_name, options = {}) ⇒ Object
Update a user.
-
#upload_signing_certificate(certificate, options = {}) ⇒ Object
Upload signing certificate for user (by default detects user from access credentials).
Constructor Details
#initialize(options = {}) ⇒ Real
Initialize connection to IAM
Notes
options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection
Examples
iam = IAM.new(
:aws_access_key_id => your_aws_access_key_id,
:aws_secret_access_key => your_aws_secret_access_key
)
Parameters
-
options<~Hash> - config arguments for connection. Defaults to {}.
Returns
-
IAM object with connection to AWS.
64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/fog/aws/iam.rb', line 64 def initialize(={}) require 'fog/core/parser' require 'json' @aws_access_key_id = [:aws_access_key_id] @aws_secret_access_key = [:aws_secret_access_key] @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @host = [:host] || 'iam.amazonaws.com' @path = [:path] || '/' @port = [:port] || 443 @scheme = [:scheme] || 'https' @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", [:persistent]) end |
Instance Method Details
#add_user_to_group(group_name, user_name) ⇒ Object
Add a user to a group
Parameters
-
group_name<~String>: name of the group
-
user_name<~String>: name of user to add
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_AddUserToGroup.html
22 23 24 25 26 27 28 29 |
# File 'lib/fog/aws/requests/iam/add_user_to_group.rb', line 22 def add_user_to_group(group_name, user_name) request( 'Action' => 'AddUserToGroup', 'GroupName' => group_name, 'UserName' => user_name, :parser => Fog::Parsers::AWS::IAM::Basic.new ) end |
#create_access_key(options = {}) ⇒ Object
Create a access keys for user (by default detects user from access credentials)
Parameters
-
options<~Hash>:
-
‘UserName’<~String> - name of the user to create (do not include path)
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘AccessKey’<~Hash>:
-
‘AccessKeyId’<~String> -
-
‘UserName’<~String> -
-
‘SecretAccessKey’<~String> -
-
‘Status’<~String> -
-
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_CreateAccessKey.html
27 28 29 30 31 32 |
# File 'lib/fog/aws/requests/iam/create_access_key.rb', line 27 def create_access_key( = {}) request({ 'Action' => 'CreateAccessKey', :parser => Fog::Parsers::AWS::IAM::CreateAccessKey.new }.merge!()) end |
#create_group(group_name, path = '/') ⇒ Object
Create a new group
Parameters
-
group_name<~String>: name of the group to create (do not include path)
-
path<~String>: optional path to group, defaults to ‘/’
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘Group’<~Hash>:
-
Arn<~String> -
-
GroupId<~String> -
-
GroupName<~String> -
-
Path<~String> -
-
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_CreateGroup.html
27 28 29 30 31 32 33 34 |
# File 'lib/fog/aws/requests/iam/create_group.rb', line 27 def create_group(group_name, path = '/') request( 'Action' => 'CreateGroup', 'GroupName' => group_name, 'Path' => path, :parser => Fog::Parsers::AWS::IAM::CreateGroup.new ) end |
#create_user(user_name, path = '/') ⇒ Object
Create a new user
Parameters
-
user_name<~String>: name of the user to create (do not include path)
-
path<~String>: optional path to group, defaults to ‘/’
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘User’<~Hash>:
-
‘Arn’<~String> -
-
‘Path’<~String> -
-
‘UserId’<~String> -
-
‘UserName’<~String> -
-
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_CreateUser.html
27 28 29 30 31 32 33 34 |
# File 'lib/fog/aws/requests/iam/create_user.rb', line 27 def create_user(user_name, path = '/') request( 'Action' => 'CreateUser', 'UserName' => user_name, 'Path' => path, :parser => Fog::Parsers::AWS::IAM::CreateUser.new ) end |
#delete_access_key(access_key_id, options = {}) ⇒ Object
Delete an access key
Parameters
-
access_key_id<~String> - Access key id to delete
-
options<~Hash>:
-
‘UserName’<~String> - name of the user to create (do not include path)
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_DeleteAccessKey.html
23 24 25 26 27 28 29 |
# File 'lib/fog/aws/requests/iam/delete_access_key.rb', line 23 def delete_access_key(access_key_id, = {}) request({ 'AccessKeyId' => access_key_id, 'Action' => 'DeleteAccessKey', :parser => Fog::Parsers::AWS::IAM::Basic.new }.merge!()) end |
#delete_group(group_name) ⇒ Object
Delete a group
Parameters
-
group_name<~String>: name of the group to delete
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_DeleteGroup.html
21 22 23 24 25 26 27 |
# File 'lib/fog/aws/requests/iam/delete_group.rb', line 21 def delete_group(group_name) request( 'Action' => 'DeleteGroup', 'GroupName' => group_name, :parser => Fog::Parsers::AWS::IAM::Basic.new ) end |
#delete_group_policy(group_name, policy_name) ⇒ Object
Remove a policy from a group
Parameters
-
group_name<~String>: name of the group
-
policy_name<~String>: name of policy document
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_DeleteGroupPolicy.html
22 23 24 25 26 27 28 29 |
# File 'lib/fog/aws/requests/iam/delete_group_policy.rb', line 22 def delete_group_policy(group_name, policy_name) request( 'Action' => 'DeleteGroupPolicy', 'GroupName' => group_name, 'PolicyName' => policy_name, :parser => Fog::Parsers::AWS::IAM::Basic.new ) end |
#delete_signing_certificate(certificate_id, options = {}) ⇒ Object
Upload signing certificate for user (by default detects user from access credentials)
Parameters
-
options<~Hash>:
-
‘UserName’<~String> - name of the user to upload certificate for (do not include path)
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_DeleteSigningCertificate.html
22 23 24 25 26 27 28 |
# File 'lib/fog/aws/requests/iam/delete_signing_certificate.rb', line 22 def delete_signing_certificate(certificate_id, = {}) request({ 'Action' => 'DeleteSigningCertificate', 'CertificateId' => certificate_id, :parser => Fog::Parsers::AWS::IAM::Basic.new }.merge!()) end |
#delete_user(user_name) ⇒ Object
Delete a user
Parameters
-
user_name<~String>: name of the user to delete
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_DeleteUser.html
21 22 23 24 25 26 27 |
# File 'lib/fog/aws/requests/iam/delete_user.rb', line 21 def delete_user(user_name) request( 'Action' => 'DeleteUser', 'UserName' => user_name, :parser => Fog::Parsers::AWS::IAM::Basic.new ) end |
#delete_user_policy(user_name, policy_name) ⇒ Object
Remove a policy from a user
Parameters
-
user_name<~String>: name of the user
-
policy_name<~String>: name of policy document
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_DeleteUserPolicy.html
22 23 24 25 26 27 28 29 |
# File 'lib/fog/aws/requests/iam/delete_user_policy.rb', line 22 def delete_user_policy(user_name, policy_name) request( 'Action' => 'DeleteUserPolicy', 'PolicyName' => policy_name, 'UserName' => user_name, :parser => Fog::Parsers::AWS::IAM::Basic.new ) end |
#get_group(group_name, options = {}) ⇒ Object
Get Group
Parameters
-
‘GroupName’<~String>: Name of the Group
-
options<~Hash>:
-
‘Marker’<~String>: Use this only when paginating results, and only in a subsequent request after you’ve received a response where the results are truncated. Set it to the value of the Marker element in the response you just received.
-
‘MaxItems’<~String>: Use this only when paginating results to indicate the maximum number of User names you want in the response. If there are additional User names beyond the maximum you specify, the IsTruncated response element is true.
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘Group’<~Hash> - Group
-
‘Path’<~String>
-
‘GroupName’<~String>
-
‘Arn’<~String>
-
-
‘Users’<~Hash>? - List of users belonging to the group.
-
‘User’<~Hash> - User
-
Arn<~String> -
-
UserId<~String> -
-
UserName<~String> -
-
Path<~String> -
-
-
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_GetGroup.html
33 34 35 36 37 38 39 |
# File 'lib/fog/aws/requests/iam/get_group.rb', line 33 def get_group(group_name, = {}) request({ 'Action' => 'GetGroup', 'GroupName' => group_name, :parser => Fog::Parsers::AWS::IAM::GetGroup.new }.merge!()) end |
#get_user(options = {}) ⇒ Object
Get User
Parameters
-
options<~Hash>:
-
‘UserName’<~String>: Name of the User. Defaults to current user
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘User’<~Hash> - User
-
Arn<~String> -
-
UserId<~String> -
-
UserName<~String> -
-
Path<~String> -
-
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_Getuser.html
26 27 28 29 30 31 |
# File 'lib/fog/aws/requests/iam/get_user.rb', line 26 def get_user( = {}) request({ 'Action' => 'GetUser', :parser => Fog::Parsers::AWS::IAM::GetUser.new }.merge!()) end |
#get_user_policy(policy_name, user_name) ⇒ Object
Get User Policy
Parameters
-
‘PolicyName’<~String>: Name of the policy to get
-
‘UserName’<~String>: Name of the User who the policy is associated with.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
* PolicyDocument<~String> The policy document. * PolicyName<~String> The name of the policy. * UserName<~String> The User the policy is associated with.
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_GetUserPolicy.html
24 25 26 27 28 29 30 31 |
# File 'lib/fog/aws/requests/iam/get_user_policy.rb', line 24 def get_user_policy(policy_name, user_name) request({ 'Action' => 'GetUserPolicy', 'PolicyName' => policy_name, 'UserName' => user_name, :parser => Fog::Parsers::AWS::IAM::GetUserPolicy.new }) end |
#list_access_keys(options = {}) ⇒ Object
List access_keys
Parameters
-
options<~Hash>:
-
‘Marker’<~String> - used to paginate subsequent requests
-
‘MaxItems’<~Integer> - limit results to this number per page
-
‘UserName’<~String> - optional: username to lookup access keys for, defaults to current user
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘AccessKeys’<~Array> - Matching access keys
-
access_key<~Hash>:
-
AccessKeyId<~String> -
-
Status<~String> -
-
-
-
‘IsTruncated<~Boolean> - Whether or not results were truncated
-
‘Marker’<~String> - appears when IsTruncated is true as the next marker to use
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_ListAccessKeys.html
30 31 32 33 34 35 |
# File 'lib/fog/aws/requests/iam/list_access_keys.rb', line 30 def list_access_keys( = {}) request({ 'Action' => 'ListAccessKeys', :parser => Fog::Parsers::AWS::IAM::ListAccessKeys.new }.merge!()) end |
#list_group_policies(group_name, options = {}) ⇒ Object
List policies for a group
Parameters
-
group_name<~String> - Name of group to list policies for
-
options<~Hash>: Optional
-
‘Marker’<~String>: used to paginate subsequent requests
-
‘MaxItems’<~Integer>: limit results to this number per page
-
‘PathPrefix’<~String>: prefix for filtering results
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘PolicyNames’<~Array> - Matching policy names
-
‘IsTruncated<~Boolean> - Whether or not results were truncated
-
‘Marker’<~String> - appears when IsTruncated is true as the next marker to use
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_ListGroupPolicies.html
28 29 30 31 32 33 34 |
# File 'lib/fog/aws/requests/iam/list_group_policies.rb', line 28 def list_group_policies(group_name, = {}) request({ 'Action' => 'ListGroupPolicies', 'GroupName' => group_name, :parser => Fog::Parsers::AWS::IAM::ListPolicies.new }.merge!()) end |
#list_groups(options = {}) ⇒ Object
List groups
Parameters
-
options<~Hash>:
-
‘Marker’<~String>: used to paginate subsequent requests
-
‘MaxItems’<~Integer>: limit results to this number per page
-
‘PathPrefix’<~String>: prefix for filtering results
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘Groups’<~Array> - Matching groups
-
group<~Hash>:
-
Arn<~String> -
-
GroupId<~String> -
-
GroupName<~String> -
-
Path<~String> -
-
-
-
‘IsTruncated<~Boolean> - Whether or not results were truncated
-
‘Marker’<~String> - appears when IsTruncated is true as the next marker to use
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_ListGroups.html
32 33 34 35 36 37 |
# File 'lib/fog/aws/requests/iam/list_groups.rb', line 32 def list_groups( = {}) request({ 'Action' => 'ListGroups', :parser => Fog::Parsers::AWS::IAM::ListGroups.new }.merge!()) end |
#list_groups_for_user(user_name, options = {}) ⇒ Object
List groups_for_user
Parameters
-
user_name<~String> - the username you want to look up group membership for
-
options<~Hash>:
-
‘Marker’<~String> - used to paginate subsequent requests
-
‘MaxItems’<~Integer> - limit results to this number per page
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘GroupsForUser’<~Array> - Groups for a user
-
group_for_user<~Hash>:
-
‘Arn’ -
-
‘GroupId’ -
-
‘GroupName’ -
-
‘Path’ -
-
-
-
‘IsTruncated’<~Boolean> - Whether or not results were truncated
-
‘Marker’<~String> - appears when IsTruncated is true as the next marker to use
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_ListGroupsForUser.html
32 33 34 35 36 37 38 |
# File 'lib/fog/aws/requests/iam/list_groups_for_user.rb', line 32 def list_groups_for_user(user_name, = {}) request({ 'Action' => 'ListGroupsForUser', 'UserName' => user_name, :parser => Fog::Parsers::AWS::IAM::ListGroupsForUser.new }.merge!()) end |
#list_signing_certificates(options = {}) ⇒ Object
List signing certificates for user (by default detects user from access credentials)
Parameters
-
options<~Hash>:
-
‘UserName’<~String> - name of the user to list certificates for (do not include path)
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘SigningCertificates’<~Array> - Matching signing certificates
-
signing_certificate<~Hash>:
-
CertificateId<~String> -
-
Status<~String> -
-
-
‘IsTruncated’<~Boolean> - Whether or not the results were truncated
-
‘Marker’<~String> - appears when IsTruncated is true as the next marker to use
-
‘RequestId’<~String> - Id of the request
-
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_ListSigningCertificates.html
28 29 30 31 32 33 |
# File 'lib/fog/aws/requests/iam/list_signing_certificates.rb', line 28 def list_signing_certificates( = {}) request({ 'Action' => 'ListSigningCertificates', :parser => Fog::Parsers::AWS::IAM::ListSigningCertificates.new }.merge!()) end |
#list_user_policies(user_name, options = {}) ⇒ Object
List policies for a user
Parameters
-
user_name<~String> - Name of user to list policies for
-
options<~Hash>: Optional
-
‘Marker’<~String>: used to paginate subsequent requests
-
‘MaxItems’<~Integer>: limit results to this number per page
-
‘PathPrefix’<~String>: prefix for filtering results
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘PolicyNames’<~Array> - Matching policy names
-
‘IsTruncated<~Boolean> - Whether or not results were truncated
-
‘Marker’<~String> - appears when IsTruncated is true as the next marker to use
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_ListUserPolicies.html
28 29 30 31 32 33 34 |
# File 'lib/fog/aws/requests/iam/list_user_policies.rb', line 28 def list_user_policies(user_name, = {}) request({ 'Action' => 'ListUserPolicies', 'UserName' => user_name, :parser => Fog::Parsers::AWS::IAM::ListPolicies.new }.merge!()) end |
#list_users(options = {}) ⇒ Object
List users
Parameters
-
options<~Hash>:
-
‘Marker’<~String>: used to paginate subsequent requests
-
‘MaxItems’<~Integer>: limit results to this number per page
-
‘PathPrefix’<~String>: prefix for filtering results
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘Users’<~Array> - Matching groups
-
user<~Hash>:
-
Arn<~String> -
-
Path<~String> -
-
UserId<~String> -
-
UserName<~String> -
-
-
-
‘IsTruncated<~Boolean> - Whether or not results were truncated
-
‘Marker’<~String> - appears when IsTruncated is true as the next marker to use
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_ListUsers.html
32 33 34 35 36 37 |
# File 'lib/fog/aws/requests/iam/list_users.rb', line 32 def list_users( = {}) request({ 'Action' => 'ListUsers', :parser => Fog::Parsers::AWS::IAM::ListUsers.new }.merge!()) end |
#put_group_policy(group_name, policy_name, policy_document) ⇒ Object
Add or update a policy for a group
Parameters
-
group_name<~String>: name of the group
-
policy_name<~String>: name of policy document
-
policy_document<~Hash>: policy document, see: docs.amazonwebservices.com/IAM/latest/UserGuide/PoliciesOverview.html
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_PutGroupPolicy.html
23 24 25 26 27 28 29 30 31 |
# File 'lib/fog/aws/requests/iam/put_group_policy.rb', line 23 def put_group_policy(group_name, policy_name, policy_document) request( 'Action' => 'PutGroupPolicy', 'GroupName' => group_name, 'PolicyName' => policy_name, 'PolicyDocument' => policy_document.to_json, :parser => Fog::Parsers::AWS::IAM::Basic.new ) end |
#put_user_policy(user_name, policy_name, policy_document) ⇒ Object
Add or update a policy for a user
Parameters
-
user_name<~String>: name of the user
-
policy_name<~String>: name of policy document
-
policy_document<~Hash>: policy document, see: docs.amazonwebservices.com/IAM/latest/UserGuide/PoliciesOverview.html
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_PutUserPolicy.html
23 24 25 26 27 28 29 30 31 |
# File 'lib/fog/aws/requests/iam/put_user_policy.rb', line 23 def put_user_policy(user_name, policy_name, policy_document) request( 'Action' => 'PutUserPolicy', 'PolicyName' => policy_name, 'PolicyDocument' => policy_document.to_json, 'UserName' => user_name, :parser => Fog::Parsers::AWS::IAM::Basic.new ) end |
#reload ⇒ Object
78 79 80 |
# File 'lib/fog/aws/iam.rb', line 78 def reload @connection.reset end |
#remove_user_from_group(group_name, user_name) ⇒ Object
Remove a user from a group
Parameters
-
group_name<~String>: name of the group
-
user_name<~String>: name of user to remove
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_RemoveUserFromGroup.html
22 23 24 25 26 27 28 29 |
# File 'lib/fog/aws/requests/iam/remove_user_from_group.rb', line 22 def remove_user_from_group(group_name, user_name) request( 'Action' => 'RemoveUserFromGroup', 'GroupName' => group_name, 'UserName' => user_name, :parser => Fog::Parsers::AWS::IAM::Basic.new ) end |
#update_access_key(access_key_id, status, options = {}) ⇒ Object
Update an access key for a user
Parameters
-
access_key_id<~String> - Access key id to delete
-
status<~String> - status of keys in [‘Active’, ‘Inactive’]
-
options<~Hash>:
-
‘UserName’<~String> - name of the user to create (do not include path)
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/API_UpdateAccessKey.html
24 25 26 27 28 29 30 31 |
# File 'lib/fog/aws/requests/iam/update_access_key.rb', line 24 def update_access_key(access_key_id, status, = {}) request({ 'AccessKeyId' => access_key_id, 'Action' => 'UpdateAccessKey', 'Status' => status, :parser => Fog::Parsers::AWS::IAM::Basic.new }.merge!()) end |
#update_group(group_name, options = {}) ⇒ Object
Update a Group
Parameters
-
group_name<~String> - Required. Name of the Group to update. If you’re changing the name of the Group, this is the original Group name.
-
options<~Hash>:
-
new_path<~String> - New path for the Group. Include this parameter only if you’re changing the Group’s path.
-
new_group_name<~String> - New name for the Group. Include this parameter only if you’re changing the Group’s name.
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
‘Group’<~Hash> - Changed Group info
-
‘Arn’<~String> -
-
‘Path’<~String> -
-
‘GroupId’<~String> -
-
‘GroupName’<~String> -
-
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_UpdateGroup.html
28 29 30 31 32 33 34 |
# File 'lib/fog/aws/requests/iam/update_group.rb', line 28 def update_group(group_name, = {}) request({ 'Action' => 'UpdateGroup', 'GroupName' => group_name, :parser => Fog::Parsers::AWS::IAM::UpdateGroup.new }.merge!()) end |
#update_signing_certificate(certificate_id, status, options = {}) ⇒ Object
Update a Signing Certificate
Parameters
-
certificate_id<~String> - Required. ID of the Certificate to update.
-
status<~String> - Required. Active/Inactive
-
options<~Hash>:
-
user_name<~String> - Name of the user the signing certificate belongs to.
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_UpdateSigningCertificate.html
20 21 22 23 24 25 26 27 |
# File 'lib/fog/aws/requests/iam/update_signing_certificate.rb', line 20 def update_signing_certificate(certificate_id, status, = {}) request({ 'Action' => 'UpdateSigningCertificate', 'CertificateId' => certificate_id, 'Status' => status, :parser => Fog::Parsers::AWS::IAM::Basic.new }.merge!()) end |
#update_user(user_name, options = {}) ⇒ Object
Update a user
Parameters
-
user_name<~String> - Required. Name of the User to update. If you’re changing the name of the User, this is the original User name.
-
options<~Hash>:
-
new_path<~String> - New path for the User. Include this parameter only if you’re changing the User’s path.
-
new_user_name<~String> - New name for the User. Include this parameter only if you’re changing the User’s name.
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘RequestId’<~String> - Id of the request
-
‘User’<~Hash> - Changed user info
-
‘Arn’<~String> -
-
‘Path’<~String> -
-
‘UserId’<~String> -
-
‘UserName’<~String> -
-
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_UpdateUser.html
28 29 30 31 32 33 34 |
# File 'lib/fog/aws/requests/iam/update_user.rb', line 28 def update_user(user_name, = {}) request({ 'Action' => 'UpdateUser', 'UserName' => user_name, :parser => Fog::Parsers::AWS::IAM::UpdateUser.new }.merge!()) end |
#upload_signing_certificate(certificate, options = {}) ⇒ Object
Upload signing certificate for user (by default detects user from access credentials)
Parameters
-
options<~Hash>:
-
‘UserName’<~String> - name of the user to upload certificate for (do not include path)
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘Certificate’<~Hash>:
-
‘CertificateId’<~String> -
-
‘UserName’<~String> -
-
‘CertificateBody’<~String> -
-
‘Status’<~String> -
-
-
‘RequestId’<~String> - Id of the request
-
-
See Also
docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_UploadSigningCertificate.html
27 28 29 30 31 32 33 |
# File 'lib/fog/aws/requests/iam/upload_signing_certificate.rb', line 27 def upload_signing_certificate(certificate, = {}) request({ 'Action' => 'UploadSigningCertificate', 'CertificateBody' => certificate, :parser => Fog::Parsers::AWS::IAM::UploadSigningCertificate.new }.merge!()) end |