github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/css/v1/cluster/results.go (about)

     1  package cluster
     2  
     3  import "github.com/chnsz/golangsdk/openstack/common/tags"
     4  
     5  // CreateClusterResponse This is a auto create Response Object
     6  type CreateResponse struct {
     7  	Cluster CreateResponseBody `json:"cluster"`
     8  }
     9  
    10  // CreateResponse
    11  type CreateResponseBody struct {
    12  	Id   string `json:"id"`   // Cluster ID
    13  	Name string `json:"name"` // Cluster name
    14  }
    15  
    16  type ClusterResponse struct {
    17  	Id string `json:"id"` // Cluster ID
    18  }
    19  
    20  type ClusterDetailResponse struct {
    21  	// Type of the data search engine. For details, see Table 3.
    22  	Datastore ClusterDetailDatastore `json:"datastore"`
    23  	// List of node objects.
    24  	Instances []ClusterDetailInstances `json:"instances"`
    25  	// Last modification time of a cluster. The format is ISO8601: CCYY-MM-DDThh:mm:ss.
    26  	Updated string `json:"updated"`
    27  	// Cluster name.
    28  	Name string `json:"name"`
    29  	// Time when a cluster is created. The format is ISO8601: CCYY-MM-DDThh:mm:ss.
    30  	Created string `json:"created"`
    31  	// Cluster ID.
    32  	Id     string `json:"id"`
    33  	Status string `json:"status"` //100:The operation is in progress.;200: available.;303: unavailable.
    34  	// Indicates the IP address and port number of the user used to access the VPC.
    35  	Endpoint string `json:"endpoint"`
    36  	// Cluster operation progress, which indicates the progress of cluster creation and expansion in percentage.
    37  	ActionProgress map[string]interface{} `json:"actionProgress"`
    38  	// Current behavior on a cluster. Value REBOOTING indicates that the cluster is being restarted, GROWING indicates
    39  	// that capacity expansion is being performed on the cluster, RESTORING indicates that the cluster is being
    40  	// restored, and SNAPSHOTTING indicates that the snapshot is being created.
    41  	Actions []string `json:"actions"`
    42  	// Failure cause. If the cluster is in the Available state, this parameter is not returned.
    43  	FailedReasons ClusterDetailFailedReasons `json:"failed_reasons"`
    44  	// Whether to enable authentication. Available values include true and false. Authentication is disabled by
    45  	// default. When authentication is enabled, httpsEnable must be set to true.
    46  	// Value true indicates that authentication is enabled for the cluster.
    47  	// Value false indicates that authentication is disabled for the cluster.
    48  	AuthorityEnable bool `json:"authorityEnable"`
    49  	// Whether disks are encrypted.
    50  	// Value true indicates that disks are encrypted.
    51  	// Value false indicates that disks are not encrypted.
    52  	DiskEncrypted bool `json:"diskEncrypted"`
    53  	// Key ID used for disk encryption.
    54  	CmkId string `json:"cmkId"`
    55  	// ID of the enterprise project to which a cluster belongs.
    56  	// If the user of the cluster does not enable the enterprise project, the setting of this parameter is not returned.
    57  	EnterpriseProjectId string             `json:"enterpriseProjectId"`
    58  	Tags                []tags.ResourceTag `json:"tags"`
    59  }
    60  
    61  type ClusterListResponse struct {
    62  	ClusterDetailResponse
    63  
    64  	SecurityGroupId string `json:"securityGroupId"`
    65  	SubnetId        string `json:"subnetId"`
    66  	VpcId           string `json:"vpcId"`
    67  }
    68  
    69  // ClusterDetailActionProgress
    70  type ClusterDetailActionProgress struct {
    71  	Creating string `json:"CREATING"`
    72  }
    73  
    74  type ClusterDetailDatastore struct {
    75  	// Cluster type. The default value is Elasticsearch. Currently, the value can only be Elasticsearch.
    76  	Type string `json:"type"`
    77  	// Cluster version. The value can be 5.5.1, 6.2.3, 6.5.4, 7.1.1, 7.6.2, or 7.9.3.
    78  	Version string `json:"version"`
    79  }
    80  
    81  // ClusterDetailFailedReasons
    82  type ClusterDetailFailedReasons struct {
    83  	// Error code.
    84  	// CSS.6000: indicates that a cluster fails to be created.
    85  	// CSS.6001: indicates that capacity expansion of a cluster fails.
    86  	// CSS.6002: indicates that a cluster fails to be restarted.
    87  	// CSS.6004: indicates that a node fails to be created in a cluster.
    88  	// CSS.6005: indicates that the service fails to be initialized.
    89  	ErrorCode string `json:"error_code"`
    90  	// Detailed error information
    91  	ErrorMsg string `json:"error_msg"`
    92  }
    93  
    94  type ClusterDetailInstances struct {
    95  	Type     string `json:"type"` // Supported type: ess (indicating the Elasticsearch node)
    96  	Id       string `json:"id"`
    97  	Name     string `json:"name"`
    98  	SpecCode string `json:"specCode"` // Node specifications.
    99  	AzCode   string `json:"azCode"`   // AZ to which a node belongs.
   100  
   101  	// Instance status.
   102  	// 100: The operation, such as instance creation, is in progress.
   103  	// 200: The instance is available.
   104  	// 303: The instance is unavailable.
   105  	Status string `json:"status"`
   106  }
   107  
   108  type EsFlavorsResp struct {
   109  	// List of engine versions
   110  	Versions []EsflavorsVersionsResp `json:"versions"`
   111  }
   112  
   113  type EsflavorsVersionsResp struct {
   114  	// Engine version. Versions 5.5.1, 6.2.3, 6.5.4, 7.1.1, 7.6.2, and 7.9.3 are supported.
   115  	Version string     `json:"version"`
   116  	Type    string     `json:"type"` // Instance type. The options are ess, ess-cold, ess-master, and ess-client.
   117  	Flavors []EsFlavor `json:"flavors"`
   118  }
   119  
   120  type EsFlavor struct {
   121  	Ram       int    `json:"ram"`       // Memory size of an instance. Unit: GB
   122  	Cpu       int    `json:"cpu"`       // Number of vCPUs of an instance.
   123  	Name      string `json:"name"`      // Flavor name.
   124  	Region    string `json:"region"`    // AZ
   125  	Diskrange string `json:"diskrange"` // Disk capacity range of an instance.
   126  	FlavorId  string `json:"flavor_id"` // ID of a flavor.
   127  }
   128  
   129  // RestartClusterResponse This is a auto create Response Object
   130  type RestartClusterResponse struct {
   131  	JobId string `json:"jobId"`
   132  }