update ClusterAPI.create() response

This commit is contained in:
siliang.j 2020-11-29 17:06:02 +09:00
parent c8ef0a9689
commit bde69468a6
2 changed files with 12 additions and 7 deletions

View File

@ -18,16 +18,16 @@ func (a ClustersAPI) init(client DBClient) ClustersAPI {
}
// Create creates a new Spark cluster
func (a ClustersAPI) Create(cluster models.NewCluster) (models.ClusterInfo, error) {
var clusterInfo models.ClusterInfo
func (a ClustersAPI) Create(cluster models.NewCluster) (models.NewClusterResponse, error) {
var clusterResp models.NewClusterResponse
resp, err := a.Client.performQuery(http.MethodPost, "/clusters/create", cluster, nil)
if err != nil {
return clusterInfo, err
return clusterResp, err
}
err = json.Unmarshal(resp, &clusterInfo)
return clusterInfo, err
err = json.Unmarshal(resp, &clusterResp)
return clusterResp, err
}
// Edit edits the configuration of a cluster to match the provided attributes and size

View File

@ -0,0 +1,5 @@
package models
type NewClusterResponse struct {
ClusterID string `json:"cluster_id,omitempty" url:"cluster_id,omitempty"`
}