Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-5483: Implement hybrid APIs #139

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/models/v1_aws_cloud_config_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 75 additions & 0 deletions api/models/v1_aws_hybrid_machine_pool.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 18 additions & 18 deletions api/spec/palette-apis-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -31944,7 +31944,7 @@
"hybridMachinePools": {
"type": "array",
"items": {
"$ref": "#/definitions/v1EksHybridMachinePool"
"$ref": "#/definitions/v1AwsHybridMachinePool"
}
},
"machinePoolConfig": {
Expand Down Expand Up @@ -32184,6 +32184,23 @@
}
}
},
"v1AwsHybridMachinePool": {
"description": "Machine pool reference of cloud config of cluster deployed by hybrid cluster",
"type": "object",
"properties": {
"poolCloudType": {
"$ref": "#/definitions/v1HybridPoolClusterCloudType"
},
"poolName": {
"description": "Machine pool name",
"type": "string"
},
"poolUid": {
"description": "Machine pool uid",
"type": "string"
}
}
},
"v1AwsIamPolicy": {
"description": "Aws policy",
"type": "object",
Expand Down Expand Up @@ -40392,23 +40409,6 @@
}
}
},
"v1EksHybridMachinePool": {
"description": "Machine pool reference of cloud config of cluster deployed by hybrid EKS cluster",
"type": "object",
"properties": {
"poolCloudType": {
"$ref": "#/definitions/v1HybridPoolClusterCloudType"
},
"poolName": {
"description": "Machine pool name",
"type": "string"
},
"poolUid": {
"description": "Machine pool uid",
"type": "string"
}
}
},
"v1EksMachineCloudConfigEntity": {
"properties": {
"awsLaunchTemplate": {
Expand Down
36 changes: 18 additions & 18 deletions api/spec/palette.json
Original file line number Diff line number Diff line change
Expand Up @@ -31961,7 +31961,7 @@
"hybridMachinePools": {
"type": "array",
"items": {
"$ref": "#/definitions/v1EksHybridMachinePool"
"$ref": "#/definitions/v1AwsHybridMachinePool"
}
},
"machinePoolConfig": {
Expand Down Expand Up @@ -32201,6 +32201,23 @@
}
}
},
"v1AwsHybridMachinePool": {
"description": "Machine pool reference of cloud config of cluster deployed by hybrid cluster",
"type": "object",
"properties": {
"poolCloudType": {
"$ref": "#/definitions/v1HybridPoolClusterCloudType"
},
"poolName": {
"description": "Machine pool name",
"type": "string"
},
"poolUid": {
"description": "Machine pool uid",
"type": "string"
}
}
},
"v1AwsIamPolicy": {
"description": "Aws policy",
"type": "object",
Expand Down Expand Up @@ -40409,23 +40426,6 @@
}
}
},
"v1EksHybridMachinePool": {
"description": "Machine pool reference of cloud config of cluster deployed by hybrid EKS cluster",
"type": "object",
"properties": {
"poolCloudType": {
"$ref": "#/definitions/v1HybridPoolClusterCloudType"
},
"poolName": {
"description": "Machine pool name",
"type": "string"
},
"poolUid": {
"description": "Machine pool uid",
"type": "string"
}
}
},
"v1EksMachineCloudConfigEntity": {
"properties": {
"awsLaunchTemplate": {
Expand Down
17 changes: 17 additions & 0 deletions client/hybrid.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package client

import (
clientv1 "github.com/spectrocloud/palette-sdk-go/api/client/v1"
"github.com/spectrocloud/palette-sdk-go/api/models"
)

// EnableClusterHybridSettings enables hybrid mode on a cluster.
func (h *V1Client) EnableClusterHybridSettings(uid string) error {
params := clientv1.NewV1SpectroClustersUIDHybridSettingsParamsWithContext(h.ctx).
WithBody(&models.V1ClusterHybridSettingsEntity{
Enable: true,
}).WithUID(uid)

_, err := h.Client.V1SpectroClustersUIDHybridSettings(params)
return err
}
Loading