コード例 #1
0
ファイル: instancetests.py プロジェクト: habuka036/eucalyptus
def waitForState(client, instanceid, state):
    instances = client.get_instances()
    while instances:
        for inst in instances['results']:
            if inst['id'] == instanceid:
                print inst['state']
                if inst['state'] == state:
                    return
        time.sleep(5)
        instances = client.get_instances()


if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'testuser1', 'admin', 'euca123')
    print
    print "=== listing images ==="
    print
    images = client.get_images()
    print images
    for i in images['results']:
        if i['id'].find('emi') == 0:
            emi = i['id']
    print "image to run: " + emi
    print
    print "=== listing instances ==="
    print
    instances = client.get_instances()
    print instances
コード例 #2
0
ファイル: walrustests.py プロジェクト: wyklq/eucalyptus
#   this list of conditions and the following disclaimer.
#
#   Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    #client.login('localhost', '8888', 'eucalyptus', 'admin', 'admin')
    client.login('localhost', '8888', 'ec2.us-east-1.amazonaws.com',
                 'AKIAIFTT7VIH27SUY2BA', 'SECRET')
    print "=== Getting Buckets ==="
    print client.get_buckets()
    print "=== Getting Objects ==="
    print client.get_objects('admin')
コード例 #3
0
#   this list of conditions and the following disclaimer.
#
#   Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-01', 'admin', 'mypassword2', is_secure=True)
    client.set_data_interest(['zones'])
    import time; time.sleep(5)
    print "=== Getting Zones ==="
    print client.get_zones()
    print "=== Getting Regions ==="
    print client.get_regions()
コード例 #4
0
ファイル: addresstests.py プロジェクト: habuka036/eucalyptus
#!/usr/bin/python

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')
    print
    print "=== listing addresses ==="
    print
    addresses = client.get_addresses()
    print addresses
    print
    print "=== allocate address ==="
    print
    addressinfo = client.allocate_address()
    print addressinfo
    print
    print "=== listing keypairs ==="
    print
    print client.get_addresses()
    print
    print "=== releasing address ==="
    print
    print client.release_address(addressinfo['results']['public_ip'])
コード例 #5
0
ファイル: grouptests.py プロジェクト: wyklq/eucalyptus
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')
    print
    print "=== listing groups ==="
    print
    groups = client.get_security_groups()
    print groups
    print
    print "=== creating group ==="
    print
    groupinfo = client.create_security_group("test_grp", "group for testing")
    print groupinfo
    print
    print "=== listing groups ==="
    print
    print client.get_security_groups()
コード例 #6
0
from uiproxyclient import UIProxyClient

def waitForState (client, instanceid, state):
    instances = client.get_instances()
    while instances:
        for inst in instances['results']:
            if inst['id']==instanceid:
                print inst['state']
                if inst['state'] == state:
                    return;
        time.sleep(5)
        instances = client.get_instances()

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin', 'mypassword6')
    print 
    print "=== listing images ==="
    print 
    images = client.get_images()
    print images
    for i in images['results']:
        if i['id'].find('emi') == 0:
            emi = i['id']
    print "image to run: "+emi
    print 
    print "=== listing instances ==="
    print 
    instances = client.get_instances()
    print instances
コード例 #7
0
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from operator import itemgetter
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    volume_id = 'vol-CC463B31'

    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')

    print 
    print "=== listing snapshots ==="
    print 
    print client.get_snapshots()
    print 
    print "=== creating snapshot ==="
    print 
    snapinfo = client.create_snapshot(volume_id)
    print snapinfo
    print snapinfo['results']['id']
    print snapinfo['results']['status']
    snapid = snapinfo['results']['id']
    print 
コード例 #8
0
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from datetime import datetime
from datetime import timedelta
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin', 'mypassword6')
    print "=== Getting Launch Configurations ==="
    print client.get_all_launch_configurations()
#    print "=== Create Launch Config ==="
#    print client.create_launch_configuration('dak-lc', 'emi-C48640C0', instance_type='t1.micro', instance_monitoring='true')
#    print client.get_all_launch_configurations()
    print "=== Getting Scaling Groups ==="
#    print client.get_all_groups()
    print "=== Create Scaling Group ==="
