All URIs are relative to https://api.ionos.com/databases/postgresql
Method HTTP request Description Get /clusters/{clusterId}/postgresversions
Delete /clusters/{clusterId}
Get /clusters/{clusterId}
Patch /clusters/{clusterId}
Get /clusters/postgresversions
ClusterPostgresVersionsGet
Copy var result PostgresVersionList = ClusterPostgresVersionsGet (ctx, clusterId)
. Execute ()
List PostgreSQL versions
Example
Copy package main
import (
"context"
"fmt"
"os"
psql "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/psql"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main () {
clusterId := "clusterId_example" // string | The unique ID of the cluster.
configuration := shared. NewConfiguration ( "USERNAME" , "PASSWORD" , "TOKEN" , "HOST_URL" )
apiClient := psql. NewAPIClient (configuration)
resource, resp, err := apiClient.ClustersApi. ClusterPostgresVersionsGet (context. Background (), clusterId). Execute ()
if err != nil {
fmt. Fprintf (os.Stderr, "Error when calling `ClustersApi.ClusterPostgresVersionsGet``: %v \n" , err)
fmt. Fprintf (os.Stderr, "Full HTTP response: %v \n" , resp)
}
// response from `ClusterPostgresVersionsGet`: PostgresVersionList
fmt. Fprintf (os.Stdout, "Response from `ClustersApi.ClusterPostgresVersionsGet`: %v \n" , resource)
}
Path Parameters
Name Type Description Notes context for authentication, logging, cancellation, deadlines, tracing, etc.
The unique ID of the cluster.
Other Parameters
Other parameters are passed through a pointer to an apiClusterPostgresVersionsGetRequest struct via the builder pattern
Return type
PostgresVersionList
Content-Type : Not defined
ClustersDelete
Copy var result ClusterResponse = ClustersDelete (ctx, clusterId)
. Execute ()
Delete a cluster
Example
Copy package main
import (
"context"
"fmt"
"os"
psql "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/psql"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main () {
clusterId := "clusterId_example" // string | The unique ID of the cluster.
configuration := shared. NewConfiguration ( "USERNAME" , "PASSWORD" , "TOKEN" , "HOST_URL" )
apiClient := psql. NewAPIClient (configuration)
resource, resp, err := apiClient.ClustersApi. ClustersDelete (context. Background (), clusterId). Execute ()
if err != nil {
fmt. Fprintf (os.Stderr, "Error when calling `ClustersApi.ClustersDelete``: %v \n" , err)
fmt. Fprintf (os.Stderr, "Full HTTP response: %v \n" , resp)
}
// response from `ClustersDelete`: ClusterResponse
fmt. Fprintf (os.Stdout, "Response from `ClustersApi.ClustersDelete`: %v \n" , resource)
}
Path Parameters
Name Type Description Notes context for authentication, logging, cancellation, deadlines, tracing, etc.
The unique ID of the cluster.
Other Parameters
Other parameters are passed through a pointer to an apiClustersDeleteRequest struct via the builder pattern
Return type
ClusterResponse
Content-Type : Not defined
ClustersFindById
Copy var result ClusterResponse = ClustersFindById (ctx, clusterId)
. Execute ()
Fetch a cluster
Example
Copy package main
import (
"context"
"fmt"
"os"
psql "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/psql"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main () {
clusterId := "clusterId_example" // string | The unique ID of the cluster.
configuration := shared. NewConfiguration ( "USERNAME" , "PASSWORD" , "TOKEN" , "HOST_URL" )
apiClient := psql. NewAPIClient (configuration)
resource, resp, err := apiClient.ClustersApi. ClustersFindById (context. Background (), clusterId). Execute ()
if err != nil {
fmt. Fprintf (os.Stderr, "Error when calling `ClustersApi.ClustersFindById``: %v \n" , err)
fmt. Fprintf (os.Stderr, "Full HTTP response: %v \n" , resp)
}
// response from `ClustersFindById`: ClusterResponse
fmt. Fprintf (os.Stdout, "Response from `ClustersApi.ClustersFindById`: %v \n" , resource)
}
Path Parameters
Name Type Description Notes context for authentication, logging, cancellation, deadlines, tracing, etc.
The unique ID of the cluster.
Other Parameters
Other parameters are passed through a pointer to an apiClustersFindByIdRequest struct via the builder pattern
Return type
ClusterResponse
Content-Type : Not defined
ClustersGet
Copy var result ClusterList = ClustersGet (ctx)
. FilterName (filterName)
. Execute ()
List clusters
Example
Copy package main
import (
"context"
"fmt"
"os"
psql "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/psql"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main () {
filterName := "filterName_example" // string | Response filter to list only the PostgreSQL clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field. (optional)
configuration := shared. NewConfiguration ( "USERNAME" , "PASSWORD" , "TOKEN" , "HOST_URL" )
apiClient := psql. NewAPIClient (configuration)
resource, resp, err := apiClient.ClustersApi. ClustersGet (context. Background ()). FilterName (filterName). Execute ()
if err != nil {
fmt. Fprintf (os.Stderr, "Error when calling `ClustersApi.ClustersGet``: %v \n" , err)
fmt. Fprintf (os.Stderr, "Full HTTP response: %v \n" , resp)
}
// response from `ClustersGet`: ClusterList
fmt. Fprintf (os.Stdout, "Response from `ClustersApi.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 Response filter to list only the PostgreSQL clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field.
Return type
ClusterList
Content-Type : Not defined
ClustersPatch
Copy var result ClusterResponse = ClustersPatch (ctx, clusterId)
. PatchClusterRequest (patchClusterRequest)
. Execute ()
Patch a cluster
Example
Copy package main
import (
"context"
"fmt"
"os"
psql "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/psql"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main () {
clusterId := "clusterId_example" // string | The unique ID of the cluster.
patchClusterRequest := * openapiclient. NewPatchClusterRequest () // PatchClusterRequest | The modified cluster.
configuration := shared. NewConfiguration ( "USERNAME" , "PASSWORD" , "TOKEN" , "HOST_URL" )
apiClient := psql. NewAPIClient (configuration)
resource, resp, err := apiClient.ClustersApi.ClustersPatch(context.Background(), clusterId).PatchClusterRequest(patchClusterRequest).Execute()
if err != nil {
fmt. Fprintf (os.Stderr, "Error when calling `ClustersApi.ClustersPatch``: %v \n" , err)
fmt. Fprintf (os.Stderr, "Full HTTP response: %v \n" , resp)
}
// response from `ClustersPatch`: ClusterResponse
fmt. Fprintf (os.Stdout, "Response from `ClustersApi.ClustersPatch`: %v \n" , resource)
}
Path Parameters
Name Type Description Notes context for authentication, logging, cancellation, deadlines, tracing, etc.
The unique ID of the cluster.
Other Parameters
Other parameters are passed through a pointer to an apiClustersPatchRequest struct via the builder pattern
Return type
ClusterResponse
Content-Type : application/json
ClustersPost
Copy var result ClusterResponse = ClustersPost (ctx)
. CreateClusterRequest (createClusterRequest)
. Execute ()
Create a cluster
Example
Copy package main
import (
"context"
"fmt"
"os"
psql "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/psql"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main () {
createClusterRequest := *openapiclient.NewCreateClusterRequest() // CreateClusterRequest | The cluster to be created.
configuration := shared. NewConfiguration ( "USERNAME" , "PASSWORD" , "TOKEN" , "HOST_URL" )
apiClient := psql. NewAPIClient (configuration)
resource, resp, err := apiClient.ClustersApi.ClustersPost(context.Background()).CreateClusterRequest(createClusterRequest).Execute()
if err != nil {
fmt. Fprintf (os.Stderr, "Error when calling `ClustersApi.ClustersPost``: %v \n" , err)
fmt. Fprintf (os.Stderr, "Full HTTP response: %v \n" , resp)
}
// response from `ClustersPost`: ClusterResponse
fmt. Fprintf (os.Stdout, "Response from `ClustersApi.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 The cluster to be created.
Return type
ClusterResponse
Content-Type : application/json
PostgresVersionsGet
Copy var result PostgresVersionList = PostgresVersionsGet (ctx)
. Execute ()
List PostgreSQL versions
Example
Copy package main
import (
"context"
"fmt"
"os"
psql "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/psql"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main () {
configuration := shared. NewConfiguration ( "USERNAME" , "PASSWORD" , "TOKEN" , "HOST_URL" )
apiClient := psql. NewAPIClient (configuration)
resource, resp, err := apiClient.ClustersApi. PostgresVersionsGet (context. Background ()). Execute ()
if err != nil {
fmt. Fprintf (os.Stderr, "Error when calling `ClustersApi.PostgresVersionsGet``: %v \n" , err)
fmt. Fprintf (os.Stderr, "Full HTTP response: %v \n" , resp)
}
// response from `PostgresVersionsGet`: PostgresVersionList
fmt. Fprintf (os.Stdout, "Response from `ClustersApi.PostgresVersionsGet`: %v \n" , resource)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to an apiPostgresVersionsGetRequest struct via the builder pattern
Return type
PostgresVersionList
Content-Type : Not defined