Skip to content

Latest commit

 

History

History
97 lines (67 loc) · 3.38 KB

SnapshotsApi.md

File metadata and controls

97 lines (67 loc) · 3.38 KB

\SnapshotsApi

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

Method HTTP request Description
ClustersSnapshotsGet Get /clusters/{clusterId}/snapshots Get the snapshots of your cluster

ClustersSnapshotsGet

var result SnapshotList = ClustersSnapshotsGet(ctx, clusterId)
                      .Limit(limit)
                      .Offset(offset)
                      .Execute()

Get the snapshots of your 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.
    limit := int32(100) // int32 | The maximum number of elements to return. Use together with 'offset' for pagination. (optional) (default to 100)
    offset := int32(200) // int32 | The first element to return. Use together with 'limit' for pagination. (optional) (default to 0)

    configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := ionoscloud.NewAPIClient(configuration)
    resource, resp, err := apiClient.SnapshotsApi.ClustersSnapshotsGet(context.Background(), clusterId).Limit(limit).Offset(offset).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `SnapshotsApi.ClustersSnapshotsGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `ClustersSnapshotsGet`: SnapshotList
    fmt.Fprintf(os.Stdout, "Response from `SnapshotsApi.ClustersSnapshotsGet`: %v\n", resource)
}

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 apiClustersSnapshotsGetRequest 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

SnapshotList

HTTP request headers

  • Content-Type: Not defined
  • 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 "SnapshotsApiService.ClustersSnapshotsGet" 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{
    "SnapshotsApiService.ClustersSnapshotsGet": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "SnapshotsApiService.ClustersSnapshotsGet": {
    "port": "8443",
},
})