#    print client.create_auto_scaling_group('testscalegroup', 'testlaunchconfig', min_size=0, max_size=4, default_cooldown=555, zones=['cluster01'])
#    print client.get_all_groups()
    print "=== Set Desired Capacity ==="
#    print client.set_desired_capacity("testscalegroup", 2)
    print "=== Create Scaling Policy ==="
    print client.put_scaling_policy({'name':'testpolicy', 'as_name':'testscalegroup', 'adjustment_type':'ChangeInCapacity', 'scaling_adjustment': '1', 'cooldown': '60'})
コード例 #9
0
ファイル: scalingtests.py プロジェクト: NalaGinrut/eucalyptus
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from datetime import datetime
from datetime import timedelta
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login("localhost", "8888", "ui-test-acct-03", "admin", "mypassword6")
    print "=== Getting Launch Configurations ==="
    print client.get_all_launch_configurations()
    print "=== Create Launch Config ==="
    #    print client.create_launch_configuration('testlaunchconfig', 'emi-F5373E2F', instance_type='t1.micro', instance_monitoring='true')
    print client.get_all_launch_configurations()
    print "=== Getting Scaling Groups ==="
    print client.get_all_groups()
    print "=== Create Scaling Group ==="
    #    print client.create_auto_scaling_group('testscalegroup', 'testlaunchconfig', min_size=0, max_size=4, default_cooldown=555, zones=['cluster01'])
    print client.get_all_groups()
    print "=== Set Desired Capacity ==="
    print client.set_desired_capacity("testscalegroup", 2)
#    print "=== Delete Scaling Group ==="
#    print client.delete_auto_scaling_group("testscalegroup", force_delete=True)
コード例 #10
0
# with or without modification, are permitted provided that the following
# conditions are met:
#
#   Redistributions of source code must retain the above copyright notice,
#   this list of conditions and the following disclaimer.
#
#   Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login("localhost", "8888", "testuser1", "admin", "euca123")
    print "=== Getting Zones ==="
    print client.get_zones()
コード例 #11
0
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import time
import sys
from operator import itemgetter
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    name = "Test_Image-%(t)i" % {"t": time.time()}
    snapshot_id = None
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login("localhost", "8888", "testuser1", "admin", "euca123")
    print
    print "=== getting snapshots ==="
    print
    snashosts = client.get_snapshots()
    if len(snashosts["results"]) > 0:
        snapshot_id = snashosts["results"][0]["id"]
    else:
        sys.exit()
    print "=== registering snapshot ==="
    print
    print "Name: %(n)s" % {"n": name}
    print "Snapshot id: %(n)s" % {"n": snapshot_id}
    res = client.register_snapshot_as_image(snapshot_id, name)
    print "Image ID: %(n)s" % {"n": res["results"]}
コード例 #12
0
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')
    print
    print "=== listing keypairs ==="
    print
    keypairs = client.get_keypairs()
    print keypairs
    print
    print "=== creating keypair ==="
    print
    keyinfo = client.create_keypair("testkey01")
    print keyinfo
    print
    print "=== listing keypairs ==="
    print
    print client.get_keypairs()
コード例 #13
0
ファイル: opttests.py プロジェクト: DeanSheehan/eucalyptus
# conditions are met:
#
#   Redistributions of source code must retain the above copyright notice,
#   this list of conditions and the following disclaimer.
#
#   Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin', 'mypassword7')
    print "=== Getting Summary ==="
    print client.set_data_interest(['images', 'keypairs'])
    print client.get_dash_summary()
コード例 #14
0
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import time
from operator import itemgetter
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    instance_id = 'i-45FD403F'

    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin', 'mypassword6')

    print 
    print "=== listing volumes ==="
    print 
    print client.get_volumes()
    print 
    print "=== creating volume ==="
    print 
    volinfo = client.create_volume('1', 'cluster01', None)
    print volinfo
    print volinfo['results']['id']
    print volinfo['results']['status']
    volid = volinfo['results']['id']
    print 
コード例 #15
0
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin', 'mypassword6')
    print 
    print "=== listing keypairs ==="
    print 
    keypairs = client.get_keypairs()
    print keypairs
    print 
    print "=== creating keypair ==="
    print 
    keyinfo = client.create_keypair("testkey01")
    print keyinfo
    print 
    print "=== listing keypairs ==="
    print 
    print client.get_keypairs()
