本文整理汇总了Java中io.fabric8.kubernetes.api.model.extensions.DeploymentList类的典型用法代码示例。如果您正苦于以下问题:Java DeploymentList类的具体用法?Java DeploymentList怎么用?Java DeploymentList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DeploymentList类属于io.fabric8.kubernetes.api.model.extensions包,在下文中一共展示了DeploymentList类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRequest
import io.fabric8.kubernetes.api.model.extensions.DeploymentList; //导入依赖的package包/类
@Override
public SpeechletResponse onRequest(IntentRequest request, Session session) throws SpeechletException {
IntentContext<BaseOperation<Deployment, DeploymentList, ?, ?>> ctx = createContext(request.getIntent(), session);
String namespace = ctx.getVariable(Variable.Namespace, getKubernetesClient().getNamespace());
LOGGER.info("Listing all deployments for namespace:" + namespace);
try {
List<String> deployments = list(ctx)
.getItems()
.stream()
.map(d -> d.getMetadata().getName()).collect(Collectors.toList());
if (deployments.isEmpty()) {
return newResponse("No deployments found.");
} else {
return newResponse("The available deployments are: " + join(deployments, ","));
}
} catch (KubernetesClientException e) {
return newFailureNotice(e.getStatus().getMessage());
}
}
示例2: newOperation
import io.fabric8.kubernetes.api.model.extensions.DeploymentList; //导入依赖的package包/类
@Override
public BaseOperation<Deployment, DeploymentList, ?, ?> newOperation() {
return (BaseOperation<Deployment, DeploymentList, ?, ?>) getKubernetesClient().extensions().deployments();
}
示例3: retrieveDeployments
import io.fabric8.kubernetes.api.model.extensions.DeploymentList; //导入依赖的package包/类
public static DeploymentList retrieveDeployments(KubernetesClient kubernetesClient, KubernetesResource resource) {
return kubernetesClient.extensions().deployments().inNamespace(resource.getNamespace()).list();
}