def do_CreateVolume(client, args): """ Create Volume """ val = client.CreateVolume(args.name, disksize=args.disksize, zone=args.zone) utils.print_dict(val)
def do_CreateRedis(client, args): """ Create redis """ val = client.CreateRedis(args.mem, duration=args.duration, name=args.name, zone=args.zone) utils.print_dict(val)
def do_CreateInstance(client, args): """ Create servers """ val = client.CreateInstance(args.image, args.instance_type, duration=args.duration, name=args.name, keypair=args.keypair, datadisk=args.datadisk, bandwidth=args.bandwidth) utils.print_dict(val)
def do_CreateInstance(client, args): """ Create servers """ val = client.CreateInstance(args.image, args.instance_type, duration=args.duration, name=args.name, keypair=args.keypair, secgroup=args.secgroup, datadisk=args.datadisk, bandwidth=args.bandwidth) utils.print_dict(val)
def do_CreateRDS(client, args): """ Create rds """ val = client.CreateRDS(args.rds_type, args.datadisk, args.engine, args.username, args.password, args.name, args.zone, args.duration) utils.print_dict(val)
def do_ImportKeyPair(client, args): """ Import SSH keypairs """ if args.key_file is not None: with open(args.key_file) as pf: pubkey = pf.read() else: pubkey = sys.stdin.read() if pubkey is not None and len(pubkey) > 0: val = client.ImportKeyPair(args.name, pubkey) utils.print_dict(val) else: raise Exception('No public key provided')
def do_EnableRedisAlarm(client, args): """Enable a metric check""" val = client.EnableRedisAlarm(args.mid) utils.print_dict(val)
def do_CreateSecurityGroup(client, args): """ Create a security group """ val = client.CreateSecurityGroup(args.name, args.description) utils.print_dict(val)
def do_GetInstanceContractInfo(client, args): """ Query instance contract information """ val = client.GetInstanceContractInfo(args.id) utils.print_dict(val)
def do_DetachVolume(client, args): """Detach Volume""" val = client.DetachVolume(args.ebs_id, args.instance_id) utils.print_dict(val)
def do_AllocateAddress(client, args): """ Allocate EIP """ val = client.AllocateAddress(args.name, args.billingModel, args.zoneId) utils.print_dict(val)
def do_DeleteTCPAlarm(client, args): """Delete tcp check""" val = client.DeleteTCPAlarm(args.mid) utils.print_dict(val)
def do_DisableRDSAlarm(client, args): """Disable a metric check""" val = client.DisableRDSAlarm(args.mid) utils.print_dict(val)
def do_DisableAliveAlarm(client, args): """Disable a alive check""" val = client.DisableAliveAlarm(args.mid) utils.print_dict(val)
def do_CreateTCPAlarm(client, args): """Create tcp check""" val = client.CreateTCPAlarm(args.iid, args.tcp_port, args.description) utils.print_dict(val)
def do_DeleteAliveAlarm(client, args): """Delete alive check""" val = client.DeleteAliveAlarm(args.mid) utils.print_dict(val)
def do_CreateAliveAlarm(client, args): """Create alive check""" val = client.CreateAliveAlarm(args.iid, args.description) utils.print_dict(val)
def do_GetBalance(client, args): """ Get balance """ val = client.GetBalance() utils.print_dict(val)
def do_GetRDSContractInfo(client, args): """ Query rds contract information """ val = client.GetRDSContractInfo(args.id) utils.print_dict(val)
def do_DisableTCPAlarm(client, args): """Disable a tcp check""" val = client.DisableTCPAlarm(args.mid) utils.print_dict(val)
def do_DeleteRDSAlarm(client, args): """Delete redis metric check""" val = client.DeleteRDSAlarm(args.mid) utils.print_dict(val)
def do_DisassociateAddress(client, args): """unbind eip to cloud service""" val = client.DisassociateAddress(args.id) utils.print_dict(val)
def do_RecoverVolume(client, args): """Recover Volume""" val = client.RecoverVolume(args.ebs_snapshot_id) utils.print_dict(val)
def do_CreateTemplate(client, args): """Save root disk to new image and upload to glance.""" val = client.CreateTemplate(args.id, args.name, notes=args.notes) utils.print_dict(val)
def do_GetInstanceMetadata(client, args): """ Get metadata of an instance """ val = client.GetInstanceMetadata(args.id) utils.print_dict(val)
def do_DescribeAddresses(client, args): """Describe EIP list""" val = client.DescribeAddresses(args.id, args.limit, args.offset) utils.print_dict(val)
def do_ConfigAddressBandwidth(client, args): """Config EIP Bandwidth""" val = client.ConfigAddressBandwidth(args.id, args.bandwidth) utils.print_dict(val)
def do_ReleaseAddress(client, args): """Release EIP """ val = client.ReleaseAddress(args.id) utils.print_dict(val)
def do_CreateRDSAlarm(client, args): """Create rds metric check monitor""" val = client.CreateRDSAlarm(args.rid, args.metric, args.operator, args.threshold, args.description) utils.print_dict(val)
def do_DescribeInstanceStatus(client, args): """ Get status of an instance """ val = client.DescribeInstanceStatus(args.id) utils.print_dict(val)
def do_ConfigAddress(client, args): """Config EIP """ val = client.ConfigAddress(args.id, args.name) utils.print_dict(val)
def do_AssociateAddress(client, args): """bind eip to cloud service""" val = client.AssociateAddress(args.id, args.bindType, args.instanceId, args.bandwidth) utils.print_dict(val)
def do_AssociateAddress(client, args): """bind eip to cloud service""" val = client.AssociateAddress(args.id, args.associationType, args.instanceId, args.bandwidth) utils.print_dict(val)
def do_GetPasswordData(client, args): """ Get initial password of an instance """ val = client.GetPasswordData(args.id, key_file=args.key_file) utils.print_dict(val)
def do_AttachVolume(client, args): """Attach Volume on Instance""" val = client.AttachVolume(args.ebs_id, args.instance_id) utils.print_dict(val)
def do_DeleteVolume(client, args): """Delete Volume""" val = client.DeleteVolume(args.ebs_id) utils.print_dict(val)
def do_DeleteVolumeSnapshot(client, args): """Delete Volume Snapshot""" val = client.DeleteVolumeSnapshot(args.ebs_snapshot_id) utils.print_dict(val)