• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java KubernetesCluster类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.microsoft.azure.management.containerservice.KubernetesCluster的典型用法代码示例。如果您正苦于以下问题:Java KubernetesCluster类的具体用法?Java KubernetesCluster怎么用?Java KubernetesCluster使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

KubernetesCluster类属于com.microsoft.azure.management.containerservice包,在下文中一共展示了KubernetesCluster类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: print

点赞 3

import com.microsoft.azure.management.containerservice.KubernetesCluster; //导入依赖的package包/类
/**
 * Print an Azure Container Service (AKS).
 * @param kubernetesCluster a managed container service
 */
public static void print(KubernetesCluster kubernetesCluster) {
    StringBuilder info = new StringBuilder();

    info.append("Azure Container Service: ").append(kubernetesCluster.id())
            .append("\n\tName: ").append(kubernetesCluster.name())
            .append("\n\tFQDN: ").append(kubernetesCluster.fqdn())
            .append("\n\tDNS prefix label: ").append(kubernetesCluster.dnsPrefix())
            .append("\n\t\tWith Agent pool name: ").append(new ArrayList<>(kubernetesCluster.agentPools().keySet()).get(0))
            .append("\n\t\tAgent pool count: ").append(new ArrayList<>(kubernetesCluster.agentPools().values()).get(0).count())
            .append("\n\t\tAgent pool VM size: ").append(new ArrayList<>(kubernetesCluster.agentPools().values()).get(0).vmSize().toString())
            .append("\n\tLinux user name: ").append(kubernetesCluster.linuxRootUsername())
            .append("\n\tSSH key: ").append(kubernetesCluster.sshKey())
            .append("\n\tService principal client ID: ").append(kubernetesCluster.servicePrincipalClientId());
    if (kubernetesCluster.keyVaultSecretReference() != null) {
        info.append("\n\tKeyVault reference: ").append(kubernetesCluster.keyVaultSecretReference().vaultID());
    }

    System.out.println(info.toString());
}
 

开发者ID:Azure-Samples,
项目名称:acr-java-manage-azure-container-registry,
代码行数:24,
代码来源:Utils.java

示例2: updateResource

点赞 3

import com.microsoft.azure.management.containerservice.KubernetesCluster; //导入依赖的package包/类
@Override
public KubernetesCluster updateResource(KubernetesCluster resource) throws Exception {
    String agentPoolName = new ArrayList<>(resource.agentPools().keySet()).get(0);
    // Modify existing container service
    resource =  resource.update()
        .withAgentVirtualMachineCount(agentPoolName, 5)
        .withTag("tag2", "value2")
        .withTag("tag3", "value3")
        .withoutTag("tag1")
        .apply();

    Assert.assertEquals(1, resource.agentPools().size());
    Assert.assertTrue("Agent pool count was not updated.", resource.agentPools().get(agentPoolName).count() == 5);
    Assert.assertTrue(resource.tags().containsKey("tag2"));
    Assert.assertTrue(!resource.tags().containsKey("tag1"));
    return resource;
}
 

开发者ID:Azure,
项目名称:azure-libraries-for-java
代码行数:18,
代码来源:TestKubernetesCluster.java

示例3: createResource

点赞 2

import com.microsoft.azure.management.containerservice.KubernetesCluster; //导入依赖的package包/类
@Override
public KubernetesCluster createResource(KubernetesClusters kubernetesClusters) throws Exception {
    final String sshKeyData =  this.getSshKey();

    Set<String> kubernetesVersions = kubernetesClusters.listKubernetesVersions(Region.UK_WEST);
    Assert.assertTrue(kubernetesVersions.contains("1.8.1"));

    final String newName = "aks" + this.testId;
    final String dnsPrefix = "dns" + newName;
    final String agentPoolName = "ap" + newName;

    KubernetesCluster resource = kubernetesClusters.define(newName)
        .withRegion(Region.UK_WEST)
        .withNewResourceGroup()
        .withLatestVersion()
        .withRootUsername("aksadmin")
        .withSshKey(sshKeyData)
        .withServicePrincipalClientId("clientId")
        .withServicePrincipalSecret("secret")
        .defineAgentPool(agentPoolName)
            .withVirtualMachineCount(1)
            .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_D2_V2)
            .attach()
        .withDnsPrefix(dnsPrefix)
        .withTag("tag1", "value1")
        .create();
    Assert.assertNotNull("Container service not found.", resource.id());
    Assert.assertEquals(Region.UK_WEST, resource.region());
    Assert.assertEquals("aksadmin", resource.linuxRootUsername());
    Assert.assertEquals(KubernetesVersion.KUBERNETES_1_8_1, resource.version());
    Assert.assertEquals(1, resource.agentPools().size());
    Assert.assertNotNull(resource.agentPools().get(agentPoolName));
    Assert.assertEquals(1, resource.agentPools().get(agentPoolName).count());
    Assert.assertEquals(ContainerServiceVMSizeTypes.STANDARD_D2_V2, resource.agentPools().get(agentPoolName).vmSize());
    Assert.assertTrue(resource.tags().containsKey("tag1"));

    resource = kubernetesClusters.getByResourceGroup(resource.resourceGroupName(), newName);

    return resource;
}
 

