| | |
| | | "strings" |
| | | |
| | | "basic.com/aps/aps_deploy.git/src/util" |
| | | "basic.com/aps/aps_deploy.git/src/rancher" |
| | | ) |
| | | |
| | | type Cluster struct { |
| | |
| | | SSHPort int `json:"sshPort"` |
| | | } |
| | | |
| | | type RancherConfig struct { |
| | | RancherURL string `json:"rancherURL"` |
| | | BearerToken string `json:"bearerToken"` |
| | | } |
| | | |
| | | type ClusterCreateRequest struct { |
| | | Name string `json:"name"` |
| | |
| | | return true, nil |
| | | } |
| | | |
| | | func CreateCluster(rancherConfig RancherConfig, clusterName string) error { |
| | | func CreateCluster(rancherConfig rancher.RancherConfig, clusterName string) error { |
| | | requestBody := createClusterData(clusterName) |
| | | |
| | | url := fmt.Sprintf("%s/v3/clusters", rancherConfig.RancherURL) |