コード例 #16
0
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin',
                 'mypassword6')
    print "=== Getting Launch Configurations ==="
    print client.get_all_launch_configurations()
    print "=== Create Launch Config ==="
    print client.create_launch_configuration('dak-lc',
                                             'emi-C48640C0',
                                             instance_type='t1.micro',
                                             instance_monitoring='true')
    print client.get_all_launch_configurations()
    print "=== Getting Scaling Groups ==="
    print client.get_all_groups()
    print "=== Create Scaling Group ==="
    print client.create_auto_scaling_group('testscalegroup',
                                           'testlaunchconfig',
コード例 #17
0
ファイル: elbtests.py プロジェクト: DeanSheehan/eucalyptus
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from boto.ec2.elb.listener import Listener
from boto.ec2.elb.healthcheck import HealthCheck
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    instance_id = 'i-2023dc50'
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ec2.us-east-1.amazonaws.com', 'AKIAIFTT7VIH27SUY2BA', 'SECRET')
    print "=== Getting Load Balancers ==="
    print client.get_all_load_balancers()
    print "=== Create Load Balancer ==="
    listener = '80', '8888', 'HTTP'
    print client.create_load_balancer('testbalancer', ['us-east-1d'], [listener])
    print client.get_all_load_balancers()
    print "=== Registering Instance ==="
    print client.register_instances('testbalancer', [instance_id])
    print "=== Configuring Health Check ==="
    print client.configure_health_check('testbalancer', HealthCheck(target='HTTP:80/hc/test'))
    print "=== Create LB liistener ==="
    listener = '2022', '8022', 'TCP'
    print client.create_load_balancer_listeners('testbalancer', [listener])
    print "=== Getting Instance Health ==="
コード例 #18
0
ファイル: cwtests.py プロジェクト: lwade/eucalyptus-console
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin',
                 'mypassword6')
    #    print "=== Getting Metrics ==="
    #    print client.list_metrics()
    #    end = datetime.now()
    #    start = end - timedelta(1)
    #    print client.get_metric_statistics(60, start, end, ['CPUUtilization'], 'AWS/EC2', ['Average'], {'InstanceId':'i-2023dc50'}, 'Percent')
    print client.describe_alarms()
    print client.put_metric_alarm(alarm_name='myalarm',
                                  metric_name='DiskReadBytes',
                                  namespace='AWS/EBS',
                                  period='60',
                                  threshold='1.0',
                                  comparison_op='GreaterThanThreshold',
                                  eval_periods='10',
コード例 #19
0
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin',
                 'mypassword6')
    print
    print "=== listing keypairs ==="
    print
    keypairs = client.get_keypairs()
    print keypairs
    print
    print "=== creating keypair ==="
    print
    keyinfo = client.create_keypair("testkey01")
    print keyinfo
    print
    print "=== listing keypairs ==="
    print
コード例 #20
0
#!/usr/bin/python

import time
from operator import itemgetter
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    instance_id = 'i-45FD403F'

    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')

    print
    print "=== listing volumes ==="
    print
    print client.get_volumes()
    print
    print "=== creating volume ==="
    print
    volinfo = client.create_volume('1', 'PARTI00', None)
    print volinfo
    print volinfo['results']['id']
    print volinfo['results']['status']
    volid = volinfo['results']['id']
    print
    print "=== listing volumes ==="
    print
    volumes = client.get_volumes()
    print volumes
    print
コード例 #21
0
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost',
                 '8888',
                 'ui-test-acct-01',
                 'admin',
                 'mypassword2',
                 is_secure=True)
    client.set_data_interest(['zones'])
    import time
    time.sleep(5)
    print "=== Getting Zones ==="
    print client.get_zones()
    print "=== Getting Regions ==="
    print client.get_regions()
