github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/mrs/v2/clusters/results.go (about)

     1  package clusters
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  // Cluster is a struct that represents the result of Create methods.
     8  type Cluster struct {
     9  	ID string `json:"cluster_id"`
    10  }
    11  
    12  // CreateResult represents a result of the Create method.
    13  type CreateResult struct {
    14  	golangsdk.Result
    15  }
    16  
    17  // Extract is a method which to extract a cluster response.
    18  func (r CreateResult) Extract() (*Cluster, error) {
    19  	var s Cluster
    20  	err := r.ExtractInto(&s)
    21  	return &s, err
    22  }