| Modifier and Type | Class and Description |
|---|---|
static class |
KubectlWrapper.Builder
Builder for
KubectlWrapper. |
| Modifier and Type | Method and Description |
|---|---|
Object |
getObject(String kind,
String name)
Using the kubectl CLI tool as the API client for the caller, this method unmarshalls the JSON
output of the CLI to a JSON Object.
|
com.google.common.collect.ImmutableList<Object> |
getObjectsThatMatchLabels(String kind,
Map<String,String> labels)
Using the kubectl CLI tool as the API client for the caller, this method unmarshalls the JSON
output of objects matching the supplied labels.
|
String |
runKubectlCommand(String command,
com.google.common.collect.ImmutableList<String> args)
Runs the specified kubectl command.
|
public String runKubectlCommand(String command, com.google.common.collect.ImmutableList<String> args) throws IOException, InterruptedException
command - The kubectl command to be run.args - Arguments for the command.IOException - If an error occurred while executing the command.InterruptedException - If an error occured while executing the command.public Object getObject(String kind, String name) throws IOException, InterruptedException
kind - The kind of Kubernetes Object.name - The name of the Kubernetes Object.IOException - If an error occurred while executing the command.InterruptedException - If an error occurred while executing the command.public com.google.common.collect.ImmutableList<Object> getObjectsThatMatchLabels(String kind, Map<String,String> labels) throws IOException, InterruptedException, com.jayway.jsonpath.InvalidJsonException
kind - The kind of Kubernetes Object.labels - The key-value labels set represented as a map.IOException - If an error occurred while executing the command.InterruptedException - If an error occurred while executing the command.com.jayway.jsonpath.InvalidJsonException - If an error occurred parsing the JSON return value.Copyright © 2016–2020 Google. All rights reserved.