https://github.com/kunokdev/otc-obs-sdk-mirror
T-System (Telekom cloud) OBS SDK (NPM Mirror)
https://github.com/kunokdev/otc-obs-sdk-mirror
obs otc
Last synced: about 1 month ago
JSON representation
T-System (Telekom cloud) OBS SDK (NPM Mirror)
- Host: GitHub
- URL: https://github.com/kunokdev/otc-obs-sdk-mirror
- Owner: kunokdev
- Created: 2019-03-20T12:53:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-25T22:15:27.000Z (about 7 years ago)
- Last Synced: 2026-03-31T09:25:15.837Z (3 months ago)
- Topics: obs, otc
- Language: JavaScript
- Homepage: https://open-telekom-cloud.com/en/products-services/object-storage-service
- Size: 52.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# T-Systems (Telekom cloud) OBS SDK (NPM Mirror)
OBS provides object storage service through simple web service interfaces and applies to Internet applications. The object storage service is accessed and operated using the REST APIs that support standard HTTP headers and status codes.

## Documentation
Complete official documentation can be found [here](https://docs.otc.t-systems.com/en-us/sdk_nodejs_devg/obs/en-us_topic_0039873862.html).
## Installation
```
yarn add t-systems-obs-sdk
```
## Usage
### Create instance
```
// Import the OBS library.
var ObsClient = require('t-systems-obs-sdk');
// Create an instance of ObsClient.
var obsClient = new ObsClient({
access_key_id: '*** Provide your Access Key ***',
secret_access_key: '*** Provide your Secret Key ***',
server : 'yourdomainname'
});
// Use the instance to access OBS.
// Close obsClient.
obsClient.close();
```
### Create bucket
```
obsClient.createBucket({
Bucket : 'bucketname',
}, (err, result) => {
if(err){
console.error('Error-->' + err);
}else{
console.log('Status-->' + result.CommonMsg.Status);
}
});
```
### Upload object
```
obsClient.putObject({
Bucket : 'bucketname',
Key : 'objectkey',
Body : 'Hello OBS'
}, (err, result) => {
if(err){
console.error('Error-->' + err);
}else{
console.log('Status-->' + result.CommonMsg.Status);
}
});
```
### Download object
```
obsClient.getObject({
Bucket : 'bucketname',
Key : 'objectkey'
}, (err, result) => {
if(err){
console.error('Error-->' + err);
}else{
console.log('Status-->' + result.CommonMsg.Status);
if(result.CommonMsg.Status < 300 && result.InterfaceResult){
console.log(result.InterfaceResult.Content.toString());
}
}
});
```
Refer to [official documentation](https://docs.otc.t-systems.com/en-us/sdk_nodejs_devg/obs/en-us_topic_0039931046.html) for more examples.
## Contribution
No contribution welcome at this time.