Skip to content

Commit 15f2e0d

Browse files
committed
support bucket worm.
1 parent 05c694e commit 15f2e0d

21 files changed

+875
-1
lines changed

sdk/include/alibabacloud/oss/OssClient.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ namespace OSS
159159
GetUserQosInfoOutcome GetUserQosInfo(const GetUserQosInfoRequest& request) const;
160160
GetBucketVersioningOutcome GetBucketVersioning(const GetBucketVersioningRequest& request) const;
161161
GetBucketInventoryConfigurationOutcome GetBucketInventoryConfiguration(const GetBucketInventoryConfigurationRequest& request) const;
162+
InitiateBucketWormOutcome InitiateBucketWorm(const InitiateBucketWormRequest& request) const;
163+
VoidOutcome AbortBucketWorm(const AbortBucketWormRequest& request) const;
164+
VoidOutcome CompleteBucketWorm(const CompleteBucketWormRequest& request) const;
165+
VoidOutcome ExtendBucketWormWorm(const ExtendBucketWormRequest& request) const;
166+
GetBucketWormOutcome GetBucketWorm(const GetBucketWormRequest& request) const;
162167
#endif
163168

164169
/*Object*/

sdk/include/alibabacloud/oss/OssFwd.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@
9191
#include <alibabacloud/oss/model/GetBucketInventoryConfigurationRequest.h>
9292
#include <alibabacloud/oss/model/ListBucketInventoryConfigurationsRequest.h>
9393
#include <alibabacloud/oss/model/ListBucketInventoryConfigurationsResult.h>
94+
#include <alibabacloud/oss/model/InitiateBucketWormRequest.h>
95+
#include <alibabacloud/oss/model/InitiateBucketWormResult.h>
96+
#include <alibabacloud/oss/model/AbortBucketWormRequest.h>
97+
#include <alibabacloud/oss/model/CompleteBucketWormRequest.h>
98+
#include <alibabacloud/oss/model/ExtendBucketWormRequest.h>
99+
#include <alibabacloud/oss/model/GetBucketWormRequest.h>
100+
#include <alibabacloud/oss/model/GetBucketWormResult.h>
94101
#endif
95102

96103
#include <alibabacloud/oss/model/ListObjectsRequest.h>
@@ -207,6 +214,8 @@ namespace OSS
207214
using GetUserQosInfoOutcome = Outcome<OssError, GetUserQosInfoResult>;
208215
using GetBucketVersioningOutcome = Outcome<OssError, GetBucketVersioningResult>;
209216
using GetBucketInventoryConfigurationOutcome = Outcome<OssError, GetBucketInventoryConfigurationResult>;
217+
using InitiateBucketWormOutcome = Outcome<OssError, InitiateBucketWormResult>;
218+
using GetBucketWormOutcome = Outcome<OssError, GetBucketWormResult>;
210219
#endif
211220

