Skip to content

Commit

Permalink
Created IBM cloud object to connect with IBM
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh3305 committed Oct 4, 2023
1 parent 5e96d87 commit d4067a4
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions src/Storage/Device/IBMCloudObject.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

namespace Utopia\Storage\Device;

use Utopia\Storage\Storage;

class IBMCloudObject extends S3
{
/**
* Regions constants
*/
const EU_CENTRAL_1 = 'eu-central-1';

const US_SOUTHEAST_1 = 'us-southeast-1';

const US_EAST_1 = 'us-east-1';

const AP_SOUTH_1 = 'ap-south-1';

/**
* Object Storage Constructor
*
* @param string $root
* @param string $accessKey
* @param string $secretKey
* @param string $bucket
* @param string $region
* @param string $acl
*/
public function __construct(string $root, string $accessKey, string $secretKey, string $bucket, string $region = self::EU_CENTRAL_1, string $acl = self::ACL_PRIVATE)
{
parent::__construct($root, $accessKey, $secretKey, $bucket, $region, $acl);
$this->headers['host'] = $bucket.'.'.$region.'.'.'cloud.ibm.com';
}


/**
* @return string
*/
public function getName(): string
{
return 'IBM Cloud Object Storage';
}

/**
* @return string
*/
public function getDescription(): string
{
return 'IBM Cloud Object';
}

/**
* @return string
*/
public function getType(): string
{
return Storage::DEVICE_IBM_CLOUD_OBJECT;
}
}

0 comments on commit d4067a4

Please sign in to comment.