Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

ionos-cloud/sdk-go-s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning

There is a new repo https://github.com/ionos-cloud/sdk-go-object-storage replacing this one. Please use that instead.

Go API client for ionoscloud

Overview

The IONOS S3 Object Storage API for contract-owned buckets is a REST-based API that allows developers and applications to interact directly with IONOS' scalable storage solution, leveraging the S3 protocol for object storage operations. Its design ensures seamless compatibility with existing tools and libraries tailored for S3 systems.

API References

User documentation

IONOS S3 Object Storage User Guide

Endpoints for contract-owned buckets

Location Region Name Bucket Type Endpoint
Berlin, Germany eu-central-3 Contract-owned https://s3.eu-central-3.ionoscloud.com

Changelog

  • 30.05.2024 Initial version

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

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

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), ionoscloud.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), ionoscloud.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

Documentation for API Endpoints

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

Class Method HTTP request Description
BucketsApi CreateBucket Put /{Bucket} CreateBucket
BucketsApi DeleteBucket Delete /{Bucket} DeleteBucket
BucketsApi GetBucketLocation Get /{Bucket}?location GetBucketLocation
BucketsApi HeadBucket Head /{Bucket} HeadBucket
BucketsApi ListBuckets Get / ListBuckets
CORSApi DeleteBucketCors Delete /{Bucket}?cors DeleteBucketCors
CORSApi GetBucketCors Get /{Bucket}?cors GetBucketCors
CORSApi PutBucketCors Put /{Bucket}?cors PutBucketCors
EncryptionApi DeleteBucketEncryption Delete /{Bucket}?encryption DeleteBucketEncryption
EncryptionApi GetBucketEncryption Get /{Bucket}?encryption GetBucketEncryption
EncryptionApi PutBucketEncryption Put /{Bucket}?encryption PutBucketEncryption
LifecycleApi DeleteBucketLifecycle Delete /{Bucket}?lifecycle DeleteBucketLifecycle
LifecycleApi GetBucketLifecycle Get /{Bucket}?lifecycle GetBucketLifecycle
LifecycleApi PutBucketLifecycle Put /{Bucket}?lifecycle PutBucketLifecycle
ObjectLockApi GetObjectLegalHold Get /{Bucket}/{Key}?legal-hold GetObjectLegalHold
ObjectLockApi GetObjectLockConfiguration Get /{Bucket}?object-lock GetObjectLockConfiguration
ObjectLockApi GetObjectRetention Get /{Bucket}/{Key}?retention GetObjectRetention
ObjectLockApi PutObjectLegalHold Put /{Bucket}/{Key}?legal-hold PutObjectLegalHold
ObjectLockApi PutObjectLockConfiguration Put /{Bucket}?object-lock PutObjectLockConfiguration
ObjectLockApi PutObjectRetention Put /{Bucket}/{Key}?retention PutObjectRetention
ObjectsApi CopyObject Put /{Bucket}/{Key}?x-amz-copy-source CopyObject
ObjectsApi DeleteObject Delete /{Bucket}/{Key} DeleteObject
ObjectsApi DeleteObjects Post /{Bucket}?delete DeleteObjects
ObjectsApi GetObject Get /{Bucket}/{Key} GetObject
ObjectsApi HeadObject Head /{Bucket}/{Key} HeadObject
ObjectsApi ListObjects Get /{Bucket} ListObjects
ObjectsApi ListObjectsV2 Get /{Bucket}?list-type=2 ListObjectsV2
ObjectsApi OPTIONSObject Options /{Bucket} OPTIONSObject
ObjectsApi POSTObject Post /{Bucket}/{Key} POSTObject
ObjectsApi PutObject Put /{Bucket}/{Key} PutObject
PolicyApi DeleteBucketPolicy Delete /{Bucket}?policy DeleteBucketPolicy
PolicyApi GetBucketPolicy Get /{Bucket}?policy GetBucketPolicy
PolicyApi GetBucketPolicyStatus Get /{Bucket}?policyStatus GetBucketPolicyStatus
PolicyApi PutBucketPolicy Put /{Bucket}?policy PutBucketPolicy
PublicAccessBlockApi DeletePublicAccessBlock Delete /{Bucket}?publicAccessBlock DeletePublicAccessBlock
PublicAccessBlockApi GetPublicAccessBlock Get /{Bucket}?publicAccessBlock GetPublicAccessBlock
PublicAccessBlockApi PutPublicAccessBlock Put /{Bucket}?publicAccessBlock PutPublicAccessBlock
ReplicationApi GetBucketReplication Get /{Bucket}?replication GetBucketReplication
TaggingApi DeleteBucketTagging Delete /{Bucket}?tagging DeleteBucketTagging
TaggingApi DeleteObjectTagging Delete /{Bucket}/{Key}?tagging DeleteObjectTagging
TaggingApi GetBucketTagging Get /{Bucket}?tagging GetBucketTagging
TaggingApi GetObjectTagging Get /{Bucket}/{Key}?tagging GetObjectTagging
TaggingApi PutBucketTagging Put /{Bucket}?tagging PutBucketTagging
TaggingApi PutObjectTagging Put /{Bucket}/{Key}?tagging PutObjectTagging
UploadsApi AbortMultipartUpload Delete /{Bucket}/{Key}?uploadId AbortMultipartUpload
UploadsApi CompleteMultipartUpload Post /{Bucket}/{Key}?uploadId CompleteMultipartUpload
UploadsApi CreateMultipartUpload Post /{Bucket}/{Key}?uploads CreateMultipartUpload
UploadsApi ListMultipartUploads Get /{Bucket}?uploads ListMultipartUploads
UploadsApi ListParts Get /{Bucket}/{Key}?uploadId ListParts
UploadsApi UploadPart Put /{Bucket}/{Key}?uploadId UploadPart
UploadsApi UploadPartCopy Put /{Bucket}/{Key}?x-amz-copy-source&partNumber&uploadId UploadPartCopy
VersioningApi GetBucketVersioning Get /{Bucket}?versioning GetBucketVersioning
VersioningApi PutBucketVersioning Put /{Bucket}?versioning PutBucketVersioning
VersionsApi ListObjectVersions Get /{Bucket}?versions ListObjectVersions
WebsiteApi DeleteBucketWebsite Delete /{Bucket}?website DeleteBucketWebsite
WebsiteApi GetBucketWebsite Get /{Bucket}?website GetBucketWebsite
WebsiteApi PutBucketWebsite Put /{Bucket}?website PutBucketWebsite

Documentation For Models

Documentation For Authorization

For authentication you need to set the following environment variables with your credentials

export IONOS_S3_ACCESS_KEY="accesskey"
export IONOS_S3_SECRET_KEY="secretkey"
cfg := s3.NewConfigurationFromEnv()
apiClient:=s3.NewApiClient(cfg)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]