コード例 #1
0
def _delete_volume_request():
    args = {'id': helpers.get('VolumeId'), 'command': 'deleteVolume'}

    response = requester.make_request(args)
    response = response['deletevolumeresponse']

    return response
コード例 #2
0
ファイル: volumes.py プロジェクト: vogxn/ec2stack
def _delete_volume_request():
    args = {"id": helpers.get("VolumeId"), "command": "deleteVolume"}

    response = requester.make_request(args)
    response = response["deletevolumeresponse"]

    return response
コード例 #3
0
ファイル: passwords.py プロジェクト: maduhu/ec2stack
def _get_password_data_request():
    args = {'command': 'getVMPassword', 'id': helpers.get('InstanceId')}

    response = requester.make_request(args)

    response = response['getvmpasswordresponse']

    return response
コード例 #4
0
ファイル: keypairs.py プロジェクト: maduhu/ec2stack
def _create_keypair_request():
    args = {'command': 'createSSHKeyPair', 'name': helpers.get('KeyName')}

    response = requester.make_request(args)

    response = response['createsshkeypairresponse']

    return response
コード例 #5
0
ファイル: keypairs.py プロジェクト: vogxn/ec2stack
def _import_keypair_request():
    args = {'command': 'registerSSHKeyPair', 'name': helpers.get('KeyName'),
            'publickey': b64decode(helpers.get('PublicKeyMaterial'))}

    response = requester.make_request(args)
    response = response['registersshkeypairresponse']

    return response
コード例 #6
0
ファイル: keypairs.py プロジェクト: vogxn/ec2stack
def _create_keypair_request():
    args = {'command': 'createSSHKeyPair', 'name': helpers.get('KeyName')}

    response = requester.make_request(args)

    response = response['createsshkeypairresponse']

    return response
コード例 #7
0
ファイル: tags.py プロジェクト: terbolous/cloudstack-ec2stack
def describe_tags():
    """
    Describe all tags.

    @return: Response.
    """
    args = {'command': 'listTags'}
    response = requester.make_request(args)

    return _describe_tags_response(response)
コード例 #8
0
ファイル: keypairs.py プロジェクト: ninetian/ec2stack
def _delete_keypair_request():
    """
    Request to delete a keypair.

    @return: Response.
    """
    args = {"command": "deleteSSHKeyPair", "name": helpers.get("KeyName")}

    response = requester.make_request(args)

    return response
コード例 #9
0
def describe_items_request(args, not_found):
    args['listAll'] = 'true'
    response = requester.make_request(args)
    response = response[response.keys()[0]]

    if 'count' in response:
        return response
    elif callable(not_found):
        return not_found()
    else:
        return not_found
コード例 #10
0
def _delete_keypair_request():
    """
    Request to delete a keypair.

    @return: Response.
    """
    args = {'command': 'deleteSSHKeyPair', 'name': helpers.get('KeyName')}

    response = requester.make_request(args)

    return response
コード例 #11
0
ファイル: keypairs.py プロジェクト: maduhu/ec2stack
def _import_keypair_request():
    args = {
        'command': 'registerSSHKeyPair',
        'name': helpers.get('KeyName'),
        'publickey': b64decode(helpers.get('PublicKeyMaterial'))
    }

    response = requester.make_request(args)
    response = response['registersshkeypairresponse']

    return response
コード例 #12
0
ファイル: security_groups.py プロジェクト: vogxn/ec2stack
def _create_security_group_request():
    args = {
        "command": "createSecurityGroup",
        "name": helpers.get("GroupName"),
        "description": helpers.get("GroupDescription"),
    }

    response = requester.make_request(args)

    response = response["createsecuritygroupresponse"]

    return response
コード例 #13
0
ファイル: volumes.py プロジェクト: ninetian/ec2stack
def _delete_volume_request():
    """
    Request to delete a volume.

    @return: Response.
    """
    args = {'id': helpers.get('VolumeId'), 'command': 'deleteVolume'}

    response = requester.make_request(args)
    response = response['deletevolumeresponse']

    return response
コード例 #14
0
ファイル: security_groups.py プロジェクト: maduhu/ec2stack
def _create_security_group_request():
    args = {
        'command': 'createSecurityGroup',
        'name': helpers.get('GroupName'),
        'description': helpers.get('GroupDescription')
    }

    response = requester.make_request(args)

    response = response['createsecuritygroupresponse']

    return response
