The ecs-object-client-go is an extended SDK for Dell/EMC ECS based on official AWS SDK for the Go programming language.
Checkout our EMC ECS REST API for ECS S3 Extension Features
-
go get -u github.com/EMCECS/ecs-object-client-go
-
go get -u github.com/aws/aws-sdk-go
or
import github.com/EMCECS/ecs-object-client-go in your code and leverage glide or similar tool to pull ecs-object-client-go and aws-sdk-go automatially
-
glide init
-
glide install
- DeleteBucketMetadataSearch
- GetSystemMetadataSearchKeys
- ListBucketMetadataSearch
- ListBucketQuery
- PutBucketIsStaleAllowed
- CreateBucket
- GetObject
- HeadBucket
- HeadObject
- PutObject
- Setup configrations in
test_config.yaml
- glide install
- go test -v
package main
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/EMCECS/ecs-object-client-go"
)
func main() {
s3Config := &aws.Config{
Credentials: credentials.NewStaticCredentials("<s3.access_key>", "<s3.secret_key>", ""),
Endpoint: aws.String("<s3.endpoint>"),
Region: aws.String("<s3.region>"),
}
// Create S3 Session
sess := session.Must(session.NewSession(s3Config))
// Get Session for ECS extension
s3client := ecs.New(sess)
// Create Bucket
_, err = s3client.CreateBucketExt(&ecs.CreateBucketInput{
Bucket: aws.String("DEMO"),
// RetentionPeriod is only supported by ECS
RetentionPeriod: aws.Int64(3600),
})
// check err
}
This SDK is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information.