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

     1  package clusters
     2  
     3  const (
     4  	ActionProgressCreating     = "CREATING"
     5  	ActionProgressGrowing      = "GROWING"
     6  	ActionProgressRestoring    = "RESTORING"
     7  	ActionProgressSnapshotting = "SNAPSHOTTING"
     8  	ActionProgressRepairing    = "REPAIRING"
     9  
    10  	StatusCreating       = "100"
    11  	StatusNormal         = "200"
    12  	StatusFailed         = "300"
    13  	StatusCreationFailed = "303"
    14  	StatusForzen         = "800"
    15  	StatusStopped        = "900"
    16  	StatusStopping       = "910"
    17  	StatusStarting       = "920"
    18  )
    19  
    20  type ClusterCreateResult struct {
    21  	Name string `json:"name"`
    22  	Id   string `json:"id"`
    23  }
    24  
    25  type ClustersRepsonse struct {
    26  	Clusters []Cluster4List `json:"clusters"`
    27  }
    28  
    29  type Cluster4List struct {
    30  	ClusterCommon
    31  	// Whether to enable the scheduled startup/shutdown function.
    32  	// The scheduled startup/shutdown and auto shutdown functions cannot be enabled at the same time.
    33  	IsScheduleBootOff bool                    `json:"isScheduleBootOff"`
    34  	Version           string                  `json:"version"`
    35  	FailedReasons     map[string]FailedDetail `json:"failedReasons"`
    36  }
    37  
    38  type CustomerConfig struct {
    39  	// Failure notification
    40  	FailureRemind string `json:"failureRemind"`
    41  	ClusterName   string `json:"clusterName"`
    42  	// Service provisioning
    43  	ServiceProvider string `json:"serviceProvider"`
    44  	// Whether the disk is a local disk
    45  	LocalDisk string `json:"localDisk"`
    46  	// Whether to enable SSL
    47  	Ssl string `json:"ssl"`
    48  }
    49  
    50  type Instance struct {
    51  	// VM flavor of a node.
    52  	Flavor Flavor `json:"flavor"`
    53  	// Disk information of a node.
    54  	Volume Volume `json:"volume"`
    55  	// Node status:
    56  	//   - 100:creating
    57  	//   - 200:normal
    58  	//   - 300:failed
    59  	//   - 303:creation failed
    60  	//   - 400:deleted
    61  	//   - 800:forzen
    62  	Status string `json:"status"`
    63  	// Cluster operation status list. The options are as follows:
    64  	//   - REBOOTING:restarting
    65  	//   - RESTORING:restoring
    66  	//   - REBOOT_FAILURE:restart failed
    67  	Actions []string `json:"actions"`
    68  	// Node type. Currently, only cdm is available.
    69  	Type string `json:"type"`
    70  	// Node VM ID
    71  	Id string `json:"id"`
    72  	// Name of the VM on the node
    73  	Name string `json:"name"`
    74  	// Whether the node is frozen. The value can be 0 (not frozen) or 1 (frozen).
    75  	IsFrozen string `json:"isFrozen"`
    76  	// Cluster configuration status. The options are as follows:
    77  	//  In-Sync: configuration synchronized
    78  	//  Applying: being configured
    79  	//  Sync-Failure: configuration failed
    80  	ConfigStatus string         `json:"config_status"`
    81  	Role         string         `json:"role"`
    82  	Group        string         `json:"group"`
    83  	Links        []ClusterLinks `json:"links"`
    84  	// 	Group ID
    85  	ParamsGroupId string `json:"paramsGroupId"`
    86  	// Public IP address
    87  	PublicIp string `json:"publicIp"`
    88  	// Management IP address
    89  	ManageIp string `json:"manageIp"`
    90  	// Traffic IP address
    91  	TrafficIp string `json:"trafficIp"`
    92  	// Shard ID
    93  	ShardId string `json:"shard_id"`
    94  	// Management fix IP address
    95  	ManageFixIp string `json:"manage_fix_ip"`
    96  	// Private IP address
    97  	PrivateIp string `json:"private_ip"`
    98  	// Internal IP address
    99  	InternalIp string     `json:"internal_ip"`
   100  	Resource   []Resource `json:"resource"`
   101  }
   102  
   103  type Flavor struct {
   104  	Id string `q:"id"`
   105  }
   106  
   107  type Volume struct {
   108  	// 	Type of disks on the node. Only local disks are supported.
   109  	Type string `q:"type"`
   110  	// Size of the disk on the node (GB)
   111  	Size int `q:"size"`
   112  }
   113  
   114  type ClusterLinks struct {
   115  	Rel  string `json:"rel"`
   116  	Href string `json:"href"`
   117  }
   118  
   119  type Resource struct {
   120  	ResourceId   string `json:"resource_id"`
   121  	ResourceType string `json:"resource_type"`
   122  }
   123  
   124  type ClusterTask struct {
   125  	Description string `json:"description"`
   126  	Id          string `json:"id"`
   127  	Name        string `json:"name"`
   128  }
   129  
   130  type FailedDetail struct {
   131  	ErrorCode string `q:"errorCode"`
   132  	ErrorMsg  string `q:"errorMsg"`
   133  }
   134  
   135  type Job struct {
   136  	JobId string `json:"jobId"`
   137  }
   138  
   139  type ActionResponse struct {
   140  	JobId []string `json:"jobId"`
   141  }
   142  
   143  type ClusterCommon struct {
   144  	CustomerConfig CustomerConfig `json:"customerConfig"`
   145  	Datastore      Datastore      `json:"datastore"`
   146  	Instances      []Instance     `json:"instances"`
   147  	AzName         string         `json:"azName"`
   148  	Dbuser         string         `json:"dbuser"`
   149  	FlavorName     string         `json:"flavorName"`
   150  	// Number of events
   151  	RecentEvent int         `json:"recentEvent"`
   152  	IsAutoOff   bool        `json:"isAutoOff"`
   153  	ClusterMode string      `json:"clusterMode"`
   154  	Namespace   string      `json:"namespace"`
   155  	Task        ClusterTask `json:"task"`
   156  	// EIP bound to the cluster
   157  	PublicEndpoint string `json:"publicEndpoint"`
   158  	// Cluster operation progress, which consists of a key and a value. The key indicates an ongoing task,
   159  	// and the value indicates the progress of the ongoing task. An example is "action_progress":{"SNAPSHOTTING":"16%"}.
   160  	ActionProgress map[string]string `json:"actionProgress"`
   161  	Id             string            `json:"id"`
   162  	Name           string            `json:"name"`
   163  	// Cluster creation time in ISO8601: YYYY-MM-DDThh:mm:ssZ format
   164  	Created string `json:"created"`
   165  	// Time when a cluster is updated. The format is YYYY-MM-DDThh:mm:ssZ (ISO 8601).
   166  	Updated string `json:"updated"`
   167  	// Cluster status. The options are as follows:
   168  	//   - 100:creating
   169  	//   - 200:normal
   170  	//   - 300:failed
   171  	//   - 303:creation failed
   172  	//   - 800:forzen
   173  	//   - 900:stopped
   174  	//   - 910:stopping
   175  	//   - 920:starting
   176  	Status       string `json:"status"`
   177  	StatusDetail string `json:"statusDetail"`
   178  	// Whether the cluster is frozen. The value can be 0 (not frozen) or 1 (frozen).
   179  	IsFrozen string `json:"isFrozen"`
   180  	// Cluster configuration status. The options are as follows:
   181  	// In-Sync: configuration synchronized; Applying: being configured; Sync-Failure: configuration failed
   182  	ConfigStatus string `json:"config_status"`
   183  	// Cluster links
   184  	Links []ClusterLinks `json:"links"`
   185  
   186  	IsScheduleBootOff bool   `json:"isScheduleBootOff"`
   187  	ScheduleBootTime  string `json:"scheduleBootTime"`
   188  	ScheduleOffTime   string `json:"scheduleOffTime"`
   189  }
   190  
   191  type Cluster struct {
   192  	ClusterCommon
   193  
   194  	SecurityGroupId string `json:"security_group_id"`
   195  	SubnetId        string `json:"subnet_id"`
   196  	VpcId           string `json:"vpc_id"`
   197  	// EIP domain name bound to the cluster
   198  	PublicEndpointDomainName string `json:"publicEndpointDomainName"`
   199  	// Start time
   200  	BakExpectedStartTime string `json:"bakExpectedStartTime"`
   201  	// Retention duration
   202  	BakKeepDay int `json:"bakKeepDay"`
   203  	// Maintenance window
   204  	MaintainWindow MaintainWindow `json:"maintainWindow"`
   205  	// EIP ID
   206  	EipId string `json:"eipId"`
   207  	// EIP status
   208  	PublicEndpointStatus PublicEndpointStatus `json:"publicEndpointStatus"`
   209  	// Cluster configuration status. The options are as follows: In-Sync: configuration synchronized;
   210  	// Applying: being configured; Sync-Failure: configuration failed
   211  	Actions []string `json:"actions"`
   212  
   213  	// the ID of enterprise project
   214  	EnterpriseProjectId string `json:"eps_id"`
   215  }
   216  
   217  type PublicEndpointStatus struct {
   218  	Status       string `json:"status"`
   219  	ErrorMessage string `json:"errorMessage"`
   220  }
   221  
   222  type MaintainWindow struct {
   223  	// Day of a week
   224  	Day string `json:"day"`
   225  	// Start time
   226  	StartTime string `json:"startTime"`
   227  	// End time
   228  	EndTime string `json:"endTime"`
   229  }