コード例 #15
0
ファイル: tags.py プロジェクト: BillTheBest/ec2stack
def describe_tags():
    """
    Describe all tags.

    @return: Response.
    """
    args = {'command': 'listTags'}
    response = requester.make_request(args)

    return _describe_tags_response(
        response
    )
コード例 #16
0
def _get_password_data_request():
    """
    Request to get password.

    @return: Response.
    """
    args = {"command": "getVMPassword", "id": helpers.get("InstanceId")}

    response = requester.make_request(args)

    response = response["getvmpasswordresponse"]

    return response
コード例 #17
0
ファイル: keypairs.py プロジェクト: ninetian/ec2stack
def _create_keypair_request():
    """
    Request to create a keypair.

    @return: Response.
    """
    args = {"command": "createSSHKeyPair", "name": helpers.get("KeyName")}

    response = requester.make_request(args)

    response = response["createsshkeypairresponse"]

    return response
コード例 #18
0
def _create_security_group_request():
    """
    Request to create a security group.

    @return: response.
    """
    args = {'command': 'createSecurityGroup', 'name': helpers.get('GroupName'),
            'description': helpers.get('GroupDescription')}

    response = requester.make_request(args)

    response = response['createsecuritygroupresponse']

    return response
コード例 #19
0
ファイル: security_groups.py プロジェクト: maduhu/ec2stack
def _delete_security_group_request():
    args = {}

    helpers.require_atleast_one_parameter(['GroupName', 'GroupId'])

    if helpers.contains_parameter('GroupName'):
        args['name'] = helpers.get('GroupName')

    elif helpers.contains_parameter('GroupId'):
        args['id'] = helpers.get('GroupId')

    args['command'] = 'deleteSecurityGroup'

    response = requester.make_request(args)

    return response
コード例 #20
0
ファイル: keypairs.py プロジェクト: ninetian/ec2stack
def _import_keypair_request():
    """
    Request to import a keypair.

    @return: Response.
    """
    args = {
        "command": "registerSSHKeyPair",
        "name": helpers.get("KeyName"),
        "publickey": b64decode(helpers.get("PublicKeyMaterial")),
    }

    response = requester.make_request(args)
    response = response["registersshkeypairresponse"]

    return response
コード例 #21
0
ファイル: security_groups.py プロジェクト: vogxn/ec2stack
def _delete_security_group_request():
    args = {}

    helpers.require_atleast_one_parameter(["GroupName", "GroupId"])

    if helpers.contains_parameter("GroupName"):
        args["name"] = helpers.get("GroupName")

    elif helpers.contains_parameter("GroupId"):
        args["id"] = helpers.get("GroupId")

    args["command"] = "deleteSecurityGroup"

    response = requester.make_request(args)

    return response
コード例 #22
0
ファイル: __init__.py プロジェクト: BillTheBest/ec2stack
def describe_items_request(args, not_found):
    """
    Executes the request.

    @param args: Request payload.
    @param not_found: Function to call on empty response from Cloudstack.
    @return: Response.
    """
    args['listAll'] = 'true'
    response = requester.make_request(args)
    response = response[response.keys()[0]]

    if 'count' in response:
        return response
    elif callable(not_found):
        return not_found()
    else:
        return not_found
コード例 #23
0
def describe_items_request(args, not_found):
    """
    Executes the request.

    @param args: Request payload.
    @param not_found: Function to call on empty response from Cloudstack.
    @return: Response.
    """
    args['listAll'] = 'true'
    response = requester.make_request(args)
    response = response[response.keys()[0]]

    if 'count' in response:
        return response
    elif callable(not_found):
        return not_found()
    else:
        return not_found
コード例 #24
0
def _delete_security_group_request():
    """
    Request to delete a security group.

    @return: Response.
    """
    args = {}

    helpers.require_atleast_one_parameter(['GroupName', 'GroupId'])

    if helpers.contains_parameter('GroupName'):
        args['name'] = helpers.get('GroupName')

    elif helpers.contains_parameter('GroupId'):
        args['id'] = helpers.get('GroupId')

    args['command'] = 'deleteSecurityGroup'

    response = requester.make_request(args)

    return response