DatabasesApi

All URIs are relative to https://api.ionos.com/databases/postgresql

Method
HTTP request
Description

Delete /clusters/{clusterId}/databases/{databasename}

Delete database

Get /clusters/{clusterId}/databases/{databasename}

Get database

Get /clusters/{clusterId}/databases

List databases

Post /clusters/{clusterId}/databases

Create a database

DatabasesDelete

var result  = DatabasesDelete(ctx, clusterId, databasename)
                      .Execute()

Delete database

Example

package main

import (
    "context"
    "fmt"
    "os"

    ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-postgres"
)

func main() {
    clusterId := "498ae72f-411f-11eb-9d07-046c59cc737e" // string | The unique ID of the cluster.
    databasename := "benjamindb" // string | The database name.

    configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := ionoscloud.NewAPIClient(configuration)
    resp, err := apiClient.DatabasesApi.DatabasesDelete(context.Background(), clusterId, databasename).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DatabasesApi.DatabasesDelete``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
}

Path Parameters

Name
Type
Description
Notes

ctx

context.Context

context for authentication, logging, cancellation, deadlines, tracing, etc.

clusterId

string

The unique ID of the cluster.

databasename

string

The database name.

Other Parameters

Other parameters are passed through a pointer to an apiDatabasesDeleteRequest struct via the builder pattern

Return type

(empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

DatabasesGet

Get database

Example

Path Parameters

Name
Type
Description
Notes

ctx

context.Context

context for authentication, logging, cancellation, deadlines, tracing, etc.

clusterId

string

The unique ID of the cluster.

databasename

string

The database name.

Other Parameters

Other parameters are passed through a pointer to an apiDatabasesGetRequest struct via the builder pattern

Return type

DatabaseResource

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

DatabasesList

List databases

Example

Path Parameters

Name
Type
Description
Notes

ctx

context.Context

context for authentication, logging, cancellation, deadlines, tracing, etc.

clusterId

string

The unique ID of the cluster.

Other Parameters

Other parameters are passed through a pointer to an apiDatabasesListRequest struct via the builder pattern

Name
Type
Description
Notes

limit

int32

The maximum number of elements to return. Use together with 'offset' for pagination.

[default to 100]

offset

int32

The first element to return. Use together with 'limit' for pagination.

[default to 0]

Return type

DatabaseList

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

DatabasesPost

Create a database

Example

Path Parameters

Name
Type
Description
Notes

ctx

context.Context

context for authentication, logging, cancellation, deadlines, tracing, etc.

clusterId

string

The unique ID of the cluster.

Other Parameters

Other parameters are passed through a pointer to an apiDatabasesPostRequest struct via the builder pattern

Name
Type
Description
Notes

database

a database to create

Return type

DatabaseResource

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

Last updated