弹性裸金属服务器

    部署集

    创建部署集

    通过以下代码根据指定的部署集策略和并发度创建部署集

    // 设置创建部署集的名称
    deploySetName := "your-deploy-set-name"
    // 设置创建的部署集的描述信息
    deployDesc := "your-deploy-set-desc"
    // 设置部署集并发度,范围 [1,5]
    concurrency := 1
    // 设置创建部署集的策略,BBC实例策略只支持:"tor_ha"
    strategy := "tor_ha"
    queryArgs := &CreateDeploySetArgs{
    	Strategy:    strategy,
    	Concurrency: concurrency,
    	Name:        deploySetName,
    	Desc:        deployDesc,
    }
    if res, err := bbcClient.CreateDeploySet(queryArgs); err != nil {
        fmt.Println("Create deploy set failed: ", err)
    } else {
        fmt.Println("Create deploy set success, result: ", res)
    }

    查询部署集列表

    使用以下代码查询所有部署集实例的列表及详情信息

    if res, err := bbcClient.ListDeploySets(); err != nil {
        fmt.Println("List deploy sets failed: ", err)
    } else {
        fmt.Println("List deploy sets success, result: ", res)
    }

    查询部署集详情

    使用以下代码可以查询指定套餐的详细信息

    // 设置你要查询的deploySetID
    deploySetID := "your-choose-deploy-set-id"
    if res, err := bbcClient.GetDeploySet(deploySetID); err != nil {
        fmt.Println("Get deploy set failed: ", err)
    } else {
        fmt.Println("Get deploy set success, result: ", res)
    }

    删除指定的部署集

    使用以下代码删除用户自己的指定的部署集

    // 设置你要删除的deploySetID
    deploySetID := "your-choose-deploy-set-id"
    if err := bbcClient.DeleteDeploySet(deploySetID); err != nil {
        fmt.Println("Delete deploy set failed: ", err)
    }
    上一篇
    镜像
    下一篇
    套餐