objectstorage

Gitter

Go API client for objectstorage

Overview

The IONOS 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 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/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional

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

import "./objectstorage"

Documentation for API Endpoints

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

API Endpoints table
Class
Method
HTTP request
Description

BucketsApi

Put /{Bucket}

CreateBucket

BucketsApi

Delete /{Bucket}

DeleteBucket

BucketsApi

Get /{Bucket}?location

GetBucketLocation

BucketsApi

Head /{Bucket}

HeadBucket

BucketsApi

Get /

ListBuckets

CORSApi

Delete /{Bucket}?cors

DeleteBucketCors

CORSApi

Get /{Bucket}?cors

GetBucketCors

CORSApi

Put /{Bucket}?cors

PutBucketCors

EncryptionApi

Delete /{Bucket}?encryption

DeleteBucketEncryption

EncryptionApi

Get /{Bucket}?encryption

GetBucketEncryption

EncryptionApi

Put /{Bucket}?encryption

PutBucketEncryption

LifecycleApi

Delete /{Bucket}?lifecycle

DeleteBucketLifecycle

LifecycleApi

Get /{Bucket}?lifecycle

GetBucketLifecycle

LifecycleApi

Put /{Bucket}?lifecycle

PutBucketLifecycle

ObjectLockApi

Get /{Bucket}/{Key}?legal-hold

GetObjectLegalHold

ObjectLockApi

Get /{Bucket}?object-lock

GetObjectLockConfiguration

ObjectLockApi

Get /{Bucket}/{Key}?retention

GetObjectRetention

ObjectLockApi

Put /{Bucket}/{Key}?legal-hold

PutObjectLegalHold

ObjectLockApi

Put /{Bucket}?object-lock

PutObjectLockConfiguration

ObjectLockApi

Put /{Bucket}/{Key}?retention

PutObjectRetention

ObjectsApi

Put /{Bucket}/{Key}?x-amz-copy-source

CopyObject

ObjectsApi

Delete /{Bucket}/{Key}

DeleteObject

ObjectsApi

Post /{Bucket}?delete

DeleteObjects

ObjectsApi

Get /{Bucket}/{Key}

GetObject

ObjectsApi

Head /{Bucket}/{Key}

HeadObject

ObjectsApi

Get /{Bucket}

ListObjects

ObjectsApi

Get /{Bucket}?list-type=2

ListObjectsV2

ObjectsApi

Options /{Bucket}

OPTIONSObject

ObjectsApi

Post /{Bucket}/{Key}

POSTObject

ObjectsApi

Put /{Bucket}/{Key}

PutObject

PolicyApi

Delete /{Bucket}?policy

DeleteBucketPolicy

PolicyApi

Get /{Bucket}?policy

GetBucketPolicy

PolicyApi

Get /{Bucket}?policyStatus

GetBucketPolicyStatus

PolicyApi

Put /{Bucket}?policy

PutBucketPolicy

PublicAccessBlockApi

Delete /{Bucket}?publicAccessBlock

DeletePublicAccessBlock

PublicAccessBlockApi

Get /{Bucket}?publicAccessBlock

GetPublicAccessBlock

PublicAccessBlockApi

Put /{Bucket}?publicAccessBlock

PutPublicAccessBlock

ReplicationApi

Get /{Bucket}?replication

GetBucketReplication

TaggingApi

Delete /{Bucket}?tagging

DeleteBucketTagging

TaggingApi

Delete /{Bucket}/{Key}?tagging

DeleteObjectTagging

TaggingApi

Get /{Bucket}?tagging

GetBucketTagging

TaggingApi

Get /{Bucket}/{Key}?tagging

GetObjectTagging

TaggingApi

Put /{Bucket}?tagging

PutBucketTagging

TaggingApi

Put /{Bucket}/{Key}?tagging

PutObjectTagging

UploadsApi

Delete /{Bucket}/{Key}?uploadId

AbortMultipartUpload

UploadsApi

Post /{Bucket}/{Key}?uploadId

CompleteMultipartUpload

UploadsApi

Post /{Bucket}/{Key}?uploads

CreateMultipartUpload

UploadsApi

Get /{Bucket}?uploads

ListMultipartUploads

UploadsApi

Get /{Bucket}/{Key}?uploadId

ListParts

UploadsApi

Put /{Bucket}/{Key}?uploadId

UploadPart

UploadsApi

Put /{Bucket}/{Key}?x-amz-copy-source&partNumber&uploadId

UploadPartCopy

VersioningApi

Get /{Bucket}?versioning

GetBucketVersioning

VersioningApi

Put /{Bucket}?versioning

PutBucketVersioning

VersionsApi

Get /{Bucket}?versions

ListObjectVersions

WebsiteApi

Delete /{Bucket}?website

DeleteBucketWebsite

WebsiteApi

Get /{Bucket}?website

GetBucketWebsite

WebsiteApi

Put /{Bucket}?website

PutBucketWebsite


Authentication

All available server URLs are:

  • https://s3.eu-central-3.ionoscloud.com - The endpoint for the `eu-central-3` region (Berlin, Germany)

  • https://s3.eu-central-4.ionoscloud.com - The endpoint for the `eu-central-4` region (Frankfurt, Germany)

  • https://s3.us-central-1.ionoscloud.com - The endpoint for the `us-central-1` region (Lenexa, USA)

By default, https://s3.eu-central-3.ionoscloud.com is used, however this can be overriden at authentication, either by setting the IONOS_API_URL environment variable or by specifying the hostUrl parameter when initializing the sdk client.

NOTE: We recommend passing the URL without the https:// or http:// prefix. The SDK checks and adds it if necessary when configurations are created using NewConfiguration or NewConfigurationFromEnv. This is to avoid issues caused by typos in the prefix that cannot be easily detected and debugged.

In order to authenticate, the only credentials needed are the IONOS S3 access and secret keys, username and password or token are not required. Also, a middleware function needs to be added to the configuration to sign the requests with the IONOS S3 credentials.

configuration := shared.NewConfiguration("", "", "", hostUrl)
configuration.MiddlewareWithError = shared.SignerMiddleware(region, "s3", s3AccessKey, s3SecretKey)
client := objectstorage.NewAPIClient(configuration)

Environment variables can also be used. The sdk uses the following variables:

  • IONOS_S3_ACCESS_KEY - the access key for the IONOS object storage

  • IONOS_S3_SECRET_KEY - the secret key for the IONOS object storage

  • IONOS_API_URL - to specify the API server URL

In this case, the client configuration needs to be initialized using NewConfigurationFromEnv().

configuration := shared.NewConfigurationFromEnv()
configuration.MiddlewareWithError = shared.SignerMiddleware(
    region, "s3", os.Getenv(IonosS3AccessKeyEnvVar), os.Getenv(IonosS3SecretKeyEnvVar),
)
client := objectstorage.NewAPIClient(configuration)

Documentation For Models

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

API models list

[Back to API list] [Back to Model list]

Last updated