Esempio n. 1
0
    def create_security_group(self):
        security_group_name = input('please enter sg name:')
        request = CreateSecurityGroupRequest()
        request.set_accept_format('json')

        request.set_SecurityGroupName(security_group_name)
        request.set_VpcId(self.vpcid)

        response = self.client.do_action_with_exception(request)
        response_dict = json.loads(response)

        return response_dict['SecurityGroupId']
Esempio n. 2
0
def createSecurityGroup():
    request = CreateSecurityGroupRequest()
    request.set_accept_format('json')
    response = client.do_action_with_exception(request)
    response = json.loads(str(response, encoding='utf-8'))
    return response