コード例 #22
0
ファイル: cwtests.py プロジェクト: DeanSheehan/eucalyptus
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from datetime import datetime
from datetime import timedelta
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin', 'mypassword6')
#    print "=== Getting Metrics ==="
#    print client.list_metrics()
#    end = datetime.now()
#    start = end - timedelta(1)
#    print client.get_metric_statistics(60, start, end, ['CPUUtilization'], 'AWS/EC2', ['Average'], {'InstanceId':'i-2023dc50'}, 'Percent')
    print client.describe_alarms()
    print client.put_metric_alarm(alarm_name='myalarm', metric_name='DiskReadBytes', namespace='AWS/EBS', period='60', threshold='1.0', comparison_op='GreaterThanThreshold', eval_periods='10', statistic='Sum')
    print client.describe_alarms()
コード例 #23
0
ファイル: tagtests.py プロジェクト: wyklq/eucalyptus
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin',
                 'mypassword7')
    print "=== Getting Tags ==="
    print client.get_tags()
    #    print "=== Creating Tag ==="
    #    print client.create_tags(['ami-d54d8fbc'], {'Purpose':'PuppetDev'})
    #    print client.get_tags()
    #    print "=== Deleting Tag ==="
    #    print client.delete_tags(['ami-d54d8fbc'], {'Purpose':'PuppetDev'})
    #    print client.get_tags()
    #    print "=== Getting filtered images ==="
    #    print client.get_images({'tag:Purpose':'LifeguardDevel'});
    print client.get_tags({'resource-type': 'volume'})
コード例 #24
0
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from boto.ec2.elb.healthcheck import HealthCheck
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    instance_id = "i-2023dc50"
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login("localhost", "8888", "ui-test-acct-03", "admin", "mypassword6")
    print "=== Getting Load Balancers ==="
    print client.get_all_load_balancers()
    print "=== Create Load Balancer ==="
    listener = "80", "8888", "HTTP"
    print client.create_load_balancer("testbalancer", ["cluster01"], [listener])
    print client.get_all_load_balancers()
    print "=== Registering Instance ==="
    print client.register_instances("testbalancer", [instance_id])
    print "=== Configuring Health Check ==="
    print client.configure_health_check("testbalancer", HealthCheck(target="HTTP:80/hc/test"))
    print "=== Create LB liistener ==="
    listener = "2022", "8022", "TCP"
    print client.create_load_balancer_listeners("testbalancer", [listener])
    print "=== Getting Instance Health ==="
コード例 #25
0
ファイル: elbtests.py プロジェクト: wyklq/eucalyptus
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from boto.ec2.elb.listener import Listener
from boto.ec2.elb.healthcheck import HealthCheck
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    instance_id = 'i-2023dc50'
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ec2.us-east-1.amazonaws.com',
                 'AKIAIFTT7VIH27SUY2BA', 'SECRET')
    print "=== Getting Load Balancers ==="
    print client.get_all_load_balancers()
    print "=== Create Load Balancer ==="
    listener = '80', '8888', 'HTTP'
    print client.create_load_balancer('testbalancer', ['us-east-1d'],
                                      [listener])
    print client.get_all_load_balancers()
    print "=== Registering Instance ==="
    print client.register_instances('testbalancer', [instance_id])
    print "=== Configuring Health Check ==="
    print client.configure_health_check('testbalancer',
                                        HealthCheck(target='HTTP:80/hc/test'))
    print "=== Create LB liistener ==="
コード例 #26
0
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from datetime import datetime
from datetime import timedelta
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin',
                 'mypassword6')
    print "=== Getting Launch Configurations ==="
    print client.get_all_launch_configurations()
    print "=== Create Launch Config ==="
    #    print client.create_launch_configuration('testlaunchconfig', 'emi-F5373E2F', instance_type='t1.micro', instance_monitoring='true')
    print client.get_all_launch_configurations()
    print "=== Getting Scaling Groups ==="
    print client.get_all_groups()
    print "=== Create Scaling Group ==="
    #    print client.create_auto_scaling_group('testscalegroup', 'testlaunchconfig', min_size=0, max_size=4, default_cooldown=555, zones=['cluster01'])
    print client.get_all_groups()
    print "=== Set Desired Capacity ==="
    print client.set_desired_capacity("testscalegroup", 2)
#    print "=== Delete Scaling Group ==="
コード例 #27
0
ファイル: imagetests.py プロジェクト: DeanSheehan/eucalyptus
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import time
from operator import itemgetter
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    image_id = 'emi-F2043872'

    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')

    print 
    print "=== listing images ==="
    print 
    print client.get_images()
    print 
    print 
    print "=== getting image attribute ==="
    print 
    print client.get_image_attribute(image_id)
    print 
    print "=== setting image attribute ==="
    print 
    print client.modify_image_attribute(image_id, groups=['all'], attribute='launchPermission', operation='remove')
