Ejemplo n.º 1
0
 def create_role(self, role_name, assume_role_policy_document, path = None):
     request = Request()
     request.set_action(u'CreateRole')
     request.set_role_name(role_name)
     request.set_assume_role_policy_document(assume_role_policy_document)
     if path is not None: 
         request.set_path(path)
     
     try:    
         response = self.call(request)
     except AwsServiceException:       
         raise 
     
     role = Role.from_json(response[u'CreateRoleResponse'][u'CreateRoleResult'][u'Role'])
     request_id = response[u'CreateRoleResponse'][u'ResponseMetadata'][u'RequestId']
             
     return Response(request_id, role)
Ejemplo n.º 2
0
 def create_instance_profile(self, instance_profile_name, path = None):
     request = Request()
     request.set_action(u'CreateInstanceProfile')
     request.set_instance_profile_name(instance_profile_name)
     if path is not None: 
         request.set_path(path)
     
     try:    
         response = self.call(request)
     except AwsServiceException:
         raise 
     
     profile = InstanceProfile.from_json(response[u'CreateInstanceProfileResponse']\
                                         [u'CreateInstanceProfileResult'][u'InstanceProfile'])
     request_id = response[u'CreateInstanceProfileResponse']\
         [u'ResponseMetadata'][u'RequestId']
             
     return Response(request_id, profile)