开发者ID:Azure,
项目名称:azure-libraries-for-java
代码行数:41,
代码来源:TestKubernetesCluster.java

示例4: print

点赞 2

import com.microsoft.azure.management.containerservice.KubernetesCluster; //导入依赖的package包/类
@Override
public void print(KubernetesCluster resource) {
    System.out.println(new StringBuilder().append("Container Service: ").append(resource.id())
        .append("Name: ").append(resource.name())
        .append("\n\tResource group: ").append(resource.resourceGroupName())
        .append("\n\tRegion: ").append(resource.region())
        .append("\n\tTags: ").append(resource.tags())
        .toString());
}
 

开发者ID:Azure,
项目名称:azure-libraries-for-java
代码行数:10,
代码来源:TestKubernetesCluster.java

示例5: list

点赞 2

import com.microsoft.azure.management.containerservice.KubernetesCluster; //导入依赖的package包/类
@Override
public PagedList<KubernetesCluster> list() {
    final KubernetesClustersImpl self = this;
    return new GroupPagedList<KubernetesCluster>(this.manager().resourceManager().resourceGroups().list()) {
        @Override
        public List<KubernetesCluster> listNextGroup(String resourceGroupName) {
            return wrapList(self.inner().listByResourceGroup(resourceGroupName));
        }
    };
}
 

开发者ID:Azure,
项目名称:azure-libraries-for-java
代码行数:11,
代码来源:KubernetesClustersImpl.java

示例6: listAsync

点赞 2

import com.microsoft.azure.management.containerservice.KubernetesCluster; //导入依赖的package包/类
@Override
public Observable<KubernetesCluster> listAsync() {
    return this.manager().resourceManager().resourceGroups().listAsync()
        .flatMap(new Func1<ResourceGroup, Observable<KubernetesCluster>>() {
            @Override
            public Observable<KubernetesCluster> call(ResourceGroup resourceGroup) {
                return wrapPageAsync(inner().listByResourceGroupAsync(resourceGroup.name()));
            }
        });
}
 

开发者ID:Azure,
项目名称:azure-libraries-for-java
代码行数:11,
代码来源:KubernetesClustersImpl.java

示例7: listByResourceGroup

点赞 2

import com.microsoft.azure.management.containerservice.KubernetesCluster; //导入依赖的package包/类
@Override
public PagedList<KubernetesCluster> listByResourceGroup(String resourceGroupName) {
    return wrapList(this.inner().listByResourceGroup(resourceGroupName));
}
 

开发者ID:Azure,
项目名称:azure-libraries-for-java,
代码行数:5,
代码来源:KubernetesClustersImpl.java

示例8: listByResourceGroupAsync

点赞 2

import com.microsoft.azure.management.containerservice.KubernetesCluster; //导入依赖的package包/类
@Override
public Observable<KubernetesCluster> listByResourceGroupAsync(String resourceGroupName) {
    return wrapPageAsync(this.inner().listByResourceGroupAsync(resourceGroupName));
}
 

开发者ID:Azure,
项目名称:azure-libraries-for-java,
代码行数:5,
代码来源:KubernetesClustersImpl.java

示例9: attach

点赞 2

import com.microsoft.azure.management.containerservice.KubernetesCluster; //导入依赖的package包/类
@Override
public KubernetesCluster.Definition attach() {
    this.parent().inner().agentPoolProfiles().add(this.inner());
    return this.parent();
}
 

开发者ID:Azure,
项目名称:azure-libraries-for-java,
代码行数:6,
代码来源:KubernetesClusterAgentPoolImpl.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)