コード例 #28
0
ファイル: cwtests.py プロジェクト: Brainfood-com/eucalyptus
#
#   Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from datetime import datetime
from datetime import timedelta
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ec2.us-east-1.amazonaws.com', 'AKIAIFTT7VIH27SUY2BA', 'SECRET HERE')
    print "=== Getting Metrics ==="
    print client.list_metrics()
    end = datetime.now()
    start = end - timedelta(1)
    print client.get_metric_statistics(60, start, end, ['CPUUtilization'], 'AWS/EC2', ['Average'], {'InstanceId':'i-2023dc50'}, 'Percent')
コード例 #29
0
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from datetime import datetime
from datetime import timedelta
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin',
                 'mypassword6')
    print "=== Getting Launch Configurations ==="
    print client.get_all_launch_configurations()
    #    print "=== Create Launch Config ==="
    #    print client.create_launch_configuration('dak-lc', 'emi-C48640C0', instance_type='t1.micro', instance_monitoring='true')
    #    print client.get_all_launch_configurations()
    print "=== Getting Scaling Groups ==="
    #    print client.get_all_groups()
    print "=== Create Scaling Group ==="
    #    print client.create_auto_scaling_group('testscalegroup', 'testlaunchconfig', min_size=0, max_size=4, default_cooldown=555, zones=['cluster01'])
    #    print client.get_all_groups()
    print "=== Set Desired Capacity ==="
    #    print client.set_desired_capacity("testscalegroup", 2)
    print "=== Create Scaling Policy ==="
コード例 #30
0
ファイル: elbtests.py プロジェクト: Brainfood-com/eucalyptus
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from boto.ec2.elb.listener import Listener
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ec2.us-east-1.amazonaws.com', 'AKIAIFTT7VIH27SUY2BA', 'SECRET')
    print "=== Getting Load Balancers ==="
    print client.get_all_load_balancers()
    print "=== Create Load Balancer ==="
    listener = Listener(load_balancer_port='80', instance_port='8888', protocol='HTTP')
    print client.create_load_balancer("testbalancer", ['us-east-1a'], [listener])
    print client.get_all_load_balancers()
    print "=== Getting Instance Health ==="
    print client.describe_instance_health('testbalancer')
    print "=== Delete Load Balancer ==="
    print client.delete_load_balancer('testbalancer')
コード例 #31
0
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from datetime import datetime
from datetime import timedelta
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ec2.us-east-1.amazonaws.com', 'AKIAIFTT7VIH27SUY2BA', 'SECRET KEY')
    print "=== Getting Launch Configurations ==="
    print client.get_all_launch_configurations()
    print "=== Create Launch Config ==="
    print client.create_launch_configuration('testlaunchconfig', 'ami-1624987f', instance_type='t1.micro', instance_monitoring='true')
    print client.get_all_launch_configurations()
    print "=== Getting Scaling Groups ==="
    print client.get_all_groups()
    print "=== Create Scaling Group ==="
    print client.create_auto_scaling_group('testscalegroup', 'testlaunchconfig', min_size=0, max_size=4, default_cooldown=555, zones=['us-east-1a'])
    print client.get_all_groups()
    print "=== Set Desired Capacity ==="
    print client.set_desired_capacity("testscalegroup", 2)
    print "=== Delete Scaling Group ==="
    print client.delete_auto_scaling_group("testscalegroup", force_delete=True)
コード例 #32
0
# with or without modification, are permitted provided that the following
# conditions are met:
#
#   Redistributions of source code must retain the above copyright notice,
#   this list of conditions and the following disclaimer.
#
#   Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'testuser1', 'admin', 'euca123')
    print "=== Getting Zones ==="
    print client.get_zones()
コード例 #33
0
def waitForState(client, instanceid, state):
    instances = client.get_instances()
    while instances:
        for inst in instances['results']:
            if inst['id'] == instanceid:
                print inst['state']
                if inst['state'] == state:
                    return
        time.sleep(5)
        instances = client.get_instances()