212221
using ListObjectOutcome = Outcome<OssError, ListObjectsResult>;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
#include <alibabacloud/oss/Export.h>
19+
#include <alibabacloud/oss/OssRequest.h>
20+
21+
namespace AlibabaCloud
22+
{
23+
namespace OSS
24+
{
25+
class ALIBABACLOUD_OSS_EXPORT AbortBucketWormRequest : public OssBucketRequest
26+
{
27+
public:
28+
AbortBucketWormRequest(const std::string& bucket);
29+
protected:
30+
virtual ParameterCollection specialParameters() const;
31+
};
32+
}
33+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
#include <alibabacloud/oss/Export.h>
19+
#include <alibabacloud/oss/OssRequest.h>
20+
21+
namespace AlibabaCloud
22+
{
23+
namespace OSS
24+
{
25+
class ALIBABACLOUD_OSS_EXPORT CompleteBucketWormRequest : public OssBucketRequest
26+
{
27+
public:
28+
CompleteBucketWormRequest(const std::string& bucket, const std::string& wormId);
29+
protected:
30+
virtual ParameterCollection specialParameters() const;
31+
private:
32+
std::string wormId_;
33+
};
34+
}
35+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
#include <alibabacloud/oss/Export.h>
19+
#include <alibabacloud/oss/OssRequest.h>
20+
21+
namespace AlibabaCloud
22+
{
23+
namespace OSS
24+
{
25+
class ALIBABACLOUD_OSS_EXPORT ExtendBucketWormRequest : public OssBucketRequest
26+
{
27+
public:
28+
ExtendBucketWormRequest(const std::string& bucket, const std::string& wormId, uint32_t day);
29+
protected:
30+
virtual std::string payload() const;
31+
virtual ParameterCollection specialParameters() const;
32+
private:
33+
std::string wormId_;
34+
uint32_t day_;
35+
};
36+
}
37+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
#include <alibabacloud/oss/Export.h>
19+
#include <alibabacloud/oss/OssRequest.h>
20+
21+
namespace AlibabaCloud
22+
{
23+
namespace OSS
24+
{
25+
class ALIBABACLOUD_OSS_EXPORT GetBucketWormRequest : public OssBucketRequest
26+
{
27+
public:
28+
GetBucketWormRequest(const std::string& bucket);
29+
protected:
30+
virtual ParameterCollection specialParameters() const;
31+
};
32+
}
33+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
#include <memory>
19+
#include <iostream>
20+
#include <alibabacloud/oss/OssResult.h>
21+
22+
namespace AlibabaCloud
23+
{
24+
namespace OSS
25+
{
26+
class ALIBABACLOUD_OSS_EXPORT GetBucketWormResult : public OssResult
27+
{
28+
public:
29+
GetBucketWormResult();
30+
GetBucketWormResult(const std::string& data);
31+
GetBucketWormResult(const std::shared_ptr<std::iostream>& data);
32+
GetBucketWormResult& operator=(const std::string& data);
33+
const std::string& WormId() const { return wormId_; }
34+
const std::string& CreationDate() const { return creationDate_; }
35+
const std::string& State() const { return state_; }
36+
uint32_t Day() const { return day_; }
37+
private:
38+
std::string wormId_;
39+
std::string creationDate_;
40+
std::string state_;
41+
uint32_t day_;
42+
};
43+
}
44+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
#include <alibabacloud/oss/Export.h>
19+
#include <alibabacloud/oss/OssRequest.h>
20+
21+
namespace AlibabaCloud
22+
{
23+
namespace OSS
24+
{
25+
class ALIBABACLOUD_OSS_EXPORT InitiateBucketWormRequest : public OssBucketRequest
26+
{
27+
public:
28+
InitiateBucketWormRequest(const std::string& bucket, uint32_t day);
29+
protected:
30+
virtual std::string payload() const;
31+
virtual ParameterCollection specialParameters() const;
32+
private:
33+
uint32_t day_;
34+
};
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
#include <memory>
19+
#include <iostream>
20+
#include <alibabacloud/oss/OssResult.h>
21+
22+
namespace AlibabaCloud
23+
{
24+
namespace OSS
25+
{
26+
class ALIBABACLOUD_OSS_EXPORT InitiateBucketWormResult : public OssResult
27+
{
28+
public:
29+
InitiateBucketWormResult();
30+
InitiateBucketWormResult(const HeaderCollection& header);
31+
const std::string& WormId()const { return wormId_; }
32+
private:
33+
std::string wormId_;
34+
};
35+
}
36+
}

sdk/src/OssClient.cc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,31 @@ GetBucketInventoryConfigurationOutcome OssClient::GetBucketInventoryConfiguratio
455455
return client_->GetBucketInventoryConfiguration(request);
456456
}
457457

458+
InitiateBucketWormOutcome OssClient::InitiateBucketWorm(const InitiateBucketWormRequest& request) const
459+
{
460+
return client_->InitiateBucketWorm(request);
461+
}
462+
463+
VoidOutcome OssClient::AbortBucketWorm(const AbortBucketWormRequest& request) const
464+
{
465+
return client_->AbortBucketWorm(request);
466+
}
467+
468+
VoidOutcome OssClient::CompleteBucketWorm(const CompleteBucketWormRequest& request) const
469+
{
470+
return client_->CompleteBucketWorm(request);
471+
}
472+
473+
VoidOutcome OssClient::ExtendBucketWormWorm(const ExtendBucketWormRequest& request) const
474+
{
475+
return client_->ExtendBucketWormWorm(request);
476+
}
477+
478+
GetBucketWormOutcome OssClient::GetBucketWorm(const GetBucketWormRequest& request) const
479+
{
480+
return client_->GetBucketWorm(request);
481+
}
482+
458483
#endif
459484

460485
ListObjectOutcome OssClient::ListObjects(const std::string &bucket) const

0 commit comments

Comments
 (0)