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.
IONOS Object Storage User Guide
- Documentation on user-owned and contract-owned buckets
- Documentation on S3 API Compatibility
- S3 Tools
Location | Region Name | Bucket Type | Endpoint |
---|---|---|---|
Berlin, Germany | eu-central-3 | Contract-owned | https://s3.eu-central-3.ionoscloud.com |
- 30.05.2024 Initial version
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: 1.1.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://docs.ionos.com/support/general-information/contact-information
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-object-storage"
To use a proxy, set the environment variable HTTP_PROXY
:
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
Default configuration comes with Servers
field that contains server objects as defined in the OpenAPI specification.
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 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.
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 |
- AbortIncompleteMultipartUpload
- BlockPublicAccessOutput
- BlockPublicAccessPayload
- Bucket
- BucketLocation
- BucketPolicy
- BucketPolicyCondition
- BucketPolicyConditionDate
- BucketPolicyConditionIpAddress
- BucketPolicyStatement
- BucketVersioningStatus
- CORSRule
- CSVInput
- CSVOutput
- CommonPrefix
- CompleteMultipartUploadOutput
- CompletedPart
- CopyObjectRequest
- CopyObjectResult
- CopyPartResult
- CreateBucketConfiguration
- CreateMultipartUploadOutput
- DefaultRetention
- DeleteMarkerEntry
- DeleteObjectsOutput
- DeleteObjectsRequest
- DeletedObject
- DeletionError
- Destination
- EncodingType
- Encryption
- Error
- ErrorDocument
- Example
- ExampleCompleteMultipartUpload
- ExpirationStatus
- ExpressionType
- GetBucketCorsOutput
- GetBucketLifecycleOutput
- GetBucketReplicationOutput
- GetBucketTaggingOutput
- GetBucketVersioningOutput
- GetBucketWebsiteOutput
- GetObjectLockConfigurationOutput
- GetObjectTaggingOutput
- HeadObjectOutput
- IndexDocument
- Initiator
- InputSerialization
- InputSerializationJSON
- JSONOutput
- LifecycleExpiration
- ListAllMyBucketsResult
- ListBucketResultV2
- ListMultipartUploadsOutput
- ListObjectVersionsOutput
- ListObjectsOutput
- ListPartsOutput
- MetadataEntry
- MfaDeleteStatus
- MultipartUpload
- NoncurrentVersionExpiration
- Object
- ObjectIdentifier
- ObjectLegalHoldConfiguration
- ObjectLockRetention
- ObjectLockRule
- ObjectStorageClass
- ObjectVersion
- ObjectVersionStorageClass
- OutputSerialization
- Owner
- POSTObjectRequest
- Part
- PolicyStatus
- Principal
- PrincipalAllOf
- PutBucketCorsRequest
- PutBucketEncryptionRequest
- PutBucketLifecycleRequest
- PutBucketTaggingRequest
- PutBucketVersioningRequest
- PutBucketWebsiteRequest
- PutObjectLockConfigurationRequest
- PutObjectLockConfigurationRequestRule
- PutObjectRetentionRequest
- PutObjectTaggingRequest
- Redirect
- RedirectAllRequestsTo
- ReplicaModificationsStatus
- ReplicationConfiguration
- ReplicationRule
- RoutingRule
- RoutingRuleCondition
- Rule
- ServerSideEncryption
- ServerSideEncryptionByDefault
- ServerSideEncryptionConfiguration
- ServerSideEncryptionRule
- StorageClass
- Tag
- UploadPartCopyOutput
- UploadPartRequest
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
Note, each API key must be added to a map of map[string]APIKey
where the key is: Authorization and passed in as the auth context for each request.
Example
auth := context.WithValue(
context.Background(),
sw.ContextAPIKeys,
map[string]sw.APIKey{
"Authorization": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
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