Skip to content

Commit

Permalink
Parse the new clusterSecret value returned by createCluster and updat…
Browse files Browse the repository at this point in the history
…eCluster
  • Loading branch information
Roger Lam authored and lamroger committed Aug 2, 2021
1 parent 1f77027 commit 926a15d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ var DefaultClusterType = 3

type Cluster struct {
APIToken APIToken `json:"apiToken"`
ClusterSecret string `json:"clusterSecret,omitempty"`
Domain string `json:"fqdn"`
Platform ClusterPlatformType `json:"cloud"`
Name string `json:"name"`
Expand Down Expand Up @@ -139,12 +140,13 @@ type ClusterUpdateAttributeParams struct {
type ClusterUpdateParams struct {
RequestParams

Attributes ClusterUpdateAttributeParams `json:"attributes,omitempty"`
CreateNewToken bool `json:"createNewToken,omitempty"`
RegistryAttributes ClusterUpdateRegistryParams `json:"registryAttributes,omitempty"`
ID string `json:"id"`
RetryWorkflow bool `json:"retryWorkflow,omitempty"`
S3Attributes ClusterUpdateS3Params `json:"s3Attributes,omitempty"`
Attributes ClusterUpdateAttributeParams `json:"attributes,omitempty"`
CreateNewToken bool `json:"createNewToken,omitempty"`
CreateNewClusterSecret bool `json:"createNewClusterSecret,omitempty"`
RegistryAttributes ClusterUpdateRegistryParams `json:"registryAttributes,omitempty"`
ID string `json:"id"`
RetryWorkflow bool `json:"retryWorkflow,omitempty"`
S3Attributes ClusterUpdateS3Params `json:"s3Attributes,omitempty"`
}

type ClusterUpdateRegistryParams struct {
Expand Down Expand Up @@ -172,7 +174,7 @@ func (c Client) CreateCluster(params ClusterCreateParams) (Cluster, error) {
cluster := Cluster{}
params.Type = DefaultClusterType

url := fmt.Sprintf("/clusters/createCluster")
url := "/clusters/createCluster"
_, err := c.Request("POST", url, params, &cluster, params.RequestParams)

return cluster, err
Expand All @@ -190,7 +192,7 @@ func (c Client) GetCluster(id string, params ClusterGetParams) (Cluster, error)
func (c Client) GetClusters(params ClusterListParams) ([]Cluster, error) {
clusters := []Cluster{}

url := fmt.Sprintf("/clusters/getClusters")
url := "/clusters/getClusters"
_, err := c.Request("GET", url, params, &clusters, params.RequestParams)

return clusters, err
Expand All @@ -199,7 +201,7 @@ func (c Client) GetClusters(params ClusterListParams) ([]Cluster, error) {
func (c Client) UpdateCluster(id string, params ClusterUpdateParams) (Cluster, error) {
cluster := Cluster{}

url := fmt.Sprintf("/clusters/updateCluster")
url := "/clusters/updateCluster"
_, err := c.Request("POST", url, params, &cluster, params.RequestParams)

return cluster, err
Expand Down

0 comments on commit 926a15d

Please sign in to comment.