zoukankan      html  css  js  c++  java
  • openstack4j

    Identity
    // V2 authentication
    OSClientV2 os = OSFactory.builderV2()
                      .endpoint("http://127.0.0.1:5000/v2.0")
                      .credentials("admin","secret")
                      .tenantName("admin")
                      .authenticate();
    
    // V3 authentication
    OSClientV3 os = OSFactory.builderV3()
                      .endpoint("http://127.0.0.1:5000/v3")
                      .credentials("admin", "secret", Identifier.byName("Default"))
                      .scopeToProject(Identifier.byName("admin"))
                      .authenticate();
    Compute
    // Create a Server Model Object
    Server server = Builders.server()
                            .name("Ubuntu 2")
                            .flavor("large")
                            .image("imageId")
                            .build();
    
    // Boot the Server
    Server server = os.compute().servers().boot(server);
    
    // Create a Snapshot
    os.compute().servers().createSnapshot("id", "name");
    Image
    // Create an Image
    Image image = os.images().create(Builders.image()
                    .name("Cirros 0.3.0 x64")
                    .isPublic(true)
                    .containerFormat(ContainerFormat.BARE)
                    .diskFormat(DiskFormat.QCOW2)
                    .build()
                    ), Payloads.create(new File("cirros.img")));
    Network
    // Create a Port
    Port port = os.networking().port()
                  .create(Builders.port()
                  .name("port1")
                  .networkId("networkId")
                  .fixedIp("52.51.1.253", "subnetId")
                  .build());
  • 相关阅读:
    使用gunicorn部署flask项目
    加密算法详解
    elasticsearch安装
    elk下载链接
    mysql允许远程连接
    工作流源代码分析
    查看账户的访问token
    Kube-proxy组件
    创建服务账户/查询访问token
    K8s概念2
  • 原文地址:https://www.cnblogs.com/ruiy/p/6065463.html
Copyright © 2011-2022 走看看