49
50
_shiny Matches devices with shiny in the meta data
50
51
_"snet: 5.6.7.8" Matches devices with snet: 5.6.7.8 in the meta data
51
52
[::1] Matches devices in any zone with the ip ::1
52
z1-[::1]:5678 Matches devices in zone 1 with the ip ::1 and port 5678
53
z1-[::1]:5678 Matches devices in zone 1 with ip ::1 and port 5678
53
54
Most specific example:
54
55
d74z1-1.2.3.4:5678/sdb1_"snet: 5.6.7.8"
230
231
exit(EXIT_RING_UNCHANGED)
235
swift-ring-builder <builder_file> list_parts <search-value> [<search-value>] ..
236
Returns a 2 column list of all the partitions that are assigned to any of
237
the devices matching the search values given. The first column is the
238
assigned partition number and the second column is the number of device
239
matches for that partition. The list is ordered from most number of matches
240
to least. If there are a lot of devices to match against, this command
241
could take a while to run.
244
print Commands.list_parts.__doc__.strip()
246
print search_devs.__doc__.strip()
247
exit(EXIT_RING_UNCHANGED)
250
devs.extend(search_devs(builder, arg) or [])
252
print 'No matching devices found'
254
devs = [d['id'] for d in devs]
255
matches = [array('i') for x in xrange(builder.replicas)]
256
for part in xrange(builder.parts):
257
count = len([d for d in builder.get_part_devices(part)
260
matches[builder.replicas - count].append(part)
261
print 'Partition Matches'
262
for index, parts in enumerate(matches):
264
print '%9d %7d' % (part, builder.replicas - index)
265
exit(EXIT_RING_UNCHANGED)
234
269
swift-ring-builder <builder_file> add z<zone>-<ip>:<port>/<device_name>_<meta>