def delete_nodes(ctx, name, node_names, force): try: client = ctx.obj['client'] cluster = Cluster(client) result = cluster.delete_nodes(ctx.obj['profiles'].get('vdc_in_use'), name, node_names, force) stdout(result, ctx) except Exception as e: stderr(e, ctx)
def delete_nodes(ctx, name, node_names, force): """Delete node(s) in a Kubernetes cluster.""" try: restore_session(ctx) client = ctx.obj['client'] cluster = Cluster(client) result = cluster.delete_nodes(ctx.obj['profiles'].get('vdc_in_use'), name, node_names, force) stdout(result, ctx) except Exception as e: stderr(e, ctx)
def delete_nodes(ctx, cluster_name, node_names, org, vdc): """Delete node(s) in a cluster that uses native Kubernetes provider.""" try: restore_session(ctx) client = ctx.obj['client'] if not client.is_sysadmin() and org is None: org = ctx.obj['profiles'].get('org_in_use') cluster = Cluster(client) result = cluster.delete_nodes(cluster_name, list(node_names), org=org, vdc=vdc) stdout(result, ctx) except Exception as e: stderr(e, ctx)
def delete_nodes(ctx, cluster_name, node_names, org, vdc): """Delete node(s) in a cluster that uses native Kubernetes provider.""" CLIENT_LOGGER.debug(f'Executing command: {ctx.command_path}') try: restore_session(ctx) client = ctx.obj['client'] if not client.is_sysadmin() and org is None: org = ctx.obj['profiles'].get('org_in_use') cluster = Cluster(client) result = cluster.delete_nodes(cluster_name, list(node_names), org=org, vdc=vdc) stdout(result, ctx) CLIENT_LOGGER.debug(result) except Exception as e: stderr(e, ctx) CLIENT_LOGGER.error(str(e))
def delete_nodes(ctx, cluster_name, node_names, org, vdc): """Delete node(s) in a cluster that uses native Kubernetes provider. \b Example vcd cse node delete mycluster node-xxxx --yes Delete node 'node-xxxx' in cluster 'mycluster' without prompting. """ CLIENT_LOGGER.debug(f'Executing command: {ctx.command_path}') try: client_utils.cse_restore_session(ctx) client = ctx.obj['client'] if not client.is_sysadmin() and org is None: org = ctx.obj['profiles'].get('org_in_use') cluster = Cluster(client) result = cluster.delete_nodes(cluster_name, list(node_names), org=org, vdc=vdc) stdout(result, ctx) CLIENT_LOGGER.debug(result) except Exception as e: stderr(e, ctx) CLIENT_LOGGER.error(str(e), exc_info=True)