if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin',
                 'mypassword6')
    print
    print "=== listing images ==="
    print
    images = client.get_images()
    print images
    for i in images['results']:
        if i['id'].find('emi') == 0:
            emi = i['id']
    print "image to run: " + emi
    print
    print "=== listing instances ==="
    print
    instances = client.get_instances()
コード例 #34
0
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import time
import sys
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    name = 'Test_Image-%(t)i' % {'t': time.time()}
    snapshot_id = None
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'testuser1', 'admin', 'euca123')
    print
    print "=== getting snapshots ==="
    print
    snashosts = client.get_snapshots()
    if len(snashosts['results']) > 0:
        snapshot_id = snashosts['results'][0]['id']
    else:
        sys.exit()
    print "=== registering snapshot ==="
    print
    print 'Name: %(n)s' % {'n': name}
    print 'Snapshot id: %(n)s' % {'n': snapshot_id}
    res = client.register_snapshot_as_image(snapshot_id, name)
    print 'Image ID: %(n)s' % {'n': res['results']}
コード例 #35
0
ファイル: elbtests.py プロジェクト: gholms/eucalyptus-console
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from boto.ec2.elb.listener import Listener
from boto.ec2.elb.healthcheck import HealthCheck
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    instance_id = 'i-2023dc50'
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin', 'mypassword6')
    print "=== Getting Load Balancers ==="
    print client.get_all_load_balancers()
    print "=== Create Load Balancer ==="
    listener = '80', '8888', 'HTTP'
    print client.create_load_balancer('testbalancer', ['cluster01'], [listener])
    print client.get_all_load_balancers()
    print "=== Registering Instance ==="
    print client.register_instances('testbalancer', [instance_id])
    print "=== Configuring Health Check ==="
    print client.configure_health_check('testbalancer', HealthCheck(target='HTTP:80/hc/test'))
    print "=== Create LB liistener ==="
    listener = '2022', '8022', 'TCP'
    print client.create_load_balancer_listeners('testbalancer', [listener])
    print "=== Getting Instance Health ==="
コード例 #36
0
ファイル: cwtests.py プロジェクト: schue/eucalyptus-ui
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from datetime import datetime
from datetime import timedelta
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ec2.us-east-1.amazonaws.com',
                 'AKIAIFTT7VIH27SUY2BA', 'SECRET HERE')
    print "=== Getting Metrics ==="
    print client.list_metrics()
    end = datetime.now()
    start = end - timedelta(1)
    print client.get_metric_statistics(60, start, end, ['CPUUtilization'],
                                       'AWS/EC2', ['Average'],
                                       {'InstanceId': 'i-2023dc50'}, 'Percent')
コード例 #37
0
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')
    print 
    print "=== listing keypairs ==="
    print 
    keypairs = client.get_keypairs()
    print keypairs
    print 
    print "=== creating keypair ==="
    print 
    keyinfo = client.create_keypair("testkey01")
    print keyinfo
    print 
    print "=== listing keypairs ==="
    print 
    print client.get_keypairs()
コード例 #38
0
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from boto.ec2.elb.healthcheck import HealthCheck
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    instance_id = 'i-2023dc50'
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin',
                 'mypassword6')
    print "=== Getting Load Balancers ==="
    print client.get_all_load_balancers()
    print "=== Create Load Balancer ==="
    listener = '80', '8888', 'HTTP'
    print client.create_load_balancer('testbalancer', ['cluster01'],
                                      [listener])
    print client.get_all_load_balancers()
    print "=== Registering Instance ==="
    print client.register_instances('testbalancer', [instance_id])
    print "=== Configuring Health Check ==="
    print client.configure_health_check('testbalancer',
                                        HealthCheck(target='HTTP:80/hc/test'))
    print "=== Create LB liistener ==="
