Compare commits
No commits in common. "2ccbe1c0b43803087c969187e84ae56e5ba15fc1" and "0f9c9c2f189c014de06b16b9096d0561e6f04eab" have entirely different histories.
2ccbe1c0b4
...
0f9c9c2f18
|
@ -198,49 +198,6 @@ The Tag Set of a bucket is an array of objects with Key and Value:
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Model version 16
|
|
||||||
|
|
||||||
### Properties Added
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
this._dataReport = dataReport || null;
|
|
||||||
```
|
|
||||||
|
|
||||||
For capacity-enabled buckets, contains the following data:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
{
|
|
||||||
_capabilitie: {
|
|
||||||
SystemInfo?: {
|
|
||||||
ProtocolVersion: String,
|
|
||||||
ModelName: String,
|
|
||||||
ProtocolCapabilities: {
|
|
||||||
CapacityInfo: Boolean,
|
|
||||||
UploadSessions: Boolean,
|
|
||||||
IAMSTS: Boolean,
|
|
||||||
},
|
|
||||||
APIEndpoints: {
|
|
||||||
IAMEndpoint: String,
|
|
||||||
STSEndpoint: String,
|
|
||||||
},
|
|
||||||
SystemRecommendations?: {
|
|
||||||
S3ConcurrentTaskLimit: Number,
|
|
||||||
S3MultiObjectDelete: Number,
|
|
||||||
StorageCurrentTasksLimit: Number,
|
|
||||||
KbBlockSize: Number,
|
|
||||||
}
|
|
||||||
LastModified?: String,
|
|
||||||
},
|
|
||||||
CapacityInfo?: {
|
|
||||||
Capacity: Number,
|
|
||||||
Available: Number,
|
|
||||||
Used: Number,
|
|
||||||
LastModified?: String,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
Used to store bucket tagging
|
Used to store bucket tagging
|
|
@ -13,7 +13,7 @@ import { areTagsValid, BucketTag } from '../s3middleware/tagging';
|
||||||
// WHEN UPDATING THIS NUMBER, UPDATE BucketInfoModelVersion.md CHANGELOG
|
// WHEN UPDATING THIS NUMBER, UPDATE BucketInfoModelVersion.md CHANGELOG
|
||||||
// BucketInfoModelVersion.md can be found in documentation/ at the root
|
// BucketInfoModelVersion.md can be found in documentation/ at the root
|
||||||
// of this repository
|
// of this repository
|
||||||
const modelVersion = 16;
|
const modelVersion = 14;
|
||||||
|
|
||||||
export type CORS = {
|
export type CORS = {
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -37,41 +37,6 @@ export type VersioningConfiguration = {
|
||||||
MfaDelete: any;
|
MfaDelete: any;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type VeeamCapacity = {
|
|
||||||
SystemInfo?: {
|
|
||||||
ProtocolVersion: string,
|
|
||||||
ModelName: string,
|
|
||||||
ProtocolCapabilities: {
|
|
||||||
CapacityInfo: boolean,
|
|
||||||
UploadSessions: boolean,
|
|
||||||
IAMSTS?: boolean,
|
|
||||||
},
|
|
||||||
APIEndpoints?: {
|
|
||||||
IAMEndpoint: string,
|
|
||||||
STSEndpoint: string,
|
|
||||||
},
|
|
||||||
SystemRecommendations?: {
|
|
||||||
S3ConcurrentTaskLimit: number,
|
|
||||||
S3MultiObjectDelete: number,
|
|
||||||
StorageCurrentTasksLimit: number,
|
|
||||||
KbBlockSize: number,
|
|
||||||
}
|
|
||||||
LastModified?: string,
|
|
||||||
},
|
|
||||||
CapacityInfo?: {
|
|
||||||
Capacity: number,
|
|
||||||
Available: number,
|
|
||||||
Used: number,
|
|
||||||
LastModified?: string,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// Capacity contains all specifics from external products supported by
|
|
||||||
// our S3 implementation, at bucket level
|
|
||||||
export type Capacity = {
|
|
||||||
VeeamSOSApi?: VeeamCapacity,
|
|
||||||
};
|
|
||||||
|
|
||||||
export type ACL = OACL & { WRITE: string[] }
|
export type ACL = OACL & { WRITE: string[] }
|
||||||
|
|
||||||
export default class BucketInfo {
|
export default class BucketInfo {
|
||||||
|
@ -100,7 +65,6 @@ export default class BucketInfo {
|
||||||
_isNFS: boolean | null;
|
_isNFS: boolean | null;
|
||||||
_azureInfo: any | null;
|
_azureInfo: any | null;
|
||||||
_ingestion: { status: 'enabled' | 'disabled' } | null;
|
_ingestion: { status: 'enabled' | 'disabled' } | null;
|
||||||
_capabilities: Capacity | null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents all bucket information.
|
* Represents all bucket information.
|
||||||
|
@ -156,7 +120,6 @@ export default class BucketInfo {
|
||||||
* @param [objectLockConfiguration] - object lock configuration
|
* @param [objectLockConfiguration] - object lock configuration
|
||||||
* @param [notificationConfiguration] - bucket notification configuration
|
* @param [notificationConfiguration] - bucket notification configuration
|
||||||
* @param [tags] - bucket tag set
|
* @param [tags] - bucket tag set
|
||||||
* @param [capabilities] - capabilities for the bucket
|
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
name: string,
|
name: string,
|
||||||
|
@ -184,7 +147,6 @@ export default class BucketInfo {
|
||||||
objectLockConfiguration?: any,
|
objectLockConfiguration?: any,
|
||||||
notificationConfiguration?: any,
|
notificationConfiguration?: any,
|
||||||
tags?: Array<BucketTag> | [],
|
tags?: Array<BucketTag> | [],
|
||||||
capabilities?: Capacity,
|
|
||||||
) {
|
) {
|
||||||
assert.strictEqual(typeof name, 'string');
|
assert.strictEqual(typeof name, 'string');
|
||||||
assert.strictEqual(typeof owner, 'string');
|
assert.strictEqual(typeof owner, 'string');
|
||||||
|
@ -312,7 +274,6 @@ export default class BucketInfo {
|
||||||
this._objectLockConfiguration = objectLockConfiguration || null;
|
this._objectLockConfiguration = objectLockConfiguration || null;
|
||||||
this._notificationConfiguration = notificationConfiguration || null;
|
this._notificationConfiguration = notificationConfiguration || null;
|
||||||
this._tags = tags;
|
this._tags = tags;
|
||||||
this._capabilities = capabilities || null;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,7 +308,6 @@ export default class BucketInfo {
|
||||||
objectLockConfiguration: this._objectLockConfiguration,
|
objectLockConfiguration: this._objectLockConfiguration,
|
||||||
notificationConfiguration: this._notificationConfiguration,
|
notificationConfiguration: this._notificationConfiguration,
|
||||||
tags: this._tags,
|
tags: this._tags,
|
||||||
capabilities: this._capabilities,
|
|
||||||
};
|
};
|
||||||
const final = this._websiteConfiguration
|
const final = this._websiteConfiguration
|
||||||
? {
|
? {
|
||||||
|
@ -373,8 +333,7 @@ export default class BucketInfo {
|
||||||
obj.cors, obj.replicationConfiguration, obj.lifecycleConfiguration,
|
obj.cors, obj.replicationConfiguration, obj.lifecycleConfiguration,
|
||||||
obj.bucketPolicy, obj.uid, obj.readLocationConstraint, obj.isNFS,
|
obj.bucketPolicy, obj.uid, obj.readLocationConstraint, obj.isNFS,
|
||||||
obj.ingestion, obj.azureInfo, obj.objectLockEnabled,
|
obj.ingestion, obj.azureInfo, obj.objectLockEnabled,
|
||||||
obj.objectLockConfiguration, obj.notificationConfiguration, obj.tags,
|
obj.objectLockConfiguration, obj.notificationConfiguration, obj.tags);
|
||||||
obj.capabilities);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -401,7 +360,7 @@ export default class BucketInfo {
|
||||||
data._bucketPolicy, data._uid, data._readLocationConstraint,
|
data._bucketPolicy, data._uid, data._readLocationConstraint,
|
||||||
data._isNFS, data._ingestion, data._azureInfo,
|
data._isNFS, data._ingestion, data._azureInfo,
|
||||||
data._objectLockEnabled, data._objectLockConfiguration,
|
data._objectLockEnabled, data._objectLockConfiguration,
|
||||||
data._notificationConfiguration, data._tags, data._capabilities);
|
data._notificationConfiguration, data._tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -909,25 +868,4 @@ export default class BucketInfo {
|
||||||
this._tags = tags;
|
this._tags = tags;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the value of bucket capabilities
|
|
||||||
* @param capacity? - if provided, will return a specific capacity
|
|
||||||
* @return - capabilities of the bucket, or null
|
|
||||||
*/
|
|
||||||
getCapabilities(capacity?: string) {
|
|
||||||
if (capacity && this._capabilities && this._capabilities[capacity]) {
|
|
||||||
return this._capabilities[capacity];
|
|
||||||
}
|
|
||||||
return this._capabilities;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set bucket capabilities
|
|
||||||
* @return - bucket info instance
|
|
||||||
*/
|
|
||||||
setCapabilities(capabilities: Capacity) {
|
|
||||||
this._capabilities = capabilities;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,6 @@ const testAzureInfo = {
|
||||||
managementPolicies: [],
|
managementPolicies: [],
|
||||||
httpsOnly: false,
|
httpsOnly: false,
|
||||||
tags: { foo: 'bar' },
|
tags: { foo: 'bar' },
|
||||||
daraReport: null,
|
|
||||||
networkACL: [],
|
networkACL: [],
|
||||||
cname: 'www.example.com',
|
cname: 'www.example.com',
|
||||||
azureFilesAADIntegration: false,
|
azureFilesAADIntegration: false,
|
||||||
|
@ -200,35 +199,6 @@ const testBucketTagging = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const testBucketCapacity = {
|
|
||||||
VeeamSOSApi: {
|
|
||||||
SystemInfo: {
|
|
||||||
ProtocolVersion: '"1.0"',
|
|
||||||
ModelName: 'ARTESCA',
|
|
||||||
ProtocolCapabilities: {
|
|
||||||
CapacityInfo: true,
|
|
||||||
UploadSessions: false,
|
|
||||||
IAMSTS: false,
|
|
||||||
},
|
|
||||||
APIEndpoints: {
|
|
||||||
IAMEndpoint: '',
|
|
||||||
STSEndpoint: '',
|
|
||||||
},
|
|
||||||
SystemRecommendations: {
|
|
||||||
S3ConcurrentTaskLimit: 64,
|
|
||||||
S3MultiObjectDelete: 1000,
|
|
||||||
StorageCurrentTasksLimit: 0,
|
|
||||||
KbBlockSize: 1024,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
CapacityInfo: {
|
|
||||||
Capacity: 1,
|
|
||||||
Available: 1,
|
|
||||||
Used: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// create a dummy bucket to test getters and setters
|
// create a dummy bucket to test getters and setters
|
||||||
Object.keys(acl).forEach(
|
Object.keys(acl).forEach(
|
||||||
aclObj => describe(`different acl configurations : ${aclObj}`, () => {
|
aclObj => describe(`different acl configurations : ${aclObj}`, () => {
|
||||||
|
@ -252,7 +222,6 @@ Object.keys(acl).forEach(
|
||||||
testObjectLockConfiguration,
|
testObjectLockConfiguration,
|
||||||
testNotificationConfiguration,
|
testNotificationConfiguration,
|
||||||
testBucketTagging,
|
testBucketTagging,
|
||||||
testBucketCapacity,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
describe('serialize/deSerialize on BucketInfo class', () => {
|
describe('serialize/deSerialize on BucketInfo class', () => {
|
||||||
|
@ -290,7 +259,6 @@ Object.keys(acl).forEach(
|
||||||
dummyBucket._objectLockConfiguration,
|
dummyBucket._objectLockConfiguration,
|
||||||
notificationConfiguration: dummyBucket._notificationConfiguration,
|
notificationConfiguration: dummyBucket._notificationConfiguration,
|
||||||
tags: dummyBucket._tags,
|
tags: dummyBucket._tags,
|
||||||
capabilities: dummyBucket._capabilities,
|
|
||||||
};
|
};
|
||||||
assert.strictEqual(serialized, JSON.stringify(bucketInfos));
|
assert.strictEqual(serialized, JSON.stringify(bucketInfos));
|
||||||
done();
|
done();
|
||||||
|
@ -339,7 +307,6 @@ Object.keys(acl).forEach(
|
||||||
_notificationConfiguration:
|
_notificationConfiguration:
|
||||||
dummyBucket._notificationConfiguration,
|
dummyBucket._notificationConfiguration,
|
||||||
_tags: dummyBucket._tags,
|
_tags: dummyBucket._tags,
|
||||||
_capabilities: dummyBucket._capabilities,
|
|
||||||
};
|
};
|
||||||
const fromObj = BucketInfo.fromObj(dataObj);
|
const fromObj = BucketInfo.fromObj(dataObj);
|
||||||
assert(fromObj instanceof BucketInfo);
|
assert(fromObj instanceof BucketInfo);
|
||||||
|
|
Loading…
Reference in New Issue