Skip to content

Latest commit

 

History

History
92 lines (62 loc) · 2.9 KB

RestoresApi.md

File metadata and controls

92 lines (62 loc) · 2.9 KB

\RestoresApi

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

Method HTTP request Description
ClustersRestorePost Post /clusters/{clusterId}/restore In-place restore of a cluster

ClustersRestorePost

var result  = ClustersRestorePost(ctx, clusterId)
                      .CreateRestoreRequest(createRestoreRequest)
                      .Execute()

In-place restore of a cluster

Example

package main

import (
    "context"
    "fmt"
    "os"

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

func main() {
    clusterId := "clusterId_example" // string | The unique ID of the cluster.
    createRestoreRequest := *openapiclient.NewCreateRestoreRequest() // CreateRestoreRequest | The restore request to create.

    configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := ionoscloud.NewAPIClient(configuration)
    resource, resp, err := apiClient.RestoresApi.ClustersRestorePost(context.Background(), clusterId).CreateRestoreRequest(createRestoreRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `RestoresApi.ClustersRestorePost``: %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.

Other Parameters

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

Name Type Description Notes
createRestoreRequest CreateRestoreRequest The restore request to create.

Return type

(empty response body)

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "RestoresApiService.ClustersRestorePost" string. Similar rules for overriding default operation server index and variables apply by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), {packageName}.ContextOperationServerIndices, map[string]int{
    "RestoresApiService.ClustersRestorePost": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "RestoresApiService.ClustersRestorePost": {
    "port": "8443",
},
})