コード例 #39
0
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from datetime import datetime
from datetime import timedelta
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ec2.us-east-1.amazonaws.com',
                 'AKIAIFTT7VIH27SUY2BA', 'SECRET KEY')
    print "=== Getting Launch Configurations ==="
    print client.get_all_launch_configurations()
    print "=== Create Launch Config ==="
    print client.create_launch_configuration('testlaunchconfig',
                                             'ami-1624987f',
                                             instance_type='t1.micro',
                                             instance_monitoring='true')
    print client.get_all_launch_configurations()
    print "=== Getting Scaling Groups ==="
    print client.get_all_groups()
    print "=== Create Scaling Group ==="
    print client.create_auto_scaling_group('testscalegroup',
                                           'testlaunchconfig',
コード例 #40
0
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin', 'mypassword7')
    print "=== Getting Tags ==="
    print client.get_tags()
    #    print "=== Creating Tag ==="
    #    print client.create_tags(['ami-d54d8fbc'], {'Purpose':'PuppetDev'})
    #    print client.get_tags()
    #    print "=== Deleting Tag ==="
    #    print client.delete_tags(['ami-d54d8fbc'], {'Purpose':'PuppetDev'})
    #    print client.get_tags()
    #    print "=== Getting filtered images ==="
    #    print client.get_images({'tag:Purpose':'LifeguardDevel'});
    print client.get_tags({'resource-type': 'volume'})
コード例 #41
0
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from operator import itemgetter
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    volume_id = 'vol-CC463B31'

    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')

    print
    print "=== listing snapshots ==="
    print
    print client.get_snapshots()
    print
    print "=== creating snapshot ==="
    print
    snapinfo = client.create_snapshot(volume_id)
    print snapinfo
    print snapinfo['results']['id']
    print snapinfo['results']['status']
    snapid = snapinfo['results']['id']
    print
コード例 #42
0
from uiproxyclient import UIProxyClient

def waitForState (client, instanceid, state):
    instances = client.get_instances()
    while instances:
        for inst in instances['results']:
            if inst['id']==instanceid:
                print inst['state']
                if inst['state'] == state:
                    return;
        time.sleep(5)
        instances = client.get_instances()

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'testuser1', 'admin', 'euca123')
    print 
    print "=== listing images ==="
    print 
    images = client.get_images()
    print images
    for i in images['results']:
        if i['id'].find('emi') == 0:
            emi = i['id']
    print "image to run: "+emi
    print 
    print "=== listing instances ==="
    print 
    instances = client.get_instances()
    print instances
コード例 #43
0
ファイル: loadtest.py プロジェクト: wyklq/eucalyptus
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient
from datetime import datetime, timedelta

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')
    print "=== Getting Zones, again and again ==="
    iter = 0
    sec_iter = 0
    start = datetime.now()
    while True:
        zones = client.get_zones()
        iter = iter+1
        sec_iter = sec_iter+1
        if (datetime.now() - start) > timedelta(seconds=1):
          print "req/sec: "+str(sec_iter)
          sec_iter = 0
          start = datetime.now()
コード例 #44
0
ファイル: walrustests.py プロジェクト: DeanSheehan/eucalyptus
#   Redistributions of source code must retain the above copyright notice,
#   this list of conditions and the following disclaimer.
#
#   Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    #client.login('localhost', '8888', 'eucalyptus', 'admin', 'admin')
    client.login('localhost', '8888', 'ec2.us-east-1.amazonaws.com', 'AKIAIFTT7VIH27SUY2BA', 'SECRET')
    print "=== Getting Buckets ==="
    print client.get_buckets()
    print "=== Getting Objects ==="
    print client.get_objects('admin')
