var result ClusterListResponseData=ClustersGet(ctx) .Name(name) .Execute()
List the DataPlatformClusters
Example
packagemainimport ("context""fmt""os" dataplatform "github.com/ionos-cloud/sdk-go-bundle/products/dataplatform""github.com/ionos-cloud/sdk-go-bundle/shared")funcmain() { 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.
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
packagemainimport ("context""fmt""os" dataplatform "github.com/ionos-cloud/sdk-go-bundle/products/dataplatform""github.com/ionos-cloud/sdk-go-bundle/shared")funcmain() { 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.
var result ClusterResponseData=ClustersPost(ctx) .CreateClusterRequest(createClusterRequest) .Execute()
Create a DataPlatformCluster
Example
packagemainimport ("context""fmt""os" dataplatform "github.com/ionos-cloud/sdk-go-bundle/products/dataplatform""github.com/ionos-cloud/sdk-go-bundle/shared")funcmain() { 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