objectstorage
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
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.
API version: 2.0.2
Package version: products/objectstorage/v2.0.2
Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://docs.ionos.com/support/general-information/contact-information
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/optionalPut 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
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
Last updated