コード例 #45
0
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login("localhost", "8888", "ui-test-acct-03", "admin", "mypassword6")
    #    print "=== Getting Metrics ==="
    #    print client.list_metrics()
    #    end = datetime.now()
    #    start = end - timedelta(1)
    #    print client.get_metric_statistics(60, start, end, ['CPUUtilization'], 'AWS/EC2', ['Average'], {'InstanceId':'i-2023dc50'}, 'Percent')
    print client.describe_alarms()
    print client.put_metric_alarm(
        alarm_name="myalarm",
        metric_name="DiskReadBytes",
        namespace="AWS/EBS",
        period="60",
        threshold="1.0",
        comparison_op="GreaterThanThreshold",
        eval_periods="10",
コード例 #46
0
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    image_id = 'emi-F2043872'

    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')

    print
    print "=== listing images ==="
    print
    print client.get_images()
    print
    print
    print "=== getting image attribute ==="
    print
    print client.get_image_attribute(image_id)
    print
    print "=== setting image attribute ==="
    print
    print client.modify_image_attribute(image_id,
コード例 #47
0
ファイル: walrustests.py プロジェクト: lee212/eucalyptus
#
#   Redistributions of source code must retain the above copyright notice,
#   this list of conditions and the following disclaimer.
#
#   Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'eucalyptus', 'admin', 'admin')
    print "=== Getting Buckets ==="
    print client.get_buckets()
    print "=== Getting Objects ==="
    print client.get_objects('admin')
コード例 #48
0
#
#   Redistributions of source code must retain the above copyright notice,
#   this list of conditions and the following disclaimer.
#
#   Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin',
                 'mypassword7')
    print "=== Getting Summary ==="
    print client.set_data_interest(['images', 'keypairs'])
    print client.get_dash_summary()
コード例 #49
0
#!/usr/bin/python

import time
from operator import itemgetter
from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    instance_id = 'i-45FD403F'

    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')

    print 
    print "=== listing volumes ==="
    print 
    print client.get_volumes()
    print 
    print "=== creating volume ==="
    print 
    volinfo = client.create_volume('1', 'PARTI00', None)
    print volinfo
    print volinfo['results']['id']
    print volinfo['results']['status']
    volid = volinfo['results']['id']
    print 
    print "=== listing volumes ==="
    print 
    volumes = client.get_volumes()
    print volumes
    print 
コード例 #50
0
ファイル: tagtests.py プロジェクト: lee212/eucalyptus
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'testuser1', 'admin', 'euca123')
    print "=== Getting Tags ==="
    print client.get_tags()
#    print "=== Creating Tag ==="
#    print client.create_tags(['ami-d54d8fbc'], {'Purpose':'PuppetDev'})
#    print client.get_tags()
#    print "=== Deleting Tag ==="
#    print client.delete_tags(['ami-d54d8fbc'], {'Purpose':'PuppetDev'})
#    print client.get_tags()
#    print "=== Getting filtered images ==="
#    print client.get_images({'tag:Purpose':'LifeguardDevel'});
コード例 #51
0
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')
    print 
    print "=== listing addresses ==="
    print 
    addresses = client.get_addresses()
    print addresses
    print 
    print "=== allocate address ==="
    print 
    addressinfo = client.allocate_address()
    print addressinfo
    print 
    print "=== listing keypairs ==="
    print 
    print client.get_addresses()
コード例 #52
0
ファイル: grouptests.py プロジェクト: AsherBond/eucalyptus-ui
#!/usr/bin/python

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'test', 'admin', 'testing123')
    print 
    print "=== listing groups ==="
    print 
    groups = client.get_security_groups()
    print groups
    print 
    print "=== creating group ==="
    print 
    groupinfo = client.create_security_group("test_grp", "group for testing")
    print groupinfo
    print 
    print "=== listing groups ==="
    print 
    print client.get_security_groups()
    print 
    print "=== authorizing port 22 ingress ==="
    print 
    print client.authorize_security_group(name="test_grp",
                                ip_protocol=['tcp', 'tcp'],
                                from_port=['22', '22'],
                                to_port=['22', '22'],
                                cidr_ip=['10.0.0.0/24', '10.20.30.0/24'])
    print 
コード例 #53
0
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from uiproxyclient import UIProxyClient

if __name__ == "__main__":
    # make some calls to proxy class to test things out
    client = UIProxyClient()
    client.login('localhost', '8888', 'ui-test-acct-03', 'admin', 'mypassword6')
    print "=== Getting Launch Configurations ==="
    print client.get_all_launch_configurations()
    print "=== Create Launch Config ==="
    print client.create_launch_configuration('dak-lc', 'emi-C48640C0', instance_type='t1.micro',
                                             instance_monitoring='true')
    print client.get_all_launch_configurations()
    print "=== Getting Scaling Groups ==="
    print client.get_all_groups()
    print "=== Create Scaling Group ==="
    print client.create_auto_scaling_group('testscalegroup', 'testlaunchconfig', min_size=0, max_size=4,
                                           default_cooldown=555, zones=['cluster01'])
    print client.get_all_groups()
    print "=== Set Desired Capacity ==="
    print client.set_desired_capacity("testscalegroup", 2)