def execute(self, args):
     cci = CCIManager(self.client)
     cci_id = resolve_id(cci.resolve_ids, args.get('<identifier>'), 'CCI')
     if args['--really'] or no_going_back(cci_id):
         cci.cancel_instance(cci_id)
     else:
         CLIAbort('Aborted')
Example #2
0
 def execute(self, args):
     vsi = VSManager(self.client)
     vs_id = resolve_id(vsi.resolve_ids, args.get('<identifier>'), 'VS')
     if args['--really'] or no_going_back(vs_id):
         vsi.cancel_instance(vs_id)
     else:
         CLIAbort('Aborted')
 def execute(client, args):
     cci = CCIManager(client)
     cci_id = resolve_id(cci, args.get('<identifier>'))
     if args['--really'] or no_going_back(cci_id):
         cci.reload_instance(cci_id)
     else:
         CLIAbort('Aborted')
Example #4
0
    def execute(self, args):
        manager = DNSManager(self.client)
        zone_id = resolve_id(manager.resolve_ids, args['<zone>'], name='zone')

        if args['--really'] or no_going_back(args['<zone>']):
            manager.delete_zone(zone_id)
        else:
            raise CLIAbort("Aborted.")
Example #5
0
    def execute(self, args):
        mgr = SshKeyManager(self.client)

        key_id = resolve_id(mgr.resolve_ids, args.get("<identifier>"), "SshKey")
        if args["--really"] or no_going_back(key_id):
            mgr.delete_key(key_id)
        else:
            CLIAbort("Aborted")
    def execute(client, args):
        mgr = NetworkManager(client)
        id = mgr.resolve_global_ip_ids(args.get('<identifier>'))

        if args['--really'] or no_going_back(id):
            mgr.cancel_global_ip(id)
        else:
            CLIAbort('Aborted')
    def execute(self, args):
        mgr = NetworkManager(self.client)
        subnet_id = mgr.resolve_subnet_ids(args.get('<identifier>'))

        if args['--really'] or no_going_back(subnet_id):
            mgr.cancel_subnet(subnet_id)
        else:
            CLIAbort('Aborted')
    def execute(self, args):
        mgr = SshKeyManager(self.client)

        key_id = resolve_id(mgr.resolve_ids,
                            args.get('<identifier>'), 'SshKey')
        if args['--really'] or no_going_back(key_id):
            mgr.delete_key(key_id)
        else:
            CLIAbort('Aborted')
Example #9
0
    def execute(self, args):
        hw = HardwareManager(self.client)
        hw_id = resolve_id(hw.resolve_ids, args.get("<identifier>"), "hardware")

        immediate = args.get("--immediate", False)

        if args["--really"] or no_going_back(hw_id):
            hw.cancel_metal(hw_id, immediate)
        else:
            CLIAbort("Aborted")
    def execute(self, args):
        mgr = NetworkManager(self.client)
        global_ip_id = resolve_id(mgr.resolve_global_ip_ids,
                                  args.get('<identifier>'),
                                  name='global ip')

        if args['--really'] or no_going_back(global_ip_id):
            mgr.cancel_global_ip(global_ip_id)
        else:
            CLIAbort('Aborted')
Example #11
0
    def execute(self, args):
        mgr = HardwareManager(self.client)
        hw_id = resolve_id(
            mgr.resolve_ids, args.get('<identifier>'), 'hardware')

        immediate = args.get('--immediate', False)

        if args['--really'] or no_going_back(hw_id):
            mgr.cancel_metal(hw_id, immediate)
        else:
            CLIAbort('Aborted')
Example #12
0
 def execute(self, args):
     cci = CCIManager(self.client)
     cci_id = resolve_id(cci.resolve_ids, args.get('<identifier>'), 'CCI')
     keys = []
     if args.get('--key'):
         for key in args.get('--key'):
             key_id = resolve_id(SshKeyManager(self.client).resolve_ids,
                                 key, 'SshKey')
             keys.append(key_id)
     if args['--really'] or no_going_back(cci_id):
         cci.reload_instance(cci_id, args['--postinstall'], keys)
     else:
         CLIAbort('Aborted')
Example #13
0
    def execute(self, args):
        iscsi_mgr = ISCSIManager(self.client)
        iscsi_id = resolve_id(
            iscsi_mgr.resolve_ids,
            args.get('<identifier>'),
            'iSCSI')

        immediate = args.get('--immediate', False)

        reason = args.get('--reason')
        if args['--really'] or no_going_back(iscsi_id):
            iscsi_mgr.cancel_iscsi(iscsi_id, reason, immediate)
        else:
            CLIAbort('Aborted')
    def execute(client, args):
        manager = DNSManager(client)

        if args['--id']:
            records = [{'id': args['--id']}]
        else:
            records = manager.search_record(
                args['<domain>'],
                args['<record>'])

        if args['--really'] or no_going_back('yes'):
            t = Table(['record'])
            for r in records:
                if args.get('--id') and args['--id'] != r['id']:
                    continue
                manager.delete_record(r['id'])
                t.add_row([r['id']])

            return t
        raise CLIAbort("Aborted.")
Example #15
0
    def execute(self, args):
        manager = DNSManager(self.client)
        zone_id = resolve_id(manager.resolve_ids, args['<zone>'], name='zone')

        if args['--id']:
            records = [{'id': args['--id']}]
        else:
            try:
                records = manager.get_records(
                    zone_id,
                    host=args['<record>'])
            except DNSZoneNotFound:
                raise CLIAbort("No zone found matching: %s" % args['<zone>'])

        if args['--really'] or no_going_back('yes'):
            t = Table(['record'])
            for r in records:
                if args.get('--id') and args['--id'] != r['id']:
                    continue
                manager.delete_record(r['id'])
                t.add_row([r['id']])

            return t
        raise CLIAbort("Aborted.")
 def execute(client, args):
     cci = CCIManager(client)
     if args['--really'] or no_going_back(args['<id>']):
         cci.cancel_instance(args['<id>'])
     else:
         CLIAbort('Aborted')
 def execute(client, args):
     manager = DNSManager(client)
     if args['--really'] or no_going_back(args['<domain>']):
         manager.delete_zone(args['<domain>'])
         return "Deleted zone: %s" % args['<domain>']
     raise CLIAbort("Aborted.")