var result ClusterListResponseData = ClustersGet(ctx)
.Name(name)
.Execute()
List the DataPlatformClusters
Example
package main
import (
"context"
"fmt"
"os"
dataplatform "github.com/ionos-cloud/sdk-go-bundle/products/dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
name := "name_example" // string | Response filter to list only the clusters which include the specified name. The value is case insensitive and matched on the `name` property of the cluster. The input is limited to 63 characters with alphanumeric characters ([a-z0-9A-Z]), dashes (-), underscores (_), and dots (.) allowed. (optional)
configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := dataplatform.NewAPIClient(configuration)
resource, resp, err := apiClient.DataPlatformClusterApi.ClustersGet(context.Background()).Name(name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DataPlatformClusterApi.ClustersGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
// response from `ClustersGet`: ClusterListResponseData
fmt.Fprintf(os.Stdout, "Response from `DataPlatformClusterApi.ClustersGet`: %v\n", resource)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to an apiClustersGetRequest struct via the builder pattern
Name
Type
Description
Notes
name
string
Response filter to list only the clusters which include the specified name. The value is case insensitive and matched on the `name` property of the cluster. The input is limited to 63 characters with alphanumeric characters ([a-z0-9A-Z]), dashes (-), underscores (_), and dots (.) allowed.
var result map[string]interface{} = ClustersKubeconfigFindByClusterId(ctx, clusterId)
.Execute()
Read the Kubeconfig
Example
package main
import (
"context"
"fmt"
"os"
dataplatform "github.com/ionos-cloud/sdk-go-bundle/products/dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
clusterId := TODO // string | The unique ID of the cluster. Must conform to the UUID format.
configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := dataplatform.NewAPIClient(configuration)
resource, resp, err := apiClient.DataPlatformClusterApi.ClustersKubeconfigFindByClusterId(context.Background(), clusterId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DataPlatformClusterApi.ClustersKubeconfigFindByClusterId``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
// response from `ClustersKubeconfigFindByClusterId`: map[string]interface{}
fmt.Fprintf(os.Stdout, "Response from `DataPlatformClusterApi.ClustersKubeconfigFindByClusterId`: %v\n", resource)
}
Path Parameters
Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
clusterId
The unique ID of the cluster. Must conform to the UUID format.
Other Parameters
Other parameters are passed through a pointer to an apiClustersKubeconfigFindByClusterIdRequest struct via the builder pattern
Return type
map[string]interface{}
HTTP request headers
Content-Type: Not defined
Accept: application/json
ClustersPatch
var result ClusterResponseData = ClustersPatch(ctx, clusterId)
.PatchClusterRequest(patchClusterRequest)
.Execute()
Partially Modify a DataPlatformCluster
Example
package main
import (
"context"
"fmt"
"os"
dataplatform "github.com/ionos-cloud/sdk-go-bundle/products/dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
clusterId := TODO // string | The unique ID of the cluster. Must conform to the UUID format.
patchClusterRequest := *openapiclient.NewPatchClusterRequest(*openapiclient.NewPatchClusterProperties()) // PatchClusterRequest | Request payload with the properties that shall be applied to an existing DataPlatformCluster.
configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := dataplatform.NewAPIClient(configuration)
resource, resp, err := apiClient.DataPlatformClusterApi.ClustersPatch(context.Background(), clusterId).PatchClusterRequest(patchClusterRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DataPlatformClusterApi.ClustersPatch``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
// response from `ClustersPatch`: ClusterResponseData
fmt.Fprintf(os.Stdout, "Response from `DataPlatformClusterApi.ClustersPatch`: %v\n", resource)
}
Path Parameters
Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
clusterId
The unique ID of the cluster. Must conform to the UUID format.
Other Parameters
Other parameters are passed through a pointer to an apiClustersPatchRequest struct via the builder pattern
Name
Type
Description
Notes
patchClusterRequest
Request payload with the properties that shall be applied to an existing DataPlatformCluster.
var result ClusterResponseData = ClustersPost(ctx)
.CreateClusterRequest(createClusterRequest)
.Execute()
Create a DataPlatformCluster
Example
package main
import (
"context"
"fmt"
"os"
dataplatform "github.com/ionos-cloud/sdk-go-bundle/products/dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
createClusterRequest := *openapiclient.NewCreateClusterRequest(*openapiclient.NewCreateClusterProperties("my-cluster", "DatacenterId_example")) // CreateClusterRequest | Request payload with the properties that defines a new DataPlatformCluster and the credentials to interact with the PaaS API to create it.
configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := dataplatform.NewAPIClient(configuration)
resource, resp, err := apiClient.DataPlatformClusterApi.ClustersPost(context.Background()).CreateClusterRequest(createClusterRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DataPlatformClusterApi.ClustersPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
// response from `ClustersPost`: ClusterResponseData
fmt.Fprintf(os.Stdout, "Response from `DataPlatformClusterApi.ClustersPost`: %v\n", resource)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to an apiClustersPostRequest struct via the builder pattern
Name
Type
Description
Notes
createClusterRequest
Request payload with the properties that defines a new DataPlatformCluster and the credentials to interact with the PaaS API to create it.