VersioningApi

All URIs are relative to https://s3.eu-central-3.ionoscloud.com

MethodHTTP requestDescription

Get /{Bucket}?versioning

GetBucketVersioning

Put /{Bucket}?versioning

PutBucketVersioning

GetBucketVersioning

var result GetBucketVersioningOutput = GetBucketVersioning(ctx, bucket)
                      .Execute()

GetBucketVersioning

Example

package main

import (
    "context"
    "fmt"
    "os"

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

func main() {
    bucket := "bucket_example" // string | 

    configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := ionoscloud.NewAPIClient(configuration)
    resource, resp, err := apiClient.VersioningApi.GetBucketVersioning(context.Background(), bucket).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VersioningApi.GetBucketVersioning``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `GetBucketVersioning`: GetBucketVersioningOutput
    fmt.Fprintf(os.Stdout, "Response from `VersioningApi.GetBucketVersioning`: %v\n", resource)
}

Path Parameters

NameTypeDescriptionNotes

ctx

context.Context

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

bucket

string

Other Parameters

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

Return type

GetBucketVersioningOutput

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/xml

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "VersioningApiService.GetBucketVersioning" 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{
    "VersioningApiService.GetBucketVersioning": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "VersioningApiService.GetBucketVersioning": {
    "port": "8443",
},
})

PutBucketVersioning

var result  = PutBucketVersioning(ctx, bucket)
                      .PutBucketVersioningRequest(putBucketVersioningRequest)
                      .ContentMD5(contentMD5)
                      .Execute()

PutBucketVersioning

Example

package main

import (
    "context"
    "fmt"
    "os"

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

func main() {
    bucket := "bucket_example" // string | 
    putBucketVersioningRequest := *openapiclient.NewPutBucketVersioningRequest() // PutBucketVersioningRequest | 
    contentMD5 := "contentMD5_example" // string |  (optional)

    configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := ionoscloud.NewAPIClient(configuration)
    resource, resp, err := apiClient.VersioningApi.PutBucketVersioning(context.Background(), bucket).PutBucketVersioningRequest(putBucketVersioningRequest).ContentMD5(contentMD5).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VersioningApi.PutBucketVersioning``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
}

Path Parameters

NameTypeDescriptionNotes

ctx

context.Context

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

bucket

string

Other Parameters

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

NameTypeDescriptionNotes

putBucketVersioningRequest

contentMD5

string

Return type

(empty response body)

HTTP request headers

  • Content-Type: application/xml

  • Accept: application/xml

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "VersioningApiService.PutBucketVersioning" 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{
    "VersioningApiService.PutBucketVersioning": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "VersioningApiService.PutBucketVersioning": {
    "port": "8443",
},
})

Last updated