Revision b0ddfd38 src/cli/onevnet

View differences:

src/cli/onevnet
186 186
* rmleases (Removes a lease fom the virtual network)
187 187
    onevnet rmleases <network_id> <IP>
188 188

  
189
* chown (Changes the virtual network owner and group)
190
    onevnet chown <network_id> <owner_id> [<group_id>]
191

  
192
* chgrp (Changes the virtual network group)
193
    onevnet chgrp <network_id> <group_id>
194

  
189 195
* list (Lists virtual networks in the pool)
190 196
    onevnet list <filter_flag>
191 197

  
......
342 348
        puts "Leases removed" if ops[:verbose]
343 349
    end
344 350

  
351
when "chown"
352
    check_parameters("chown", 2)
353

  
354
    obj_id  = get_vn_id(ARGV[0])
355
    new_uid = ARGV[1].to_i
356
    new_gid = ( ARGV.length > 2 ) ? ARGV[2].to_i : -1
357

  
358
    obj = OpenNebula::VirtualNetwork.new_with_id(obj_id, get_one_client)
359

  
360
    result = obj.chown( new_uid, new_gid )
361
    if is_successful?(result)
362
        puts "Virtual Network user/group changed" if ops[:verbose]
363
    end
364

  
365
when "chgrp"
366
    check_parameters("chgrp", 2)
367

  
368
    obj_id   = get_vn_id(ARGV[0])
369
    new_uid  = -1
370
    new_gid  = ARGV[1].to_i
371

  
372
    obj = OpenNebula::VirtualNetwork.new_with_id(obj_id, get_one_client)
373

  
374
    result = obj.chown( new_uid, new_gid )
375
    if is_successful?(result)
376
        puts "Virtual Network group changed" if ops[:verbose]
377
    end
378

  
345 379
when "list"
346 380
    if ARGV[0]
347 381
        case ARGV[0]

Also available in: Unified diff