github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/cse/dedicated/v2/engines/results.go (about)

     1  package engines
     2  
     3  // RequestResp is the structure that represents the response of the API request.
     4  type RequestResp struct {
     5  	// The ID of the dedicated microservice engine.
     6  	ID string `json:"id"`
     7  	// The name of the dedicated microservice engine.
     8  	Name string `json:"name"`
     9  	// The Job ID.
    10  	JobId int `json:"jobId"`
    11  }
    12  
    13  // Engine is the structure that represents the details of the Microservice engine.
    14  type Engine struct {
    15  	// The ID of the dedicated microservice engine.
    16  	ID string `json:"id"`
    17  	// The name of the dedicated microservice engine.
    18  	Name string `json:"name"`
    19  	// The project ID to which the dedicated microservice engine belongs.
    20  	ProjectId string `json:"projectId"`
    21  	// The enterprise project ID to which the dedicated microservice engine belongs.
    22  	EnterpriseProjectId string `json:"enterpriseProjectId"`
    23  	// The enterprise project name to which the dedicated microservice engine belongs.
    24  	EnterpriseProjectName string `json:"enterpriseProjectName"`
    25  	// The engine type.
    26  	Type string `json:"type"`
    27  	// The description of the dedicated microservice engine.
    28  	Description string `json:"description"`
    29  	// Whether the engine is the default engine.
    30  	IsDefault bool `json:"beDefault"`
    31  	// The flavor of the dedicated microservice engine.
    32  	//   cse.s1.small2: High availability 100 instance engine.
    33  	//   cse.s1.medium2: High availability 200 instance engine.
    34  	//   cse.s1.large2: High availability 500 instance engine.
    35  	//   cse.s1.xlarge2: High availability 2000 instance engine.
    36  	Flavor string `json:"flavor"`
    37  	// The charging mode of the dedicated microservice engine.
    38  	//   0: pre-paid.
    39  	//   1: post-paid.
    40  	//   2: free.
    41  	Payment string `json:"payment"`
    42  	// The authentication method for the dedicated microservice engine.
    43  	// The "RBAC" is security authentication, and the "NONE" is no authentication.
    44  	AuthType string `json:"authType"`
    45  	// The current status.
    46  	Status string `json:"status"`
    47  	// The CCE flavor of the dedicated microservice engine.
    48  	CceSpec CceSpec `json:"cceSpec"`
    49  	// The access address of the dedicated microservice engine.
    50  	ExternalEntrypoint ExternalEntrypoint `json:"externalEntrypoint"`
    51  	// The IP address of the public access for the dedicated microservice engine.
    52  	PublicAddress string `json:"publicAddress"`
    53  	// The current version of the dedicated microservice engine.
    54  	Version string `json:"version"`
    55  	// The latest version of the dedicated microservice engine.
    56  	LatestVersion string `json:"latestVersion"`
    57  	// The creation time of the dedicated microservice engine.
    58  	CreateTime int `json:"createTime"`
    59  	// The creator of the dedicated microservice engine.
    60  	CreateUser string `json:"createUser"`
    61  	// The latest task ID of the dedicated microservice engine.
    62  	LatestJobId int `json:"latestJobId"`
    63  	// Additional operations allowed by the dedicated microservice engine.
    64  	//   Delete
    65  	//   ForceDelete
    66  	//   Upgrade
    67  	//   Modify
    68  	//   Retry
    69  	EngineAdditionalActions []string `json:"engineAdditionalActions"`
    70  	// The deployment type of the dedicated microservice engine. The fixed value is "CSE2".
    71  	SpecType string `json:"specType"`
    72  	// Additional information for the dedicated microservice engine.
    73  	Reference Reference `json:"reference"`
    74  	//The list of virtual machine IDs used by the current microservice engine on the resource tenant side.
    75  	VmIds []string `json:"vmIds"`
    76  }
    77  
    78  // CceSpec is an object that represents the configuration of the associated CCE cluster.
    79  type CceSpec struct {
    80  	// The CCE flavor ID.
    81  	ID int `json:"id"`
    82  	// The ID of the dedicated microservice engine.
    83  	EngineId string `json:"engineId"`
    84  	// The deployment type of the dedicated microservice engine.
    85  	SpecType string `json:"specType"`
    86  	// The cluster ID of the dedicated microservice engine.
    87  	ClusterId string `json:"clusterId"`
    88  	// The list of the CCE nodes for the dedicated microservice engine.
    89  	ClusterNodes NodeDetails `json:"clusterNodes"`
    90  	// The CCE cluster flavor.
    91  	Flavor string `json:"flavor"`
    92  	// The region where the CCE cluster is located.
    93  	Region string `json:"region"`
    94  	// The CCE cluster version.
    95  	Version string `json:"version"`
    96  	// Additional parameters for the CCE cluster.
    97  	ExtendParam string `json:"extendParam"`
    98  }
    99  
   100  // NodeDetails is an object that represents the nodes list.
   101  type NodeDetails struct {
   102  	// The list of the CCE nodes.
   103  	Nodes []Node `json:"clusterNodes"`
   104  }
   105  
   106  // Node is an object that represents the details of the CCE node.
   107  type Node struct {
   108  	// The node ID.
   109  	ID string `json:"id"`
   110  	// The availability zone where the node is located.
   111  	AvailabilityZone string `json:"az"`
   112  	// The node IP.
   113  	IP string `json:"ip"`
   114  	// The node tag.
   115  	Label string `json:"label"`
   116  	// The node status.
   117  	Status string `json:"status"`
   118  }
   119  
   120  // ExternalEntrypoint is an object that represents the access information.
   121  type ExternalEntrypoint struct {
   122  	// The access address in the VPC on the tenant side of the dedicated microservice engine.
   123  	ExternalAddress string `json:"externalAddress"`
   124  	// The public network access address of the dedicated microservice engine, it needs to be enabled for public access.
   125  	PublicAddress string `json:"publicAddress"`
   126  	// Access address in the VPC on the tenant side of the component of the dedicated Microservice Engine.
   127  	ServiceEndpoint ServiceEndpoint `json:"serviceEndpoint"`
   128  	// The public network access address of the component of the dedicated Microservice Engine.
   129  	// The public network access needs to be enabled.
   130  	PublicServiceEndpoint ServiceEndpoint `json:"publicServiceEndpoint"`
   131  }
   132  
   133  // ServiceEndpoint is an object that represent the entrypoints of the service center and config center.
   134  type ServiceEndpoint struct {
   135  	// The entrypoint details of the service center.
   136  	ServiceCenter Detail `json:"serviceCenter"`
   137  	// The entrypoint details of the config center.
   138  	ConfigCenter Detail `json:"kie"`
   139  }
   140  
   141  // Detail is an object that represent the endpoint informations of the service center or config center.
   142  type Detail struct {
   143  	// The main ipv4 access address in the VPC of the Microservice Engine Exclusive Edition component.
   144  	MasterEntrypoint string `json:"masterEntrypoint"`
   145  	// The main ipv6 access address in the VPC of the Microservice Engine Exclusive Edition component.
   146  	MasterEntrypointIpv6 string `json:"masterEntrypointIpv6"`
   147  	// The ipv4 standby access address in the VPC of the Microservice Engine Exclusive Edition component.
   148  	SlaveEntrypoint string `json:"slaveEntrypoint"`
   149  	// The ipv6 standby access address in the VPC of the Microservice Engine Exclusive Edition component.
   150  	SlaveEntrypointIpv6 string `json:"slaveEntrypointIpv6"`
   151  	// The component type of the dedicated microservice engine.
   152  	Type string `json:"type"`
   153  }
   154  
   155  // Reference is an object that represent the additional parameters of the dedicated microservice engine.
   156  type Reference struct {
   157  	// The VPC name.
   158  	Vpc string `json:"vpc"`
   159  	// The VPC ID.
   160  	VpcId string `json:"vpcId"`
   161  	// List of deployment availability zones for the dedicated Microservice Engine.
   162  	AzList []string `json:"azList"`
   163  	// The subnet network ID of the dedicated microservice engine.
   164  	NetworkId string `json:"networkId"`
   165  	// The ipv4 subnet division.
   166  	SubnetCidr string `json:"subnetCidr"`
   167  	// The ipv6 subnet division.
   168  	SubnetCidV6 string `json:"subnetCidV6"`
   169  	// The subnet gateway.
   170  	SubnetGateway string `json:"subnetGateway"`
   171  	// The public network address ID of the dedicated microservice engine. Public network access needs to be enabled.
   172  	PublicIpId string `json:"publicIpId"`
   173  	// The total number of microservices that the plan can support.
   174  	ServiceLimit string `json:"serviceLimit"`
   175  	// The total number of microservice instances that the plan can support.
   176  	InstanceLimit string `json:"instanceLimit"`
   177  	// Additional parameters for the dedicated microservice engine.
   178  	Inputs map[string]interface{} `json:"inputs"`
   179  }
   180  
   181  // Job is an object that represent the details of the excuting job.
   182  type Job struct {
   183  	// The job ID.
   184  	Id int `json:"id"`
   185  	// The engine ID corresponding to the currently executing job.
   186  	EngineId string `json:"engineId"`
   187  	// The job type.
   188  	//   Create: create engine.
   189  	//   Delete: delete engine.
   190  	//   Upgrade: upgrade engine.
   191  	//   Modify:update engine flavor.
   192  	//   Configure:update engine configuration.
   193  	Type string `json:"type"`
   194  	// The job description.
   195  	Description string `json:"description"`
   196  	// The current execution status of the job.
   197  	//   Init:initialization.
   198  	//   Executing:executing.
   199  	//   Error:failed to execute.
   200  	//   Timeout:timeout to execute。
   201  	//   Finished:execution complete。
   202  	Status string `json:"status"`
   203  	// Whether the job is executing, 0 means not executing, 1 means executing.
   204  	Scheduling int `json:"scheduling"`
   205  	// The job creator.
   206  	CreateUser string `json:"createUser"`
   207  	// The time when the job started executing.
   208  	StartTime int `json:"startTime"`
   209  	// The time when the job ends.
   210  	EndTime int `json:"endTime"`
   211  	// The job execution context.
   212  	Context string `json:"context"`
   213  	// The processing stages of the job.
   214  	Tasks []Task `json:"tasks"`
   215  }
   216  
   217  // Task is an object that represent the details of the processing stages of the job.
   218  type Task struct {
   219  	// The current task name.
   220  	Name string `json:"taskName"`
   221  	// List of processing step names contained in the current processing stage.
   222  	Steps []string `json:"taskNames"`
   223  	// The current status.
   224  	Status string `json:"status"`
   225  	// Task processing phase start time.
   226  	StartTime int `json:"startTime"`
   227  	// Task processing phase end time.
   228  	EndTime int `json:"endTime"`
   229  	// The task metadata.
   230  	ExecutorBrief ExecutorBrief `json:"taskExecutorBrief"`
   231  	// Subtasks included in the processing phase.
   232  	SubTasks []SubTask `json:"tasks"`
   233  }
   234  
   235  // ExecutorBrief is an object that represent the job metadata.
   236  type ExecutorBrief struct {
   237  	// The subtask duration.
   238  	Duration int `json:"duration"`
   239  	// The subtask description.
   240  	Description string `json:"description"`
   241  }
   242  
   243  // SubTask is an object that represent the details of the subjob.
   244  type SubTask struct {
   245  	// The task ID to which the subtask belongs.
   246  	JobId int `json:"jobId"`
   247  	// The subtask ID.
   248  	Id int `json:"id"`
   249  	// The subtask type.
   250  	Type string `json:"type"`
   251  	// The executor of the subtask
   252  	Assigned string `json:"assigned"`
   253  	// The subtask name.
   254  	TaskName string `json:"taskName"`
   255  	// The name of the engine to which the subtask belongs.
   256  	EngineName string `json:"engineName"`
   257  	// The order in which the subtasks are executed, from small to large.
   258  	TaskOrder int `json:"taskOrder"`
   259  	// The subtask status
   260  	Status string `json:"status"`
   261  	// The subtask start time.
   262  	StartTime int `json:"startTime"`
   263  	// The subtask end time.
   264  	EndTime int `json:"endTime"`
   265  	// The subtask creation time.
   266  	CreateTime int `json:"createTime"`
   267  	// The subtask update time.
   268  	UpdateTime int `json:"updateTime"`
   269  	// Whether subtask is timeout.
   270  	Timeout int `json:"timeout"`
   271  	// The subtask details, auxiliary information generated during execution.
   272  	Log string `json:"log"`
   273  	// The subtask output information.
   274  	Output string `json:"output"`
   275  	// The subtask metadata.
   276  	ExecutorBrief ExecutorBrief `json:"taskExecutorBrief"`
   277  }
   278  
   279  type ErrorResponse struct {
   280  	// Error code
   281  	ErrCode string `json:"error_code"`
   282  	// Error message
   283  	ErrMessage string `json:"error_message"`
   284  }