diff --git a/src/Storage/Device/NetappStorageGrid.php b/src/Storage/Device/NetappStorageGrid.php new file mode 100644 index 00000000..352eb850 --- /dev/null +++ b/src/Storage/Device/NetappStorageGrid.php @@ -0,0 +1,49 @@ +accessKey = $accessKey; + $this->secretKey = $secretKey; + $this->bucket = $bucket; + $this->region = $region; + $this->root = $root; + $this->acl = $acl; + $this->amzHeaders = []; + + $host = match ($region) { + self::CN_NORTH_1, self::CN_NORTH_4, self::CN_NORTHWEST_1 => $bucket.'.s3.'.$region.'.amazonaws.cn', + default => $bucket.'.s3.'.$region.'.amazonaws.com' + }; + + $this->headers['host'] = $host; + } + + public function getName(): string + { + return 'Netapp Storage Grid'; + } + + public function getType(): string + { + return STORAGE::DEVICE_NETAPP_STORAGE_GRID; + } + + public function getDescription(): string + { + return 'NetApp Storage Grid using S3 Storage drive'; + } +} diff --git a/src/Storage/Storage.php b/src/Storage/Storage.php index cabd18c8..d2b6f18e 100644 --- a/src/Storage/Storage.php +++ b/src/Storage/Storage.php @@ -21,6 +21,8 @@ class Storage const DEVICE_LINODE = 'linode'; + const DEVICE_NETAPP_STORAGE_GRID = 'netappstorage'; + /** * Devices. * diff --git a/tests/Storage/Device/NetappStorageTest.php b/tests/Storage/Device/NetappStorageTest.php new file mode 100644 index 00000000..a6d53acc --- /dev/null +++ b/tests/Storage/Device/NetappStorageTest.php @@ -0,0 +1,23 @@ +storageAdapter = new NetappStorageAdapter(); + } + + protected function testGetName() + { + $this->assertEquals('Netapp Storage Grid', $this->storageAdapter->getName()); + } + + protected function testGetType() + { + $this->assertEquals(Storage::DEVICE_ALIBABA_CLOUD, $this->storageAdapter->getType()); + } +}