コード例 #1
0
ファイル: template.py プロジェクト: th3n3xtg3n3ration/cc1
def add(caller_id, name, memory, cpu, description, points, ec2name):
    """
    Creates and saves new VM Template.

    @cmview_admin_cm
    @param_post{name,string}
    @param_post{memory,int}
    @param_post{cpu,int}
    @param_post{description,string}
    @param_post{points,int}
    @param_post{ec2name,string} name for EC2 interface
    """

    try:
        template = Template()
        template.name = name
        template.memory = memory
        template.cpu = cpu
        template.description = description
        template.points = points
        template.ec2name = ec2name
        template.state = template_states['active']
        template.save()

    except:
        raise CMException('template_create')
コード例 #2
0
ファイル: template.py プロジェクト: cc1-cloud/cc1
def add(caller_id, name, memory, cpu, description, points, ec2name):
    """
    Creates and saves new VM Template.

    @cmview_admin_cm
    @param_post{name,string}
    @param_post{memory,int}
    @param_post{cpu,int}
    @param_post{description,string}
    @param_post{points,int}
    @param_post{ec2name,string} name for EC2 interface
    """

    try:
        template = Template()
        template.name = name
        template.memory = memory
        template.cpu = cpu
        template.description = description
        template.points = points
        template.ec2name = ec2name
        template.state = template_states['active']
        template.save()

    except:
        raise CMException('template_create')