+ help='Filter cluster to those that have this id.')
+def do_cluster_detail(gc, args):
+ """List cluster you can access."""
+ filter_keys = ['id']
+ filter_items = [(key, getattr(args, key)) for key in filter_keys]
+ filters = dict([item for item in filter_items if item[1] is not None])
+ fields = dict(filter(lambda x: x[1] is not None, vars(args).items()))
+ kwargs = {'filters': filters}
+ if filters:
+ cluster = utils.find_resource(gc.clusters, fields.pop('id'))
+ _escalator_show(cluster)
+ else:
+ cluster = gc.clusters.list(**kwargs)
+ columns = ['ID', 'Name', 'Description', 'Nodes',
+ 'Networks', 'Auto_scale', 'Use_dns']
+ utils.print_list(cluster, columns)
+
+
+@utils.arg('cluster_id', metavar='<CLUSTER_ID>',
+ help='The cluster ID to update os and TECS.')
+@utils.arg('--hosts', metavar='<HOSTS>', nargs='+',
+ help='The host ID to update')
+@utils.arg('--update-object', metavar='<UPDATE_OBJECT>',
+ help='update object:vplat or tecs or zenic......')
+@utils.arg('--version-id', metavar='<VERSION>',
+ help='if not patch, update version id is used to update.')
+@utils.arg('--version-patch-id', metavar='<VERSION_PATCH>',
+ help='if update version patch, version patch id is needed')
+@utils.arg('--update-script', metavar='<UPDATE_SCRIPT>',
+ help='update script in /var/lib/daisy/os')
+def do_update(gc, args):
+ """update TECS."""
+ fields = dict(filter(lambda x: x[1] is not None, vars(args).items()))
+
+ # Filter out values we can't use
+ CREATE_PARAMS = escalatorclient.v1.update.CREATE_PARAMS
+ fields = dict(filter(lambda x: x[0] in CREATE_PARAMS, fields.items()))
+
+ update = gc.update.update(**fields)
+ _escalator_show(update)