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());
  • 相关阅读:
    15 手写数字识别-小数据集
    14 深度学习-卷积
    5.线性回归算法
    9、主成分分析
    8、特征选择
    4.K均值算法--应用
    6.逻辑回归
    12.朴素贝叶斯-垃圾邮件分类
    13、垃圾邮件2
    大数据应用期末总评
  • 原文地址:https://www.cnblogs.com/ruiy/p/6065463.html
Copyright © 2011-2022 走看看