本文整理汇总了Java中io.fabric8.openshift.client.OpenShiftConfigBuilder类的典型用法代码示例。如果您正苦于以下问题:Java OpenShiftConfigBuilder类的具体用法?Java OpenShiftConfigBuilder怎么用?Java OpenShiftConfigBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpenShiftConfigBuilder类属于io.fabric8.openshift.client包,在下文中一共展示了OpenShiftConfigBuilder类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initializeOpenShiftClient
import io.fabric8.openshift.client.OpenShiftConfigBuilder; //导入依赖的package包/类
/**
* Initializes an {@link OpenShiftClient}
*
* @param serverUrl
* the optional URL of where the OpenShift cluster API server is
* running
*/
public synchronized static void initializeOpenShiftClient(String serverUrl) {
OpenShiftConfigBuilder configBuilder = new OpenShiftConfigBuilder();
if (serverUrl != null && !serverUrl.isEmpty()) {
configBuilder.withMasterUrl(serverUrl);
}
Config config = configBuilder.build();
config.setUserAgent("openshift-sync-plugin-"
+ Jenkins.getInstance().getPluginManager().getPlugin("openshift-sync").getVersion() + "/fabric8-"
+ Version.clientVersion());
openShiftClient = new DefaultOpenShiftClient(config);
}
开发者ID:jenkinsci,项目名称:openshift-sync-plugin,代码行数:19,代码来源:OpenShiftUtils.java
示例2: OpenShiftClientFactory
import io.fabric8.openshift.client.OpenShiftConfigBuilder; //导入依赖的package包/类
@Inject
public OpenShiftClientFactory(
@Nullable @Named("che.infra.openshift.master_url") String masterUrl,
@Nullable @Named("che.infra.openshift.username") String username,
@Nullable @Named("che.infra.openshift.password") String password,
@Nullable @Named("che.infra.openshift.oauth_token") String oauthToken,
@Nullable @Named("che.infra.openshift.trust_certs") Boolean doTrustCerts) {
OpenShiftConfigBuilder configBuilder = new OpenShiftConfigBuilder();
if (!isNullOrEmpty(masterUrl)) {
configBuilder.withMasterUrl(masterUrl);
}
if (!isNullOrEmpty(username)) {
configBuilder.withUsername(username);
}
if (!isNullOrEmpty(password)) {
configBuilder.withPassword(password);
}
if (!isNullOrEmpty(oauthToken)) {
configBuilder.withOauthToken(oauthToken);
}
if (doTrustCerts != null) {
configBuilder.withTrustCerts(doTrustCerts);
}
this.client = new UnclosableOpenShiftClient(configBuilder.build());
}
开发者ID:eclipse,项目名称:che,代码行数:30,代码来源:OpenShiftClientFactory.java
注:本文中的io.fabric8.openshift.client.OpenShiftConfigBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论