Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
882187b0e9 | ||
|
|
f0ef60d4fa | ||
|
|
f29a3fe06e | ||
|
|
9c7cbba02f | ||
|
|
65a601c5ba | ||
|
|
3ee66cb2b2 | ||
|
|
a57f6ec422 | ||
|
|
e065d50def | ||
|
|
97918475fb | ||
|
|
5a451d16d4 | ||
|
|
8bed6eecc7 | ||
|
|
db4bd7ae11 | ||
|
|
7e4fbe6210 | ||
|
|
de0798d2dd | ||
|
|
2650ca7420 | ||
|
|
59d9eaf390 | ||
|
|
1ae8883f81 | ||
|
|
30469764de | ||
|
|
aeea3c2fea | ||
|
|
743309716b | ||
|
|
c9ae7d0b7e | ||
|
|
def35a6602 | ||
|
|
da7aefe5aa | ||
|
|
243879b17f | ||
|
|
942248dfb0 | ||
|
|
8f92463d90 | ||
|
|
dbe8804b96 | ||
|
|
6e880496ba | ||
|
|
fbf5bf0457 | ||
|
|
e32ce45b9d | ||
|
|
053c0dc1a1 | ||
|
|
2070ee03ba | ||
|
|
e611ec2db4 | ||
|
|
57416bd581 | ||
|
|
2df6079b2d | ||
|
|
39221a5319 | ||
|
|
6bba61cebe | ||
|
|
a869068f77 | ||
|
|
cf9eca9516 |
137
.clang-format
Normal file
137
.clang-format
Normal file
@@ -0,0 +1,137 @@
|
||||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveMacros: false
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlines: Right
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllConstructorInitializersOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Attach
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 80
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DeriveLineEnding: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
FixNamespaceComments: true
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
SortPriority: 0
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
SortPriority: 0
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IncludeIsMainSourceRegex: ''
|
||||
IndentCaseLabels: false
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 2
|
||||
IndentWrappedFunctionNames: false
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
ObjCBinPackProtocolList: Auto
|
||||
ObjCBlockIndentWidth: 2
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PointerAlignment: Right
|
||||
ReflowComments: true
|
||||
SortIncludes: true
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
SpaceBeforeSquareBrackets: false
|
||||
Standard: Latest
|
||||
StatementMacros:
|
||||
- Q_UNUSED
|
||||
- QT_REQUIRE_VERSION
|
||||
TabWidth: 8
|
||||
UseCRLF: false
|
||||
UseTab: Never
|
||||
...
|
||||
|
||||
132
CHANGELOG
132
CHANGELOG
@@ -1,3 +1,135 @@
|
||||
2020-07-02 Version: 1.36.495
|
||||
- Generated 2020-05-18 for `dataworks-public`.
|
||||
|
||||
2020-07-02 Version: 1.36.494
|
||||
- Add GetFootwearPosition.
|
||||
- Add PullTakeShoesEvent.
|
||||
- Add PullTryOnShoesEvent.
|
||||
|
||||
2020-07-02 Version: 1.36.493
|
||||
- Add GetFootwearPosition.
|
||||
- Add PullTakeShoesEvent.
|
||||
- Add PullTryOnShoesEvent.
|
||||
|
||||
2020-07-02 Version: 1.36.492
|
||||
- Update endpoint.
|
||||
|
||||
2020-07-02 Version: 1.36.491
|
||||
- CreateShardingDBInstance add ProtocolType, to support DynamoDB.
|
||||
- DescribeDBInstances add return ResourceGroupId.
|
||||
|
||||
2020-07-01 Version: 1.36.490
|
||||
- Add ListFace-MotorAlgorithmResults API.
|
||||
|
||||
2020-07-01 Version: 1.36.489
|
||||
- Add API for GetMetadataAmount.
|
||||
|
||||
2020-07-01 Version: 1.36.488
|
||||
- Support Saf For ExecuteExtendService.
|
||||
|
||||
2020-06-30 Version: 1.36.487
|
||||
- Add ListMetrics API.
|
||||
|
||||
2020-06-29 Version: 1.36.486
|
||||
- Supported Rotate.
|
||||
|
||||
2020-06-29 Version: 1.36.485
|
||||
- Supported Rotate.
|
||||
|
||||
2020-06-29 Version: 1.36.484
|
||||
- Add Model Parameter For InitFaceVerify API.
|
||||
|
||||
2020-06-26 Version: 1.36.483
|
||||
- Supported Api EraseLogoInVideo.
|
||||
|
||||
2020-06-24 Version: 1.36.482
|
||||
- Add DescribeBackupPlanBilling.
|
||||
- Modify ConfigureBackupPlan.
|
||||
- Modify CreateBackupPlan.
|
||||
- Modify CreateRestoreTask.
|
||||
- Modify DescribeRestoreTaskList.
|
||||
- Modify DescribeBackupPlanList.
|
||||
- Modify ModifyBackupSourceEndpoint.
|
||||
- Modify ModifyBackupStrategy.
|
||||
|
||||
2020-06-23 Version: 1.36.481
|
||||
- Add face quality detection API.
|
||||
|
||||
2020-06-23 Version: 1.36.480
|
||||
- Add face quality detection API.
|
||||
|
||||
2020-06-23 Version: 1.36.479
|
||||
- Add face quality detection API.
|
||||
|
||||
2020-06-23 Version: 1.36.478
|
||||
- Add face quality detection API.
|
||||
|
||||
2020-06-23 Version: 1.36.477
|
||||
- Generated 2015-12-15 for `CS`.
|
||||
|
||||
2020-06-23 Version: 1.36.476
|
||||
- Support SubmitOperationAuditInfo for Support self-service submission of approval information.
|
||||
- Support SubmitOperationCredentials for self-service submission of certificate information.
|
||||
- Support CancelOperationAudit for cancel audit.
|
||||
- Support GetOperationOssUploadPolic for get oss policy.
|
||||
- Support QueryOperationAuditInfoLis for query audit list.
|
||||
- Support QueryOperationAuditInfoDetail for query audit details.
|
||||
|
||||
2020-06-23 Version: 1.36.475
|
||||
- Generated 2018-08-28 for `Tag`.
|
||||
|
||||
2020-06-23 Version: 1.36.474
|
||||
- Public beta version.
|
||||
- Add Api Overseas.
|
||||
|
||||
2020-06-23 Version: 1.36.473
|
||||
- Public beta version.
|
||||
- Add Api Overseas.
|
||||
|
||||
2020-06-23 Version: 1.36.472
|
||||
- Public beta version.
|
||||
- Add Api Overseas.
|
||||
|
||||
2020-06-22 Version: 1.36.471
|
||||
- Add support cn-shenzhen region.
|
||||
|
||||
2020-06-22 Version: 1.36.470
|
||||
- Add GetMultipleTrace api.
|
||||
- Add SearchTracesByPage api.
|
||||
- Add GetStack api.
|
||||
|
||||
2020-06-21 Version: 1.36.469
|
||||
- Add persons API.
|
||||
|
||||
2020-06-18 Version: 1.36.468
|
||||
- Supported TransformDBInstancePayType API.
|
||||
|
||||
2020-06-18 Version: 1.36.467
|
||||
- Add GetAuthToken OpenAPI.
|
||||
|
||||
2020-06-18 Version: 1.36.466
|
||||
- Public beta version.
|
||||
- Add Api Overseas.
|
||||
|
||||
2020-06-17 Version: 1.36.465
|
||||
- Supported sync create eni and assign private ip.
|
||||
|
||||
2020-06-17 Version: 1.36.464
|
||||
- Public beta version.
|
||||
- Add Api Overseas.
|
||||
|
||||
2020-06-16 Version: 1.36.463
|
||||
- Support TargetImageId in ApplyNodes Interface.
|
||||
|
||||
2020-06-16 Version: 1.36.462
|
||||
- Update monitor related API.
|
||||
|
||||
2020-06-15 Version: 1.36.461
|
||||
- Generated 2019-09-10 for `waf-openapi`.
|
||||
|
||||
2020-06-15 Version: 1.36.460
|
||||
- Generated 2019-09-10 for `waf-openapi`.
|
||||
|
||||
2020-06-12 Version: 1.36.459
|
||||
- Add CreateProduct API ProductSecret in Response.
|
||||
- Add AMQP APIs, including CreateSubscribeRelation, CreateConsumerGroup, etc.
|
||||
|
||||
@@ -61,6 +61,8 @@ endif()
|
||||
|
||||
if(BUILD_PRODUCT STREQUAL "")
|
||||
message(WARNING "Please set the value of 'BUILD_PRODUCT'")
|
||||
elseif(BUILD_PRODUCT STREQUAL "core")
|
||||
add_subdirectory(core)
|
||||
else()
|
||||
add_subdirectory(core)
|
||||
add_subdirectory(${BUILD_PRODUCT})
|
||||
|
||||
@@ -27,6 +27,10 @@ set(aliyuncvc_public_header_model
|
||||
include/alibabacloud/aliyuncvc/model/ActiveMeetingResult.h
|
||||
include/alibabacloud/aliyuncvc/model/BatchCreateDeviceRequest.h
|
||||
include/alibabacloud/aliyuncvc/model/BatchCreateDeviceResult.h
|
||||
include/alibabacloud/aliyuncvc/model/BatchDeleteDevicesRequest.h
|
||||
include/alibabacloud/aliyuncvc/model/BatchDeleteDevicesResult.h
|
||||
include/alibabacloud/aliyuncvc/model/CallDeviceRequest.h
|
||||
include/alibabacloud/aliyuncvc/model/CallDeviceResult.h
|
||||
include/alibabacloud/aliyuncvc/model/CreateDeviceMeetingRequest.h
|
||||
include/alibabacloud/aliyuncvc/model/CreateDeviceMeetingResult.h
|
||||
include/alibabacloud/aliyuncvc/model/CreateEvaluationRequest.h
|
||||
@@ -63,6 +67,8 @@ set(aliyuncvc_public_header_model
|
||||
include/alibabacloud/aliyuncvc/model/GetMeetingInternationalResult.h
|
||||
include/alibabacloud/aliyuncvc/model/GetMeetingMemberRequest.h
|
||||
include/alibabacloud/aliyuncvc/model/GetMeetingMemberResult.h
|
||||
include/alibabacloud/aliyuncvc/model/GetMembersRequest.h
|
||||
include/alibabacloud/aliyuncvc/model/GetMembersResult.h
|
||||
include/alibabacloud/aliyuncvc/model/GetUserRequest.h
|
||||
include/alibabacloud/aliyuncvc/model/GetUserResult.h
|
||||
include/alibabacloud/aliyuncvc/model/JoinDeviceMeetingRequest.h
|
||||
@@ -75,6 +81,8 @@ set(aliyuncvc_public_header_model
|
||||
include/alibabacloud/aliyuncvc/model/JoinMeetingInternationalResult.h
|
||||
include/alibabacloud/aliyuncvc/model/ListDeviceIpRequest.h
|
||||
include/alibabacloud/aliyuncvc/model/ListDeviceIpResult.h
|
||||
include/alibabacloud/aliyuncvc/model/ListDevicesRequest.h
|
||||
include/alibabacloud/aliyuncvc/model/ListDevicesResult.h
|
||||
include/alibabacloud/aliyuncvc/model/ListEvaluationsRequest.h
|
||||
include/alibabacloud/aliyuncvc/model/ListEvaluationsResult.h
|
||||
include/alibabacloud/aliyuncvc/model/ListIsvStatisticsRequest.h
|
||||
@@ -108,6 +116,10 @@ set(aliyuncvc_src
|
||||
src/model/ActiveMeetingResult.cc
|
||||
src/model/BatchCreateDeviceRequest.cc
|
||||
src/model/BatchCreateDeviceResult.cc
|
||||
src/model/BatchDeleteDevicesRequest.cc
|
||||
src/model/BatchDeleteDevicesResult.cc
|
||||
src/model/CallDeviceRequest.cc
|
||||
src/model/CallDeviceResult.cc
|
||||
src/model/CreateDeviceMeetingRequest.cc
|
||||
src/model/CreateDeviceMeetingResult.cc
|
||||
src/model/CreateEvaluationRequest.cc
|
||||
@@ -144,6 +156,8 @@ set(aliyuncvc_src
|
||||
src/model/GetMeetingInternationalResult.cc
|
||||
src/model/GetMeetingMemberRequest.cc
|
||||
src/model/GetMeetingMemberResult.cc
|
||||
src/model/GetMembersRequest.cc
|
||||
src/model/GetMembersResult.cc
|
||||
src/model/GetUserRequest.cc
|
||||
src/model/GetUserResult.cc
|
||||
src/model/JoinDeviceMeetingRequest.cc
|
||||
@@ -156,6 +170,8 @@ set(aliyuncvc_src
|
||||
src/model/JoinMeetingInternationalResult.cc
|
||||
src/model/ListDeviceIpRequest.cc
|
||||
src/model/ListDeviceIpResult.cc
|
||||
src/model/ListDevicesRequest.cc
|
||||
src/model/ListDevicesResult.cc
|
||||
src/model/ListEvaluationsRequest.cc
|
||||
src/model/ListEvaluationsResult.cc
|
||||
src/model/ListIsvStatisticsRequest.cc
|
||||
|
||||
@@ -28,6 +28,10 @@
|
||||
#include "model/ActiveMeetingResult.h"
|
||||
#include "model/BatchCreateDeviceRequest.h"
|
||||
#include "model/BatchCreateDeviceResult.h"
|
||||
#include "model/BatchDeleteDevicesRequest.h"
|
||||
#include "model/BatchDeleteDevicesResult.h"
|
||||
#include "model/CallDeviceRequest.h"
|
||||
#include "model/CallDeviceResult.h"
|
||||
#include "model/CreateDeviceMeetingRequest.h"
|
||||
#include "model/CreateDeviceMeetingResult.h"
|
||||
#include "model/CreateEvaluationRequest.h"
|
||||
@@ -64,6 +68,8 @@
|
||||
#include "model/GetMeetingInternationalResult.h"
|
||||
#include "model/GetMeetingMemberRequest.h"
|
||||
#include "model/GetMeetingMemberResult.h"
|
||||
#include "model/GetMembersRequest.h"
|
||||
#include "model/GetMembersResult.h"
|
||||
#include "model/GetUserRequest.h"
|
||||
#include "model/GetUserResult.h"
|
||||
#include "model/JoinDeviceMeetingRequest.h"
|
||||
@@ -76,6 +82,8 @@
|
||||
#include "model/JoinMeetingInternationalResult.h"
|
||||
#include "model/ListDeviceIpRequest.h"
|
||||
#include "model/ListDeviceIpResult.h"
|
||||
#include "model/ListDevicesRequest.h"
|
||||
#include "model/ListDevicesResult.h"
|
||||
#include "model/ListEvaluationsRequest.h"
|
||||
#include "model/ListEvaluationsResult.h"
|
||||
#include "model/ListIsvStatisticsRequest.h"
|
||||
@@ -118,6 +126,12 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::BatchCreateDeviceResult> BatchCreateDeviceOutcome;
|
||||
typedef std::future<BatchCreateDeviceOutcome> BatchCreateDeviceOutcomeCallable;
|
||||
typedef std::function<void(const AliyuncvcClient*, const Model::BatchCreateDeviceRequest&, const BatchCreateDeviceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> BatchCreateDeviceAsyncHandler;
|
||||
typedef Outcome<Error, Model::BatchDeleteDevicesResult> BatchDeleteDevicesOutcome;
|
||||
typedef std::future<BatchDeleteDevicesOutcome> BatchDeleteDevicesOutcomeCallable;
|
||||
typedef std::function<void(const AliyuncvcClient*, const Model::BatchDeleteDevicesRequest&, const BatchDeleteDevicesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> BatchDeleteDevicesAsyncHandler;
|
||||
typedef Outcome<Error, Model::CallDeviceResult> CallDeviceOutcome;
|
||||
typedef std::future<CallDeviceOutcome> CallDeviceOutcomeCallable;
|
||||
typedef std::function<void(const AliyuncvcClient*, const Model::CallDeviceRequest&, const CallDeviceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CallDeviceAsyncHandler;
|
||||
typedef Outcome<Error, Model::CreateDeviceMeetingResult> CreateDeviceMeetingOutcome;
|
||||
typedef std::future<CreateDeviceMeetingOutcome> CreateDeviceMeetingOutcomeCallable;
|
||||
typedef std::function<void(const AliyuncvcClient*, const Model::CreateDeviceMeetingRequest&, const CreateDeviceMeetingOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateDeviceMeetingAsyncHandler;
|
||||
@@ -172,6 +186,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::GetMeetingMemberResult> GetMeetingMemberOutcome;
|
||||
typedef std::future<GetMeetingMemberOutcome> GetMeetingMemberOutcomeCallable;
|
||||
typedef std::function<void(const AliyuncvcClient*, const Model::GetMeetingMemberRequest&, const GetMeetingMemberOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetMeetingMemberAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetMembersResult> GetMembersOutcome;
|
||||
typedef std::future<GetMembersOutcome> GetMembersOutcomeCallable;
|
||||
typedef std::function<void(const AliyuncvcClient*, const Model::GetMembersRequest&, const GetMembersOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetMembersAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetUserResult> GetUserOutcome;
|
||||
typedef std::future<GetUserOutcome> GetUserOutcomeCallable;
|
||||
typedef std::function<void(const AliyuncvcClient*, const Model::GetUserRequest&, const GetUserOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetUserAsyncHandler;
|
||||
@@ -190,6 +207,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::ListDeviceIpResult> ListDeviceIpOutcome;
|
||||
typedef std::future<ListDeviceIpOutcome> ListDeviceIpOutcomeCallable;
|
||||
typedef std::function<void(const AliyuncvcClient*, const Model::ListDeviceIpRequest&, const ListDeviceIpOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListDeviceIpAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListDevicesResult> ListDevicesOutcome;
|
||||
typedef std::future<ListDevicesOutcome> ListDevicesOutcomeCallable;
|
||||
typedef std::function<void(const AliyuncvcClient*, const Model::ListDevicesRequest&, const ListDevicesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListDevicesAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListEvaluationsResult> ListEvaluationsOutcome;
|
||||
typedef std::future<ListEvaluationsOutcome> ListEvaluationsOutcomeCallable;
|
||||
typedef std::function<void(const AliyuncvcClient*, const Model::ListEvaluationsRequest&, const ListEvaluationsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListEvaluationsAsyncHandler;
|
||||
@@ -240,6 +260,12 @@ namespace AlibabaCloud
|
||||
BatchCreateDeviceOutcome batchCreateDevice(const Model::BatchCreateDeviceRequest &request)const;
|
||||
void batchCreateDeviceAsync(const Model::BatchCreateDeviceRequest& request, const BatchCreateDeviceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
BatchCreateDeviceOutcomeCallable batchCreateDeviceCallable(const Model::BatchCreateDeviceRequest& request) const;
|
||||
BatchDeleteDevicesOutcome batchDeleteDevices(const Model::BatchDeleteDevicesRequest &request)const;
|
||||
void batchDeleteDevicesAsync(const Model::BatchDeleteDevicesRequest& request, const BatchDeleteDevicesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
BatchDeleteDevicesOutcomeCallable batchDeleteDevicesCallable(const Model::BatchDeleteDevicesRequest& request) const;
|
||||
CallDeviceOutcome callDevice(const Model::CallDeviceRequest &request)const;
|
||||
void callDeviceAsync(const Model::CallDeviceRequest& request, const CallDeviceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
CallDeviceOutcomeCallable callDeviceCallable(const Model::CallDeviceRequest& request) const;
|
||||
CreateDeviceMeetingOutcome createDeviceMeeting(const Model::CreateDeviceMeetingRequest &request)const;
|
||||
void createDeviceMeetingAsync(const Model::CreateDeviceMeetingRequest& request, const CreateDeviceMeetingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
CreateDeviceMeetingOutcomeCallable createDeviceMeetingCallable(const Model::CreateDeviceMeetingRequest& request) const;
|
||||
@@ -294,6 +320,9 @@ namespace AlibabaCloud
|
||||
GetMeetingMemberOutcome getMeetingMember(const Model::GetMeetingMemberRequest &request)const;
|
||||
void getMeetingMemberAsync(const Model::GetMeetingMemberRequest& request, const GetMeetingMemberAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetMeetingMemberOutcomeCallable getMeetingMemberCallable(const Model::GetMeetingMemberRequest& request) const;
|
||||
GetMembersOutcome getMembers(const Model::GetMembersRequest &request)const;
|
||||
void getMembersAsync(const Model::GetMembersRequest& request, const GetMembersAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetMembersOutcomeCallable getMembersCallable(const Model::GetMembersRequest& request) const;
|
||||
GetUserOutcome getUser(const Model::GetUserRequest &request)const;
|
||||
void getUserAsync(const Model::GetUserRequest& request, const GetUserAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetUserOutcomeCallable getUserCallable(const Model::GetUserRequest& request) const;
|
||||
@@ -312,6 +341,9 @@ namespace AlibabaCloud
|
||||
ListDeviceIpOutcome listDeviceIp(const Model::ListDeviceIpRequest &request)const;
|
||||
void listDeviceIpAsync(const Model::ListDeviceIpRequest& request, const ListDeviceIpAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListDeviceIpOutcomeCallable listDeviceIpCallable(const Model::ListDeviceIpRequest& request) const;
|
||||
ListDevicesOutcome listDevices(const Model::ListDevicesRequest &request)const;
|
||||
void listDevicesAsync(const Model::ListDevicesRequest& request, const ListDevicesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListDevicesOutcomeCallable listDevicesCallable(const Model::ListDevicesRequest& request) const;
|
||||
ListEvaluationsOutcome listEvaluations(const Model::ListEvaluationsRequest &request)const;
|
||||
void listEvaluationsAsync(const Model::ListEvaluationsRequest& request, const ListEvaluationsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListEvaluationsOutcomeCallable listEvaluationsCallable(const Model::ListEvaluationsRequest& request) const;
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ALIYUNCVC_MODEL_BATCHDELETEDEVICESREQUEST_H_
|
||||
#define ALIBABACLOUD_ALIYUNCVC_MODEL_BATCHDELETEDEVICESREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/aliyuncvc/AliyuncvcExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Aliyuncvc
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ALIYUNCVC_EXPORT BatchDeleteDevicesRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
BatchDeleteDevicesRequest();
|
||||
~BatchDeleteDevicesRequest();
|
||||
|
||||
std::string getGroupId()const;
|
||||
void setGroupId(const std::string& groupId);
|
||||
std::string getSN()const;
|
||||
void setSN(const std::string& sN);
|
||||
|
||||
private:
|
||||
std::string groupId_;
|
||||
std::string sN_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ALIYUNCVC_MODEL_BATCHDELETEDEVICESREQUEST_H_
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ALIYUNCVC_MODEL_BATCHDELETEDEVICESRESULT_H_
|
||||
#define ALIBABACLOUD_ALIYUNCVC_MODEL_BATCHDELETEDEVICESRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/aliyuncvc/AliyuncvcExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Aliyuncvc
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ALIYUNCVC_EXPORT BatchDeleteDevicesResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
BatchDeleteDevicesResult();
|
||||
explicit BatchDeleteDevicesResult(const std::string &payload);
|
||||
~BatchDeleteDevicesResult();
|
||||
std::string getMessage()const;
|
||||
int getErrorCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
int errorCode_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ALIYUNCVC_MODEL_BATCHDELETEDEVICESRESULT_H_
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ALIYUNCVC_MODEL_CALLDEVICEREQUEST_H_
|
||||
#define ALIBABACLOUD_ALIYUNCVC_MODEL_CALLDEVICEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/aliyuncvc/AliyuncvcExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Aliyuncvc
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ALIYUNCVC_EXPORT CallDeviceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
CallDeviceRequest();
|
||||
~CallDeviceRequest();
|
||||
|
||||
std::string getInviteName()const;
|
||||
void setInviteName(const std::string& inviteName);
|
||||
std::string getOperateUserId()const;
|
||||
void setOperateUserId(const std::string& operateUserId);
|
||||
bool getJoinMeetingFlag()const;
|
||||
void setJoinMeetingFlag(bool joinMeetingFlag);
|
||||
std::string getMeetingCode()const;
|
||||
void setMeetingCode(const std::string& meetingCode);
|
||||
std::string getSN()const;
|
||||
void setSN(const std::string& sN);
|
||||
|
||||
private:
|
||||
std::string inviteName_;
|
||||
std::string operateUserId_;
|
||||
bool joinMeetingFlag_;
|
||||
std::string meetingCode_;
|
||||
std::string sN_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ALIYUNCVC_MODEL_CALLDEVICEREQUEST_H_
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ALIYUNCVC_MODEL_CALLDEVICERESULT_H_
|
||||
#define ALIBABACLOUD_ALIYUNCVC_MODEL_CALLDEVICERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/aliyuncvc/AliyuncvcExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Aliyuncvc
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ALIYUNCVC_EXPORT CallDeviceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
CallDeviceResult();
|
||||
explicit CallDeviceResult(const std::string &payload);
|
||||
~CallDeviceResult();
|
||||
std::string getMessage()const;
|
||||
int getErrorCode()const;
|
||||
bool getSuccess()const;
|
||||
std::string getMessageId()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
int errorCode_;
|
||||
bool success_;
|
||||
std::string messageId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ALIYUNCVC_MODEL_CALLDEVICERESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ALIYUNCVC_MODEL_GETMEMBERSREQUEST_H_
|
||||
#define ALIBABACLOUD_ALIYUNCVC_MODEL_GETMEMBERSREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/aliyuncvc/AliyuncvcExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Aliyuncvc
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ALIYUNCVC_EXPORT GetMembersRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetMembersRequest();
|
||||
~GetMembersRequest();
|
||||
|
||||
std::string getMeetingUUID()const;
|
||||
void setMeetingUUID(const std::string& meetingUUID);
|
||||
|
||||
private:
|
||||
std::string meetingUUID_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ALIYUNCVC_MODEL_GETMEMBERSREQUEST_H_
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ALIYUNCVC_MODEL_GETMEMBERSRESULT_H_
|
||||
#define ALIBABACLOUD_ALIYUNCVC_MODEL_GETMEMBERSRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/aliyuncvc/AliyuncvcExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Aliyuncvc
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ALIYUNCVC_EXPORT GetMembersResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct MeetingInfo
|
||||
{
|
||||
struct MemberListItem
|
||||
{
|
||||
std::string status;
|
||||
std::string userName;
|
||||
std::string memberUUID;
|
||||
std::string userId;
|
||||
std::string userAvatarUrl;
|
||||
};
|
||||
std::string meetingCode;
|
||||
std::string meetingUUID;
|
||||
std::vector<MemberListItem> memberList;
|
||||
std::string userId;
|
||||
long createTime;
|
||||
std::string meetingName;
|
||||
long validTime;
|
||||
};
|
||||
|
||||
|
||||
GetMembersResult();
|
||||
explicit GetMembersResult(const std::string &payload);
|
||||
~GetMembersResult();
|
||||
MeetingInfo getMeetingInfo()const;
|
||||
std::string getMessage()const;
|
||||
int getErrorCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
MeetingInfo meetingInfo_;
|
||||
std::string message_;
|
||||
int errorCode_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ALIYUNCVC_MODEL_GETMEMBERSRESULT_H_
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ALIYUNCVC_MODEL_LISTDEVICESREQUEST_H_
|
||||
#define ALIBABACLOUD_ALIYUNCVC_MODEL_LISTDEVICESREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/aliyuncvc/AliyuncvcExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Aliyuncvc
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ALIYUNCVC_EXPORT ListDevicesRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
ListDevicesRequest();
|
||||
~ListDevicesRequest();
|
||||
|
||||
std::string getCastScreenCode()const;
|
||||
void setCastScreenCode(const std::string& castScreenCode);
|
||||
int getPageNumber()const;
|
||||
void setPageNumber(int pageNumber);
|
||||
int getPageSize()const;
|
||||
void setPageSize(int pageSize);
|
||||
std::string getSN()const;
|
||||
void setSN(const std::string& sN);
|
||||
|
||||
private:
|
||||
std::string castScreenCode_;
|
||||
int pageNumber_;
|
||||
int pageSize_;
|
||||
std::string sN_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ALIYUNCVC_MODEL_LISTDEVICESREQUEST_H_
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ALIYUNCVC_MODEL_LISTDEVICESRESULT_H_
|
||||
#define ALIBABACLOUD_ALIYUNCVC_MODEL_LISTDEVICESRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/aliyuncvc/AliyuncvcExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Aliyuncvc
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ALIYUNCVC_EXPORT ListDevicesResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Device
|
||||
{
|
||||
std::string status;
|
||||
std::string castScreenCode;
|
||||
std::string createTime;
|
||||
std::string pictureUrl;
|
||||
std::string sN;
|
||||
std::string conferenceName;
|
||||
std::string activationCode;
|
||||
std::string conferenceCode;
|
||||
};
|
||||
int pageSize;
|
||||
int pageNumber;
|
||||
int total;
|
||||
std::vector<Device> devices;
|
||||
};
|
||||
|
||||
|
||||
ListDevicesResult();
|
||||
explicit ListDevicesResult(const std::string &payload);
|
||||
~ListDevicesResult();
|
||||
std::string getMessage()const;
|
||||
Data getData()const;
|
||||
int getErrorCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
Data data_;
|
||||
int errorCode_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ALIYUNCVC_MODEL_LISTDEVICESRESULT_H_
|
||||
@@ -159,6 +159,78 @@ AliyuncvcClient::BatchCreateDeviceOutcomeCallable AliyuncvcClient::batchCreateDe
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AliyuncvcClient::BatchDeleteDevicesOutcome AliyuncvcClient::batchDeleteDevices(const BatchDeleteDevicesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return BatchDeleteDevicesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return BatchDeleteDevicesOutcome(BatchDeleteDevicesResult(outcome.result()));
|
||||
else
|
||||
return BatchDeleteDevicesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AliyuncvcClient::batchDeleteDevicesAsync(const BatchDeleteDevicesRequest& request, const BatchDeleteDevicesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, batchDeleteDevices(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AliyuncvcClient::BatchDeleteDevicesOutcomeCallable AliyuncvcClient::batchDeleteDevicesCallable(const BatchDeleteDevicesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<BatchDeleteDevicesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->batchDeleteDevices(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AliyuncvcClient::CallDeviceOutcome AliyuncvcClient::callDevice(const CallDeviceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CallDeviceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CallDeviceOutcome(CallDeviceResult(outcome.result()));
|
||||
else
|
||||
return CallDeviceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AliyuncvcClient::callDeviceAsync(const CallDeviceRequest& request, const CallDeviceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, callDevice(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AliyuncvcClient::CallDeviceOutcomeCallable AliyuncvcClient::callDeviceCallable(const CallDeviceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CallDeviceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->callDevice(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AliyuncvcClient::CreateDeviceMeetingOutcome AliyuncvcClient::createDeviceMeeting(const CreateDeviceMeetingRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -807,6 +879,42 @@ AliyuncvcClient::GetMeetingMemberOutcomeCallable AliyuncvcClient::getMeetingMemb
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AliyuncvcClient::GetMembersOutcome AliyuncvcClient::getMembers(const GetMembersRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetMembersOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetMembersOutcome(GetMembersResult(outcome.result()));
|
||||
else
|
||||
return GetMembersOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AliyuncvcClient::getMembersAsync(const GetMembersRequest& request, const GetMembersAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getMembers(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AliyuncvcClient::GetMembersOutcomeCallable AliyuncvcClient::getMembersCallable(const GetMembersRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetMembersOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getMembers(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AliyuncvcClient::GetUserOutcome AliyuncvcClient::getUser(const GetUserRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -1023,6 +1131,42 @@ AliyuncvcClient::ListDeviceIpOutcomeCallable AliyuncvcClient::listDeviceIpCallab
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AliyuncvcClient::ListDevicesOutcome AliyuncvcClient::listDevices(const ListDevicesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListDevicesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListDevicesOutcome(ListDevicesResult(outcome.result()));
|
||||
else
|
||||
return ListDevicesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AliyuncvcClient::listDevicesAsync(const ListDevicesRequest& request, const ListDevicesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listDevices(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AliyuncvcClient::ListDevicesOutcomeCallable AliyuncvcClient::listDevicesCallable(const ListDevicesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListDevicesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listDevices(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AliyuncvcClient::ListEvaluationsOutcome AliyuncvcClient::listEvaluations(const ListEvaluationsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
51
aliyuncvc/src/model/BatchDeleteDevicesRequest.cc
Normal file
51
aliyuncvc/src/model/BatchDeleteDevicesRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/aliyuncvc/model/BatchDeleteDevicesRequest.h>
|
||||
|
||||
using AlibabaCloud::Aliyuncvc::Model::BatchDeleteDevicesRequest;
|
||||
|
||||
BatchDeleteDevicesRequest::BatchDeleteDevicesRequest() :
|
||||
RpcServiceRequest("aliyuncvc", "2020-03-30", "BatchDeleteDevices")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
BatchDeleteDevicesRequest::~BatchDeleteDevicesRequest()
|
||||
{}
|
||||
|
||||
std::string BatchDeleteDevicesRequest::getGroupId()const
|
||||
{
|
||||
return groupId_;
|
||||
}
|
||||
|
||||
void BatchDeleteDevicesRequest::setGroupId(const std::string& groupId)
|
||||
{
|
||||
groupId_ = groupId;
|
||||
setBodyParameter("GroupId", groupId);
|
||||
}
|
||||
|
||||
std::string BatchDeleteDevicesRequest::getSN()const
|
||||
{
|
||||
return sN_;
|
||||
}
|
||||
|
||||
void BatchDeleteDevicesRequest::setSN(const std::string& sN)
|
||||
{
|
||||
sN_ = sN;
|
||||
setBodyParameter("SN", sN);
|
||||
}
|
||||
|
||||
65
aliyuncvc/src/model/BatchDeleteDevicesResult.cc
Normal file
65
aliyuncvc/src/model/BatchDeleteDevicesResult.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/aliyuncvc/model/BatchDeleteDevicesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Aliyuncvc;
|
||||
using namespace AlibabaCloud::Aliyuncvc::Model;
|
||||
|
||||
BatchDeleteDevicesResult::BatchDeleteDevicesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
BatchDeleteDevicesResult::BatchDeleteDevicesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
BatchDeleteDevicesResult::~BatchDeleteDevicesResult()
|
||||
{}
|
||||
|
||||
void BatchDeleteDevicesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["ErrorCode"].isNull())
|
||||
errorCode_ = std::stoi(value["ErrorCode"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string BatchDeleteDevicesResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
int BatchDeleteDevicesResult::getErrorCode()const
|
||||
{
|
||||
return errorCode_;
|
||||
}
|
||||
|
||||
bool BatchDeleteDevicesResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
84
aliyuncvc/src/model/CallDeviceRequest.cc
Normal file
84
aliyuncvc/src/model/CallDeviceRequest.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/aliyuncvc/model/CallDeviceRequest.h>
|
||||
|
||||
using AlibabaCloud::Aliyuncvc::Model::CallDeviceRequest;
|
||||
|
||||
CallDeviceRequest::CallDeviceRequest() :
|
||||
RpcServiceRequest("aliyuncvc", "2019-10-30", "CallDevice")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CallDeviceRequest::~CallDeviceRequest()
|
||||
{}
|
||||
|
||||
std::string CallDeviceRequest::getInviteName()const
|
||||
{
|
||||
return inviteName_;
|
||||
}
|
||||
|
||||
void CallDeviceRequest::setInviteName(const std::string& inviteName)
|
||||
{
|
||||
inviteName_ = inviteName;
|
||||
setBodyParameter("InviteName", inviteName);
|
||||
}
|
||||
|
||||
std::string CallDeviceRequest::getOperateUserId()const
|
||||
{
|
||||
return operateUserId_;
|
||||
}
|
||||
|
||||
void CallDeviceRequest::setOperateUserId(const std::string& operateUserId)
|
||||
{
|
||||
operateUserId_ = operateUserId;
|
||||
setBodyParameter("OperateUserId", operateUserId);
|
||||
}
|
||||
|
||||
bool CallDeviceRequest::getJoinMeetingFlag()const
|
||||
{
|
||||
return joinMeetingFlag_;
|
||||
}
|
||||
|
||||
void CallDeviceRequest::setJoinMeetingFlag(bool joinMeetingFlag)
|
||||
{
|
||||
joinMeetingFlag_ = joinMeetingFlag;
|
||||
setParameter("JoinMeetingFlag", joinMeetingFlag ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string CallDeviceRequest::getMeetingCode()const
|
||||
{
|
||||
return meetingCode_;
|
||||
}
|
||||
|
||||
void CallDeviceRequest::setMeetingCode(const std::string& meetingCode)
|
||||
{
|
||||
meetingCode_ = meetingCode;
|
||||
setBodyParameter("MeetingCode", meetingCode);
|
||||
}
|
||||
|
||||
std::string CallDeviceRequest::getSN()const
|
||||
{
|
||||
return sN_;
|
||||
}
|
||||
|
||||
void CallDeviceRequest::setSN(const std::string& sN)
|
||||
{
|
||||
sN_ = sN;
|
||||
setBodyParameter("SN", sN);
|
||||
}
|
||||
|
||||
72
aliyuncvc/src/model/CallDeviceResult.cc
Normal file
72
aliyuncvc/src/model/CallDeviceResult.cc
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/aliyuncvc/model/CallDeviceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Aliyuncvc;
|
||||
using namespace AlibabaCloud::Aliyuncvc::Model;
|
||||
|
||||
CallDeviceResult::CallDeviceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CallDeviceResult::CallDeviceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CallDeviceResult::~CallDeviceResult()
|
||||
{}
|
||||
|
||||
void CallDeviceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["ErrorCode"].isNull())
|
||||
errorCode_ = std::stoi(value["ErrorCode"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["MessageId"].isNull())
|
||||
messageId_ = value["MessageId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string CallDeviceResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
int CallDeviceResult::getErrorCode()const
|
||||
{
|
||||
return errorCode_;
|
||||
}
|
||||
|
||||
bool CallDeviceResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
std::string CallDeviceResult::getMessageId()const
|
||||
{
|
||||
return messageId_;
|
||||
}
|
||||
|
||||
40
aliyuncvc/src/model/GetMembersRequest.cc
Normal file
40
aliyuncvc/src/model/GetMembersRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/aliyuncvc/model/GetMembersRequest.h>
|
||||
|
||||
using AlibabaCloud::Aliyuncvc::Model::GetMembersRequest;
|
||||
|
||||
GetMembersRequest::GetMembersRequest() :
|
||||
RpcServiceRequest("aliyuncvc", "2020-03-30", "GetMembers")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetMembersRequest::~GetMembersRequest()
|
||||
{}
|
||||
|
||||
std::string GetMembersRequest::getMeetingUUID()const
|
||||
{
|
||||
return meetingUUID_;
|
||||
}
|
||||
|
||||
void GetMembersRequest::setMeetingUUID(const std::string& meetingUUID)
|
||||
{
|
||||
meetingUUID_ = meetingUUID;
|
||||
setBodyParameter("MeetingUUID", meetingUUID);
|
||||
}
|
||||
|
||||
99
aliyuncvc/src/model/GetMembersResult.cc
Normal file
99
aliyuncvc/src/model/GetMembersResult.cc
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/aliyuncvc/model/GetMembersResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Aliyuncvc;
|
||||
using namespace AlibabaCloud::Aliyuncvc::Model;
|
||||
|
||||
GetMembersResult::GetMembersResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetMembersResult::GetMembersResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetMembersResult::~GetMembersResult()
|
||||
{}
|
||||
|
||||
void GetMembersResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto meetingInfoNode = value["MeetingInfo"];
|
||||
if(!meetingInfoNode["MeetingName"].isNull())
|
||||
meetingInfo_.meetingName = meetingInfoNode["MeetingName"].asString();
|
||||
if(!meetingInfoNode["ValidTime"].isNull())
|
||||
meetingInfo_.validTime = std::stol(meetingInfoNode["ValidTime"].asString());
|
||||
if(!meetingInfoNode["MeetingCode"].isNull())
|
||||
meetingInfo_.meetingCode = meetingInfoNode["MeetingCode"].asString();
|
||||
if(!meetingInfoNode["CreateTime"].isNull())
|
||||
meetingInfo_.createTime = std::stol(meetingInfoNode["CreateTime"].asString());
|
||||
if(!meetingInfoNode["UserId"].isNull())
|
||||
meetingInfo_.userId = meetingInfoNode["UserId"].asString();
|
||||
if(!meetingInfoNode["MeetingUUID"].isNull())
|
||||
meetingInfo_.meetingUUID = meetingInfoNode["MeetingUUID"].asString();
|
||||
auto allMemberListNode = meetingInfoNode["MemberList"]["MemberListItem"];
|
||||
for (auto meetingInfoNodeMemberListMemberListItem : allMemberListNode)
|
||||
{
|
||||
MeetingInfo::MemberListItem memberListItemObject;
|
||||
if(!meetingInfoNodeMemberListMemberListItem["UserAvatarUrl"].isNull())
|
||||
memberListItemObject.userAvatarUrl = meetingInfoNodeMemberListMemberListItem["UserAvatarUrl"].asString();
|
||||
if(!meetingInfoNodeMemberListMemberListItem["MemberUUID"].isNull())
|
||||
memberListItemObject.memberUUID = meetingInfoNodeMemberListMemberListItem["MemberUUID"].asString();
|
||||
if(!meetingInfoNodeMemberListMemberListItem["UserName"].isNull())
|
||||
memberListItemObject.userName = meetingInfoNodeMemberListMemberListItem["UserName"].asString();
|
||||
if(!meetingInfoNodeMemberListMemberListItem["UserId"].isNull())
|
||||
memberListItemObject.userId = meetingInfoNodeMemberListMemberListItem["UserId"].asString();
|
||||
if(!meetingInfoNodeMemberListMemberListItem["Status"].isNull())
|
||||
memberListItemObject.status = meetingInfoNodeMemberListMemberListItem["Status"].asString();
|
||||
meetingInfo_.memberList.push_back(memberListItemObject);
|
||||
}
|
||||
if(!value["ErrorCode"].isNull())
|
||||
errorCode_ = std::stoi(value["ErrorCode"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
GetMembersResult::MeetingInfo GetMembersResult::getMeetingInfo()const
|
||||
{
|
||||
return meetingInfo_;
|
||||
}
|
||||
|
||||
std::string GetMembersResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
int GetMembersResult::getErrorCode()const
|
||||
{
|
||||
return errorCode_;
|
||||
}
|
||||
|
||||
bool GetMembersResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
73
aliyuncvc/src/model/ListDevicesRequest.cc
Normal file
73
aliyuncvc/src/model/ListDevicesRequest.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/aliyuncvc/model/ListDevicesRequest.h>
|
||||
|
||||
using AlibabaCloud::Aliyuncvc::Model::ListDevicesRequest;
|
||||
|
||||
ListDevicesRequest::ListDevicesRequest() :
|
||||
RpcServiceRequest("aliyuncvc", "2019-10-30", "ListDevices")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListDevicesRequest::~ListDevicesRequest()
|
||||
{}
|
||||
|
||||
std::string ListDevicesRequest::getCastScreenCode()const
|
||||
{
|
||||
return castScreenCode_;
|
||||
}
|
||||
|
||||
void ListDevicesRequest::setCastScreenCode(const std::string& castScreenCode)
|
||||
{
|
||||
castScreenCode_ = castScreenCode;
|
||||
setParameter("CastScreenCode", castScreenCode);
|
||||
}
|
||||
|
||||
int ListDevicesRequest::getPageNumber()const
|
||||
{
|
||||
return pageNumber_;
|
||||
}
|
||||
|
||||
void ListDevicesRequest::setPageNumber(int pageNumber)
|
||||
{
|
||||
pageNumber_ = pageNumber;
|
||||
setParameter("PageNumber", std::to_string(pageNumber));
|
||||
}
|
||||
|
||||
int ListDevicesRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListDevicesRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
std::string ListDevicesRequest::getSN()const
|
||||
{
|
||||
return sN_;
|
||||
}
|
||||
|
||||
void ListDevicesRequest::setSN(const std::string& sN)
|
||||
{
|
||||
sN_ = sN;
|
||||
setParameter("SN", sN);
|
||||
}
|
||||
|
||||
99
aliyuncvc/src/model/ListDevicesResult.cc
Normal file
99
aliyuncvc/src/model/ListDevicesResult.cc
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/aliyuncvc/model/ListDevicesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Aliyuncvc;
|
||||
using namespace AlibabaCloud::Aliyuncvc::Model;
|
||||
|
||||
ListDevicesResult::ListDevicesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListDevicesResult::ListDevicesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListDevicesResult::~ListDevicesResult()
|
||||
{}
|
||||
|
||||
void ListDevicesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Total"].isNull())
|
||||
data_.total = std::stoi(dataNode["Total"].asString());
|
||||
if(!dataNode["PageSize"].isNull())
|
||||
data_.pageSize = std::stoi(dataNode["PageSize"].asString());
|
||||
if(!dataNode["PageNumber"].isNull())
|
||||
data_.pageNumber = std::stoi(dataNode["PageNumber"].asString());
|
||||
auto allDevicesNode = dataNode["Devices"]["Device"];
|
||||
for (auto dataNodeDevicesDevice : allDevicesNode)
|
||||
{
|
||||
Data::Device deviceObject;
|
||||
if(!dataNodeDevicesDevice["ActivationCode"].isNull())
|
||||
deviceObject.activationCode = dataNodeDevicesDevice["ActivationCode"].asString();
|
||||
if(!dataNodeDevicesDevice["ConferenceCode"].isNull())
|
||||
deviceObject.conferenceCode = dataNodeDevicesDevice["ConferenceCode"].asString();
|
||||
if(!dataNodeDevicesDevice["ConferenceName"].isNull())
|
||||
deviceObject.conferenceName = dataNodeDevicesDevice["ConferenceName"].asString();
|
||||
if(!dataNodeDevicesDevice["CreateTime"].isNull())
|
||||
deviceObject.createTime = dataNodeDevicesDevice["CreateTime"].asString();
|
||||
if(!dataNodeDevicesDevice["PictureUrl"].isNull())
|
||||
deviceObject.pictureUrl = dataNodeDevicesDevice["PictureUrl"].asString();
|
||||
if(!dataNodeDevicesDevice["SN"].isNull())
|
||||
deviceObject.sN = dataNodeDevicesDevice["SN"].asString();
|
||||
if(!dataNodeDevicesDevice["Status"].isNull())
|
||||
deviceObject.status = dataNodeDevicesDevice["Status"].asString();
|
||||
if(!dataNodeDevicesDevice["CastScreenCode"].isNull())
|
||||
deviceObject.castScreenCode = dataNodeDevicesDevice["CastScreenCode"].asString();
|
||||
data_.devices.push_back(deviceObject);
|
||||
}
|
||||
if(!value["ErrorCode"].isNull())
|
||||
errorCode_ = std::stoi(value["ErrorCode"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string ListDevicesResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
ListDevicesResult::Data ListDevicesResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int ListDevicesResult::getErrorCode()const
|
||||
{
|
||||
return errorCode_;
|
||||
}
|
||||
|
||||
bool ListDevicesResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@ set(amqp-open_public_header_model
|
||||
include/alibabacloud/amqp-open/model/DeleteQueueResult.h
|
||||
include/alibabacloud/amqp-open/model/DeleteVirtualHostRequest.h
|
||||
include/alibabacloud/amqp-open/model/DeleteVirtualHostResult.h
|
||||
include/alibabacloud/amqp-open/model/GetMetadataAmountRequest.h
|
||||
include/alibabacloud/amqp-open/model/GetMetadataAmountResult.h
|
||||
include/alibabacloud/amqp-open/model/ListBindingsRequest.h
|
||||
include/alibabacloud/amqp-open/model/ListBindingsResult.h
|
||||
include/alibabacloud/amqp-open/model/ListDownStreamBindingsRequest.h
|
||||
@@ -47,6 +49,8 @@ set(amqp-open_public_header_model
|
||||
include/alibabacloud/amqp-open/model/ListExchangesResult.h
|
||||
include/alibabacloud/amqp-open/model/ListInstancesRequest.h
|
||||
include/alibabacloud/amqp-open/model/ListInstancesResult.h
|
||||
include/alibabacloud/amqp-open/model/ListQueueConsumersRequest.h
|
||||
include/alibabacloud/amqp-open/model/ListQueueConsumersResult.h
|
||||
include/alibabacloud/amqp-open/model/ListQueueUpStreamBindingsRequest.h
|
||||
include/alibabacloud/amqp-open/model/ListQueueUpStreamBindingsResult.h
|
||||
include/alibabacloud/amqp-open/model/ListQueuesRequest.h
|
||||
@@ -72,6 +76,8 @@ set(amqp-open_src
|
||||
src/model/DeleteQueueResult.cc
|
||||
src/model/DeleteVirtualHostRequest.cc
|
||||
src/model/DeleteVirtualHostResult.cc
|
||||
src/model/GetMetadataAmountRequest.cc
|
||||
src/model/GetMetadataAmountResult.cc
|
||||
src/model/ListBindingsRequest.cc
|
||||
src/model/ListBindingsResult.cc
|
||||
src/model/ListDownStreamBindingsRequest.cc
|
||||
@@ -82,6 +88,8 @@ set(amqp-open_src
|
||||
src/model/ListExchangesResult.cc
|
||||
src/model/ListInstancesRequest.cc
|
||||
src/model/ListInstancesResult.cc
|
||||
src/model/ListQueueConsumersRequest.cc
|
||||
src/model/ListQueueConsumersResult.cc
|
||||
src/model/ListQueueUpStreamBindingsRequest.cc
|
||||
src/model/ListQueueUpStreamBindingsResult.cc
|
||||
src/model/ListQueuesRequest.cc
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
#include "model/DeleteQueueResult.h"
|
||||
#include "model/DeleteVirtualHostRequest.h"
|
||||
#include "model/DeleteVirtualHostResult.h"
|
||||
#include "model/GetMetadataAmountRequest.h"
|
||||
#include "model/GetMetadataAmountResult.h"
|
||||
#include "model/ListBindingsRequest.h"
|
||||
#include "model/ListBindingsResult.h"
|
||||
#include "model/ListDownStreamBindingsRequest.h"
|
||||
@@ -48,6 +50,8 @@
|
||||
#include "model/ListExchangesResult.h"
|
||||
#include "model/ListInstancesRequest.h"
|
||||
#include "model/ListInstancesResult.h"
|
||||
#include "model/ListQueueConsumersRequest.h"
|
||||
#include "model/ListQueueConsumersResult.h"
|
||||
#include "model/ListQueueUpStreamBindingsRequest.h"
|
||||
#include "model/ListQueueUpStreamBindingsResult.h"
|
||||
#include "model/ListQueuesRequest.h"
|
||||
@@ -87,6 +91,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::DeleteVirtualHostResult> DeleteVirtualHostOutcome;
|
||||
typedef std::future<DeleteVirtualHostOutcome> DeleteVirtualHostOutcomeCallable;
|
||||
typedef std::function<void(const Amqp_openClient*, const Model::DeleteVirtualHostRequest&, const DeleteVirtualHostOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteVirtualHostAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetMetadataAmountResult> GetMetadataAmountOutcome;
|
||||
typedef std::future<GetMetadataAmountOutcome> GetMetadataAmountOutcomeCallable;
|
||||
typedef std::function<void(const Amqp_openClient*, const Model::GetMetadataAmountRequest&, const GetMetadataAmountOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetMetadataAmountAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListBindingsResult> ListBindingsOutcome;
|
||||
typedef std::future<ListBindingsOutcome> ListBindingsOutcomeCallable;
|
||||
typedef std::function<void(const Amqp_openClient*, const Model::ListBindingsRequest&, const ListBindingsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListBindingsAsyncHandler;
|
||||
@@ -102,6 +109,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::ListInstancesResult> ListInstancesOutcome;
|
||||
typedef std::future<ListInstancesOutcome> ListInstancesOutcomeCallable;
|
||||
typedef std::function<void(const Amqp_openClient*, const Model::ListInstancesRequest&, const ListInstancesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListInstancesAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListQueueConsumersResult> ListQueueConsumersOutcome;
|
||||
typedef std::future<ListQueueConsumersOutcome> ListQueueConsumersOutcomeCallable;
|
||||
typedef std::function<void(const Amqp_openClient*, const Model::ListQueueConsumersRequest&, const ListQueueConsumersOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListQueueConsumersAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListQueueUpStreamBindingsResult> ListQueueUpStreamBindingsOutcome;
|
||||
typedef std::future<ListQueueUpStreamBindingsOutcome> ListQueueUpStreamBindingsOutcomeCallable;
|
||||
typedef std::function<void(const Amqp_openClient*, const Model::ListQueueUpStreamBindingsRequest&, const ListQueueUpStreamBindingsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListQueueUpStreamBindingsAsyncHandler;
|
||||
@@ -140,6 +150,9 @@ namespace AlibabaCloud
|
||||
DeleteVirtualHostOutcome deleteVirtualHost(const Model::DeleteVirtualHostRequest &request)const;
|
||||
void deleteVirtualHostAsync(const Model::DeleteVirtualHostRequest& request, const DeleteVirtualHostAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DeleteVirtualHostOutcomeCallable deleteVirtualHostCallable(const Model::DeleteVirtualHostRequest& request) const;
|
||||
GetMetadataAmountOutcome getMetadataAmount(const Model::GetMetadataAmountRequest &request)const;
|
||||
void getMetadataAmountAsync(const Model::GetMetadataAmountRequest& request, const GetMetadataAmountAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetMetadataAmountOutcomeCallable getMetadataAmountCallable(const Model::GetMetadataAmountRequest& request) const;
|
||||
ListBindingsOutcome listBindings(const Model::ListBindingsRequest &request)const;
|
||||
void listBindingsAsync(const Model::ListBindingsRequest& request, const ListBindingsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListBindingsOutcomeCallable listBindingsCallable(const Model::ListBindingsRequest& request) const;
|
||||
@@ -155,6 +168,9 @@ namespace AlibabaCloud
|
||||
ListInstancesOutcome listInstances(const Model::ListInstancesRequest &request)const;
|
||||
void listInstancesAsync(const Model::ListInstancesRequest& request, const ListInstancesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListInstancesOutcomeCallable listInstancesCallable(const Model::ListInstancesRequest& request) const;
|
||||
ListQueueConsumersOutcome listQueueConsumers(const Model::ListQueueConsumersRequest &request)const;
|
||||
void listQueueConsumersAsync(const Model::ListQueueConsumersRequest& request, const ListQueueConsumersAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListQueueConsumersOutcomeCallable listQueueConsumersCallable(const Model::ListQueueConsumersRequest& request) const;
|
||||
ListQueueUpStreamBindingsOutcome listQueueUpStreamBindings(const Model::ListQueueUpStreamBindingsRequest &request)const;
|
||||
void listQueueUpStreamBindingsAsync(const Model::ListQueueUpStreamBindingsRequest& request, const ListQueueUpStreamBindingsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListQueueUpStreamBindingsOutcomeCallable listQueueUpStreamBindingsCallable(const Model::ListQueueUpStreamBindingsRequest& request) const;
|
||||
|
||||
@@ -14,35 +14,35 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_CS_MODEL_SERVICEMESHREMOVECLUSTERREQUEST_H_
|
||||
#define ALIBABACLOUD_CS_MODEL_SERVICEMESHREMOVECLUSTERREQUEST_H_
|
||||
#ifndef ALIBABACLOUD_AMQP_OPEN_MODEL_GETMETADATAAMOUNTREQUEST_H_
|
||||
#define ALIBABACLOUD_AMQP_OPEN_MODEL_GETMETADATAAMOUNTREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <alibabacloud/cs/CSExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/amqp-open/Amqp_openExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace CS
|
||||
namespace Amqp_open
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_CS_EXPORT ServiceMeshRemoveClusterRequest : public RoaServiceRequest
|
||||
class ALIBABACLOUD_AMQP_OPEN_EXPORT GetMetadataAmountRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
ServiceMeshRemoveClusterRequest();
|
||||
~ServiceMeshRemoveClusterRequest();
|
||||
GetMetadataAmountRequest();
|
||||
~GetMetadataAmountRequest();
|
||||
|
||||
std::string getServiceMeshId()const;
|
||||
void setServiceMeshId(const std::string& serviceMeshId);
|
||||
std::string getInstanceId()const;
|
||||
void setInstanceId(const std::string& instanceId);
|
||||
|
||||
private:
|
||||
std::string serviceMeshId_;
|
||||
std::string instanceId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_CS_MODEL_SERVICEMESHREMOVECLUSTERREQUEST_H_
|
||||
#endif // !ALIBABACLOUD_AMQP_OPEN_MODEL_GETMETADATAAMOUNTREQUEST_H_
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_AMQP_OPEN_MODEL_GETMETADATAAMOUNTRESULT_H_
|
||||
#define ALIBABACLOUD_AMQP_OPEN_MODEL_GETMETADATAAMOUNTRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/amqp-open/Amqp_openExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Amqp_open
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_AMQP_OPEN_EXPORT GetMetadataAmountResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
int maxExchanges;
|
||||
int maxVirtualHosts;
|
||||
int currentExchanges;
|
||||
int maxQueues;
|
||||
int currentVirtualHosts;
|
||||
int currentQueues;
|
||||
};
|
||||
|
||||
|
||||
GetMetadataAmountResult();
|
||||
explicit GetMetadataAmountResult(const std::string &payload);
|
||||
~GetMetadataAmountResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_AMQP_OPEN_MODEL_GETMETADATAAMOUNTRESULT_H_
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_AMQP_OPEN_MODEL_LISTQUEUECONSUMERSREQUEST_H_
|
||||
#define ALIBABACLOUD_AMQP_OPEN_MODEL_LISTQUEUECONSUMERSREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/amqp-open/Amqp_openExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Amqp_open
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_AMQP_OPEN_EXPORT ListQueueConsumersRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
ListQueueConsumersRequest();
|
||||
~ListQueueConsumersRequest();
|
||||
|
||||
std::string getInstanceId()const;
|
||||
void setInstanceId(const std::string& instanceId);
|
||||
std::string getNextToken()const;
|
||||
void setNextToken(const std::string& nextToken);
|
||||
int getQueryCount()const;
|
||||
void setQueryCount(int queryCount);
|
||||
std::string getVirtualHost()const;
|
||||
void setVirtualHost(const std::string& virtualHost);
|
||||
std::string getQueue()const;
|
||||
void setQueue(const std::string& queue);
|
||||
|
||||
private:
|
||||
std::string instanceId_;
|
||||
std::string nextToken_;
|
||||
int queryCount_;
|
||||
std::string virtualHost_;
|
||||
std::string queue_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_AMQP_OPEN_MODEL_LISTQUEUECONSUMERSREQUEST_H_
|
||||
@@ -14,44 +14,48 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_WAF_OPENAPI_MODEL_DESCRIBEPROTECTBLOCKSUMMARYRESULT_H_
|
||||
#define ALIBABACLOUD_WAF_OPENAPI_MODEL_DESCRIBEPROTECTBLOCKSUMMARYRESULT_H_
|
||||
#ifndef ALIBABACLOUD_AMQP_OPEN_MODEL_LISTQUEUECONSUMERSRESULT_H_
|
||||
#define ALIBABACLOUD_AMQP_OPEN_MODEL_LISTQUEUECONSUMERSRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/waf-openapi/Waf_openapiExport.h>
|
||||
#include <alibabacloud/amqp-open/Amqp_openExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Waf_openapi
|
||||
namespace Amqp_open
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_WAF_OPENAPI_EXPORT DescribeProtectBlockSummaryResult : public ServiceResult
|
||||
class ALIBABACLOUD_AMQP_OPEN_EXPORT ListQueueConsumersResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Item
|
||||
struct Data
|
||||
{
|
||||
long allPv;
|
||||
long blockPv;
|
||||
long index;
|
||||
struct QueueConsumerVO
|
||||
{
|
||||
std::string consumerTag;
|
||||
};
|
||||
std::string nextToken;
|
||||
std::vector<QueueConsumerVO> consumers;
|
||||
int maxResults;
|
||||
};
|
||||
|
||||
|
||||
DescribeProtectBlockSummaryResult();
|
||||
explicit DescribeProtectBlockSummaryResult(const std::string &payload);
|
||||
~DescribeProtectBlockSummaryResult();
|
||||
std::vector<Item> getProtectBlockSummarys()const;
|
||||
ListQueueConsumersResult();
|
||||
explicit ListQueueConsumersResult(const std::string &payload);
|
||||
~ListQueueConsumersResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<Item> protectBlockSummarys_;
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_WAF_OPENAPI_MODEL_DESCRIBEPROTECTBLOCKSUMMARYRESULT_H_
|
||||
#endif // !ALIBABACLOUD_AMQP_OPEN_MODEL_LISTQUEUECONSUMERSRESULT_H_
|
||||
@@ -339,6 +339,42 @@ Amqp_openClient::DeleteVirtualHostOutcomeCallable Amqp_openClient::deleteVirtual
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Amqp_openClient::GetMetadataAmountOutcome Amqp_openClient::getMetadataAmount(const GetMetadataAmountRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetMetadataAmountOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetMetadataAmountOutcome(GetMetadataAmountResult(outcome.result()));
|
||||
else
|
||||
return GetMetadataAmountOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Amqp_openClient::getMetadataAmountAsync(const GetMetadataAmountRequest& request, const GetMetadataAmountAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getMetadataAmount(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Amqp_openClient::GetMetadataAmountOutcomeCallable Amqp_openClient::getMetadataAmountCallable(const GetMetadataAmountRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetMetadataAmountOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getMetadataAmount(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Amqp_openClient::ListBindingsOutcome Amqp_openClient::listBindings(const ListBindingsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -519,6 +555,42 @@ Amqp_openClient::ListInstancesOutcomeCallable Amqp_openClient::listInstancesCall
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Amqp_openClient::ListQueueConsumersOutcome Amqp_openClient::listQueueConsumers(const ListQueueConsumersRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListQueueConsumersOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListQueueConsumersOutcome(ListQueueConsumersResult(outcome.result()));
|
||||
else
|
||||
return ListQueueConsumersOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Amqp_openClient::listQueueConsumersAsync(const ListQueueConsumersRequest& request, const ListQueueConsumersAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listQueueConsumers(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Amqp_openClient::ListQueueConsumersOutcomeCallable Amqp_openClient::listQueueConsumersCallable(const ListQueueConsumersRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListQueueConsumersOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listQueueConsumers(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Amqp_openClient::ListQueueUpStreamBindingsOutcome Amqp_openClient::listQueueUpStreamBindings(const ListQueueUpStreamBindingsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
40
amqp-open/src/model/GetMetadataAmountRequest.cc
Normal file
40
amqp-open/src/model/GetMetadataAmountRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/amqp-open/model/GetMetadataAmountRequest.h>
|
||||
|
||||
using AlibabaCloud::Amqp_open::Model::GetMetadataAmountRequest;
|
||||
|
||||
GetMetadataAmountRequest::GetMetadataAmountRequest() :
|
||||
RpcServiceRequest("amqp-open", "2019-12-12", "GetMetadataAmount")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
GetMetadataAmountRequest::~GetMetadataAmountRequest()
|
||||
{}
|
||||
|
||||
std::string GetMetadataAmountRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void GetMetadataAmountRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
62
amqp-open/src/model/GetMetadataAmountResult.cc
Normal file
62
amqp-open/src/model/GetMetadataAmountResult.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/amqp-open/model/GetMetadataAmountResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Amqp_open;
|
||||
using namespace AlibabaCloud::Amqp_open::Model;
|
||||
|
||||
GetMetadataAmountResult::GetMetadataAmountResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetMetadataAmountResult::GetMetadataAmountResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetMetadataAmountResult::~GetMetadataAmountResult()
|
||||
{}
|
||||
|
||||
void GetMetadataAmountResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["CurrentVirtualHosts"].isNull())
|
||||
data_.currentVirtualHosts = std::stoi(dataNode["CurrentVirtualHosts"].asString());
|
||||
if(!dataNode["MaxVirtualHosts"].isNull())
|
||||
data_.maxVirtualHosts = std::stoi(dataNode["MaxVirtualHosts"].asString());
|
||||
if(!dataNode["CurrentExchanges"].isNull())
|
||||
data_.currentExchanges = std::stoi(dataNode["CurrentExchanges"].asString());
|
||||
if(!dataNode["MaxExchanges"].isNull())
|
||||
data_.maxExchanges = std::stoi(dataNode["MaxExchanges"].asString());
|
||||
if(!dataNode["CurrentQueues"].isNull())
|
||||
data_.currentQueues = std::stoi(dataNode["CurrentQueues"].asString());
|
||||
if(!dataNode["MaxQueues"].isNull())
|
||||
data_.maxQueues = std::stoi(dataNode["MaxQueues"].asString());
|
||||
|
||||
}
|
||||
|
||||
GetMetadataAmountResult::Data GetMetadataAmountResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
84
amqp-open/src/model/ListQueueConsumersRequest.cc
Normal file
84
amqp-open/src/model/ListQueueConsumersRequest.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/amqp-open/model/ListQueueConsumersRequest.h>
|
||||
|
||||
using AlibabaCloud::Amqp_open::Model::ListQueueConsumersRequest;
|
||||
|
||||
ListQueueConsumersRequest::ListQueueConsumersRequest() :
|
||||
RpcServiceRequest("amqp-open", "2019-12-12", "ListQueueConsumers")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
ListQueueConsumersRequest::~ListQueueConsumersRequest()
|
||||
{}
|
||||
|
||||
std::string ListQueueConsumersRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void ListQueueConsumersRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
std::string ListQueueConsumersRequest::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
void ListQueueConsumersRequest::setNextToken(const std::string& nextToken)
|
||||
{
|
||||
nextToken_ = nextToken;
|
||||
setParameter("NextToken", nextToken);
|
||||
}
|
||||
|
||||
int ListQueueConsumersRequest::getQueryCount()const
|
||||
{
|
||||
return queryCount_;
|
||||
}
|
||||
|
||||
void ListQueueConsumersRequest::setQueryCount(int queryCount)
|
||||
{
|
||||
queryCount_ = queryCount;
|
||||
setParameter("QueryCount", std::to_string(queryCount));
|
||||
}
|
||||
|
||||
std::string ListQueueConsumersRequest::getVirtualHost()const
|
||||
{
|
||||
return virtualHost_;
|
||||
}
|
||||
|
||||
void ListQueueConsumersRequest::setVirtualHost(const std::string& virtualHost)
|
||||
{
|
||||
virtualHost_ = virtualHost;
|
||||
setParameter("VirtualHost", virtualHost);
|
||||
}
|
||||
|
||||
std::string ListQueueConsumersRequest::getQueue()const
|
||||
{
|
||||
return queue_;
|
||||
}
|
||||
|
||||
void ListQueueConsumersRequest::setQueue(const std::string& queue)
|
||||
{
|
||||
queue_ = queue;
|
||||
setParameter("Queue", queue);
|
||||
}
|
||||
|
||||
62
amqp-open/src/model/ListQueueConsumersResult.cc
Normal file
62
amqp-open/src/model/ListQueueConsumersResult.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/amqp-open/model/ListQueueConsumersResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Amqp_open;
|
||||
using namespace AlibabaCloud::Amqp_open::Model;
|
||||
|
||||
ListQueueConsumersResult::ListQueueConsumersResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListQueueConsumersResult::ListQueueConsumersResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListQueueConsumersResult::~ListQueueConsumersResult()
|
||||
{}
|
||||
|
||||
void ListQueueConsumersResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["NextToken"].isNull())
|
||||
data_.nextToken = dataNode["NextToken"].asString();
|
||||
if(!dataNode["MaxResults"].isNull())
|
||||
data_.maxResults = std::stoi(dataNode["MaxResults"].asString());
|
||||
auto allConsumersNode = dataNode["Consumers"]["QueueConsumerVO"];
|
||||
for (auto dataNodeConsumersQueueConsumerVO : allConsumersNode)
|
||||
{
|
||||
Data::QueueConsumerVO queueConsumerVOObject;
|
||||
if(!dataNodeConsumersQueueConsumerVO["ConsumerTag"].isNull())
|
||||
queueConsumerVOObject.consumerTag = dataNodeConsumersQueueConsumerVO["ConsumerTag"].asString();
|
||||
data_.consumers.push_back(queueConsumerVOObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ListQueueConsumersResult::Data ListQueueConsumersResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
@@ -43,12 +43,22 @@ set(arms_public_header_model
|
||||
include/alibabacloud/arms/model/DeleteAlertRulesResult.h
|
||||
include/alibabacloud/arms/model/DeleteRetcodeAppRequest.h
|
||||
include/alibabacloud/arms/model/DeleteRetcodeAppResult.h
|
||||
include/alibabacloud/arms/model/DeleteTraceAppRequest.h
|
||||
include/alibabacloud/arms/model/DeleteTraceAppResult.h
|
||||
include/alibabacloud/arms/model/DescribeTraceLicenseKeyRequest.h
|
||||
include/alibabacloud/arms/model/DescribeTraceLicenseKeyResult.h
|
||||
include/alibabacloud/arms/model/DescribeTraceLocationRequest.h
|
||||
include/alibabacloud/arms/model/DescribeTraceLocationResult.h
|
||||
include/alibabacloud/arms/model/GetConsistencySnapshotRequest.h
|
||||
include/alibabacloud/arms/model/GetConsistencySnapshotResult.h
|
||||
include/alibabacloud/arms/model/GetMultipleTraceRequest.h
|
||||
include/alibabacloud/arms/model/GetMultipleTraceResult.h
|
||||
include/alibabacloud/arms/model/GetPrometheusApiTokenRequest.h
|
||||
include/alibabacloud/arms/model/GetPrometheusApiTokenResult.h
|
||||
include/alibabacloud/arms/model/GetRetcodeShareUrlRequest.h
|
||||
include/alibabacloud/arms/model/GetRetcodeShareUrlResult.h
|
||||
include/alibabacloud/arms/model/GetStackRequest.h
|
||||
include/alibabacloud/arms/model/GetStackResult.h
|
||||
include/alibabacloud/arms/model/GetTraceRequest.h
|
||||
include/alibabacloud/arms/model/GetTraceResult.h
|
||||
include/alibabacloud/arms/model/ImportAppAlertRulesRequest.h
|
||||
@@ -87,6 +97,8 @@ set(arms_public_header_model
|
||||
include/alibabacloud/arms/model/SearchTraceAppByPageResult.h
|
||||
include/alibabacloud/arms/model/SearchTracesRequest.h
|
||||
include/alibabacloud/arms/model/SearchTracesResult.h
|
||||
include/alibabacloud/arms/model/SearchTracesByPageRequest.h
|
||||
include/alibabacloud/arms/model/SearchTracesByPageResult.h
|
||||
include/alibabacloud/arms/model/SetRetcodeShareStatusRequest.h
|
||||
include/alibabacloud/arms/model/SetRetcodeShareStatusResult.h
|
||||
include/alibabacloud/arms/model/StartAlertRequest.h
|
||||
@@ -124,12 +136,22 @@ set(arms_src
|
||||
src/model/DeleteAlertRulesResult.cc
|
||||
src/model/DeleteRetcodeAppRequest.cc
|
||||
src/model/DeleteRetcodeAppResult.cc
|
||||
src/model/DeleteTraceAppRequest.cc
|
||||
src/model/DeleteTraceAppResult.cc
|
||||
src/model/DescribeTraceLicenseKeyRequest.cc
|
||||
src/model/DescribeTraceLicenseKeyResult.cc
|
||||
src/model/DescribeTraceLocationRequest.cc
|
||||
src/model/DescribeTraceLocationResult.cc
|
||||
src/model/GetConsistencySnapshotRequest.cc
|
||||
src/model/GetConsistencySnapshotResult.cc
|
||||
src/model/GetMultipleTraceRequest.cc
|
||||
src/model/GetMultipleTraceResult.cc
|
||||
src/model/GetPrometheusApiTokenRequest.cc
|
||||
src/model/GetPrometheusApiTokenResult.cc
|
||||
src/model/GetRetcodeShareUrlRequest.cc
|
||||
src/model/GetRetcodeShareUrlResult.cc
|
||||
src/model/GetStackRequest.cc
|
||||
src/model/GetStackResult.cc
|
||||
src/model/GetTraceRequest.cc
|
||||
src/model/GetTraceResult.cc
|
||||
src/model/ImportAppAlertRulesRequest.cc
|
||||
@@ -168,6 +190,8 @@ set(arms_src
|
||||
src/model/SearchTraceAppByPageResult.cc
|
||||
src/model/SearchTracesRequest.cc
|
||||
src/model/SearchTracesResult.cc
|
||||
src/model/SearchTracesByPageRequest.cc
|
||||
src/model/SearchTracesByPageResult.cc
|
||||
src/model/SetRetcodeShareStatusRequest.cc
|
||||
src/model/SetRetcodeShareStatusResult.cc
|
||||
src/model/StartAlertRequest.cc
|
||||
|
||||
@@ -44,12 +44,22 @@
|
||||
#include "model/DeleteAlertRulesResult.h"
|
||||
#include "model/DeleteRetcodeAppRequest.h"
|
||||
#include "model/DeleteRetcodeAppResult.h"
|
||||
#include "model/DeleteTraceAppRequest.h"
|
||||
#include "model/DeleteTraceAppResult.h"
|
||||
#include "model/DescribeTraceLicenseKeyRequest.h"
|
||||
#include "model/DescribeTraceLicenseKeyResult.h"
|
||||
#include "model/DescribeTraceLocationRequest.h"
|
||||
#include "model/DescribeTraceLocationResult.h"
|
||||
#include "model/GetConsistencySnapshotRequest.h"
|
||||
#include "model/GetConsistencySnapshotResult.h"
|
||||
#include "model/GetMultipleTraceRequest.h"
|
||||
#include "model/GetMultipleTraceResult.h"
|
||||
#include "model/GetPrometheusApiTokenRequest.h"
|
||||
#include "model/GetPrometheusApiTokenResult.h"
|
||||
#include "model/GetRetcodeShareUrlRequest.h"
|
||||
#include "model/GetRetcodeShareUrlResult.h"
|
||||
#include "model/GetStackRequest.h"
|
||||
#include "model/GetStackResult.h"
|
||||
#include "model/GetTraceRequest.h"
|
||||
#include "model/GetTraceResult.h"
|
||||
#include "model/ImportAppAlertRulesRequest.h"
|
||||
@@ -88,6 +98,8 @@
|
||||
#include "model/SearchTraceAppByPageResult.h"
|
||||
#include "model/SearchTracesRequest.h"
|
||||
#include "model/SearchTracesResult.h"
|
||||
#include "model/SearchTracesByPageRequest.h"
|
||||
#include "model/SearchTracesByPageResult.h"
|
||||
#include "model/SetRetcodeShareStatusRequest.h"
|
||||
#include "model/SetRetcodeShareStatusResult.h"
|
||||
#include "model/StartAlertRequest.h"
|
||||
@@ -142,15 +154,30 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::DeleteRetcodeAppResult> DeleteRetcodeAppOutcome;
|
||||
typedef std::future<DeleteRetcodeAppOutcome> DeleteRetcodeAppOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::DeleteRetcodeAppRequest&, const DeleteRetcodeAppOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteRetcodeAppAsyncHandler;
|
||||
typedef Outcome<Error, Model::DeleteTraceAppResult> DeleteTraceAppOutcome;
|
||||
typedef std::future<DeleteTraceAppOutcome> DeleteTraceAppOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::DeleteTraceAppRequest&, const DeleteTraceAppOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteTraceAppAsyncHandler;
|
||||
typedef Outcome<Error, Model::DescribeTraceLicenseKeyResult> DescribeTraceLicenseKeyOutcome;
|
||||
typedef std::future<DescribeTraceLicenseKeyOutcome> DescribeTraceLicenseKeyOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::DescribeTraceLicenseKeyRequest&, const DescribeTraceLicenseKeyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeTraceLicenseKeyAsyncHandler;
|
||||
typedef Outcome<Error, Model::DescribeTraceLocationResult> DescribeTraceLocationOutcome;
|
||||
typedef std::future<DescribeTraceLocationOutcome> DescribeTraceLocationOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::DescribeTraceLocationRequest&, const DescribeTraceLocationOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeTraceLocationAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetConsistencySnapshotResult> GetConsistencySnapshotOutcome;
|
||||
typedef std::future<GetConsistencySnapshotOutcome> GetConsistencySnapshotOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::GetConsistencySnapshotRequest&, const GetConsistencySnapshotOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetConsistencySnapshotAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetMultipleTraceResult> GetMultipleTraceOutcome;
|
||||
typedef std::future<GetMultipleTraceOutcome> GetMultipleTraceOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::GetMultipleTraceRequest&, const GetMultipleTraceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetMultipleTraceAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetPrometheusApiTokenResult> GetPrometheusApiTokenOutcome;
|
||||
typedef std::future<GetPrometheusApiTokenOutcome> GetPrometheusApiTokenOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::GetPrometheusApiTokenRequest&, const GetPrometheusApiTokenOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetPrometheusApiTokenAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetRetcodeShareUrlResult> GetRetcodeShareUrlOutcome;
|
||||
typedef std::future<GetRetcodeShareUrlOutcome> GetRetcodeShareUrlOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::GetRetcodeShareUrlRequest&, const GetRetcodeShareUrlOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetRetcodeShareUrlAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetStackResult> GetStackOutcome;
|
||||
typedef std::future<GetStackOutcome> GetStackOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::GetStackRequest&, const GetStackOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetStackAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetTraceResult> GetTraceOutcome;
|
||||
typedef std::future<GetTraceOutcome> GetTraceOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::GetTraceRequest&, const GetTraceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetTraceAsyncHandler;
|
||||
@@ -208,6 +235,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::SearchTracesResult> SearchTracesOutcome;
|
||||
typedef std::future<SearchTracesOutcome> SearchTracesOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::SearchTracesRequest&, const SearchTracesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SearchTracesAsyncHandler;
|
||||
typedef Outcome<Error, Model::SearchTracesByPageResult> SearchTracesByPageOutcome;
|
||||
typedef std::future<SearchTracesByPageOutcome> SearchTracesByPageOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::SearchTracesByPageRequest&, const SearchTracesByPageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SearchTracesByPageAsyncHandler;
|
||||
typedef Outcome<Error, Model::SetRetcodeShareStatusResult> SetRetcodeShareStatusOutcome;
|
||||
typedef std::future<SetRetcodeShareStatusOutcome> SetRetcodeShareStatusOutcomeCallable;
|
||||
typedef std::function<void(const ARMSClient*, const Model::SetRetcodeShareStatusRequest&, const SetRetcodeShareStatusOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SetRetcodeShareStatusAsyncHandler;
|
||||
@@ -264,15 +294,30 @@ namespace AlibabaCloud
|
||||
DeleteRetcodeAppOutcome deleteRetcodeApp(const Model::DeleteRetcodeAppRequest &request)const;
|
||||
void deleteRetcodeAppAsync(const Model::DeleteRetcodeAppRequest& request, const DeleteRetcodeAppAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DeleteRetcodeAppOutcomeCallable deleteRetcodeAppCallable(const Model::DeleteRetcodeAppRequest& request) const;
|
||||
DeleteTraceAppOutcome deleteTraceApp(const Model::DeleteTraceAppRequest &request)const;
|
||||
void deleteTraceAppAsync(const Model::DeleteTraceAppRequest& request, const DeleteTraceAppAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DeleteTraceAppOutcomeCallable deleteTraceAppCallable(const Model::DeleteTraceAppRequest& request) const;
|
||||
DescribeTraceLicenseKeyOutcome describeTraceLicenseKey(const Model::DescribeTraceLicenseKeyRequest &request)const;
|
||||
void describeTraceLicenseKeyAsync(const Model::DescribeTraceLicenseKeyRequest& request, const DescribeTraceLicenseKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DescribeTraceLicenseKeyOutcomeCallable describeTraceLicenseKeyCallable(const Model::DescribeTraceLicenseKeyRequest& request) const;
|
||||
DescribeTraceLocationOutcome describeTraceLocation(const Model::DescribeTraceLocationRequest &request)const;
|
||||
void describeTraceLocationAsync(const Model::DescribeTraceLocationRequest& request, const DescribeTraceLocationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DescribeTraceLocationOutcomeCallable describeTraceLocationCallable(const Model::DescribeTraceLocationRequest& request) const;
|
||||
GetConsistencySnapshotOutcome getConsistencySnapshot(const Model::GetConsistencySnapshotRequest &request)const;
|
||||
void getConsistencySnapshotAsync(const Model::GetConsistencySnapshotRequest& request, const GetConsistencySnapshotAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetConsistencySnapshotOutcomeCallable getConsistencySnapshotCallable(const Model::GetConsistencySnapshotRequest& request) const;
|
||||
GetMultipleTraceOutcome getMultipleTrace(const Model::GetMultipleTraceRequest &request)const;
|
||||
void getMultipleTraceAsync(const Model::GetMultipleTraceRequest& request, const GetMultipleTraceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetMultipleTraceOutcomeCallable getMultipleTraceCallable(const Model::GetMultipleTraceRequest& request) const;
|
||||
GetPrometheusApiTokenOutcome getPrometheusApiToken(const Model::GetPrometheusApiTokenRequest &request)const;
|
||||
void getPrometheusApiTokenAsync(const Model::GetPrometheusApiTokenRequest& request, const GetPrometheusApiTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetPrometheusApiTokenOutcomeCallable getPrometheusApiTokenCallable(const Model::GetPrometheusApiTokenRequest& request) const;
|
||||
GetRetcodeShareUrlOutcome getRetcodeShareUrl(const Model::GetRetcodeShareUrlRequest &request)const;
|
||||
void getRetcodeShareUrlAsync(const Model::GetRetcodeShareUrlRequest& request, const GetRetcodeShareUrlAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetRetcodeShareUrlOutcomeCallable getRetcodeShareUrlCallable(const Model::GetRetcodeShareUrlRequest& request) const;
|
||||
GetStackOutcome getStack(const Model::GetStackRequest &request)const;
|
||||
void getStackAsync(const Model::GetStackRequest& request, const GetStackAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetStackOutcomeCallable getStackCallable(const Model::GetStackRequest& request) const;
|
||||
GetTraceOutcome getTrace(const Model::GetTraceRequest &request)const;
|
||||
void getTraceAsync(const Model::GetTraceRequest& request, const GetTraceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetTraceOutcomeCallable getTraceCallable(const Model::GetTraceRequest& request) const;
|
||||
@@ -330,6 +375,9 @@ namespace AlibabaCloud
|
||||
SearchTracesOutcome searchTraces(const Model::SearchTracesRequest &request)const;
|
||||
void searchTracesAsync(const Model::SearchTracesRequest& request, const SearchTracesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
SearchTracesOutcomeCallable searchTracesCallable(const Model::SearchTracesRequest& request) const;
|
||||
SearchTracesByPageOutcome searchTracesByPage(const Model::SearchTracesByPageRequest &request)const;
|
||||
void searchTracesByPageAsync(const Model::SearchTracesByPageRequest& request, const SearchTracesByPageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
SearchTracesByPageOutcomeCallable searchTracesByPageCallable(const Model::SearchTracesByPageRequest& request) const;
|
||||
SetRetcodeShareStatusOutcome setRetcodeShareStatus(const Model::SetRetcodeShareStatusRequest &request)const;
|
||||
void setRetcodeShareStatusAsync(const Model::SetRetcodeShareStatusRequest& request, const SetRetcodeShareStatusAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
SetRetcodeShareStatusOutcomeCallable setRetcodeShareStatusCallable(const Model::SetRetcodeShareStatusRequest& request) const;
|
||||
|
||||
54
arms/include/alibabacloud/arms/model/DeleteTraceAppRequest.h
Normal file
54
arms/include/alibabacloud/arms/model/DeleteTraceAppRequest.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ARMS_MODEL_DELETETRACEAPPREQUEST_H_
|
||||
#define ALIBABACLOUD_ARMS_MODEL_DELETETRACEAPPREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/arms/ARMSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace ARMS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ARMS_EXPORT DeleteTraceAppRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
DeleteTraceAppRequest();
|
||||
~DeleteTraceAppRequest();
|
||||
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
std::string getAppId()const;
|
||||
void setAppId(const std::string& appId);
|
||||
std::string getType()const;
|
||||
void setType(const std::string& type);
|
||||
|
||||
private:
|
||||
std::string regionId_;
|
||||
std::string appId_;
|
||||
std::string type_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ARMS_MODEL_DELETETRACEAPPREQUEST_H_
|
||||
@@ -14,29 +14,29 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_WAF_OPENAPI_MODEL_CREATEIPBLOCKRESULT_H_
|
||||
#define ALIBABACLOUD_WAF_OPENAPI_MODEL_CREATEIPBLOCKRESULT_H_
|
||||
#ifndef ALIBABACLOUD_ARMS_MODEL_DELETETRACEAPPRESULT_H_
|
||||
#define ALIBABACLOUD_ARMS_MODEL_DELETETRACEAPPRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/waf-openapi/Waf_openapiExport.h>
|
||||
#include <alibabacloud/arms/ARMSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Waf_openapi
|
||||
namespace ARMS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_WAF_OPENAPI_EXPORT CreateIPBlockResult : public ServiceResult
|
||||
class ALIBABACLOUD_ARMS_EXPORT DeleteTraceAppResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
CreateIPBlockResult();
|
||||
explicit CreateIPBlockResult(const std::string &payload);
|
||||
~CreateIPBlockResult();
|
||||
DeleteTraceAppResult();
|
||||
explicit DeleteTraceAppResult(const std::string &payload);
|
||||
~DeleteTraceAppResult();
|
||||
std::string getData()const;
|
||||
|
||||
protected:
|
||||
@@ -48,4 +48,4 @@ namespace AlibabaCloud
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_WAF_OPENAPI_MODEL_CREATEIPBLOCKRESULT_H_
|
||||
#endif // !ALIBABACLOUD_ARMS_MODEL_DELETETRACEAPPRESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ARMS_MODEL_DESCRIBETRACELICENSEKEYREQUEST_H_
|
||||
#define ALIBABACLOUD_ARMS_MODEL_DESCRIBETRACELICENSEKEYREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/arms/ARMSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace ARMS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ARMS_EXPORT DescribeTraceLicenseKeyRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
DescribeTraceLicenseKeyRequest();
|
||||
~DescribeTraceLicenseKeyRequest();
|
||||
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
|
||||
private:
|
||||
std::string regionId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ARMS_MODEL_DESCRIBETRACELICENSEKEYREQUEST_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ARMS_MODEL_DESCRIBETRACELICENSEKEYRESULT_H_
|
||||
#define ALIBABACLOUD_ARMS_MODEL_DESCRIBETRACELICENSEKEYRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/arms/ARMSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace ARMS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ARMS_EXPORT DescribeTraceLicenseKeyResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
DescribeTraceLicenseKeyResult();
|
||||
explicit DescribeTraceLicenseKeyResult(const std::string &payload);
|
||||
~DescribeTraceLicenseKeyResult();
|
||||
std::string getLicenseKey()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string licenseKey_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ARMS_MODEL_DESCRIBETRACELICENSEKEYRESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ARMS_MODEL_DESCRIBETRACELOCATIONREQUEST_H_
|
||||
#define ALIBABACLOUD_ARMS_MODEL_DESCRIBETRACELOCATIONREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/arms/ARMSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace ARMS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ARMS_EXPORT DescribeTraceLocationRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
DescribeTraceLocationRequest();
|
||||
~DescribeTraceLocationRequest();
|
||||
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
|
||||
private:
|
||||
std::string regionId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ARMS_MODEL_DESCRIBETRACELOCATIONREQUEST_H_
|
||||
@@ -14,43 +14,43 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_WAF_OPENAPI_MODEL_DESCRIBERULESUMMARYRESULT_H_
|
||||
#define ALIBABACLOUD_WAF_OPENAPI_MODEL_DESCRIBERULESUMMARYRESULT_H_
|
||||
#ifndef ALIBABACLOUD_ARMS_MODEL_DESCRIBETRACELOCATIONRESULT_H_
|
||||
#define ALIBABACLOUD_ARMS_MODEL_DESCRIBETRACELOCATIONRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/waf-openapi/Waf_openapiExport.h>
|
||||
#include <alibabacloud/arms/ARMSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Waf_openapi
|
||||
namespace ARMS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_WAF_OPENAPI_EXPORT DescribeRuleSummaryResult : public ServiceResult
|
||||
class ALIBABACLOUD_ARMS_EXPORT DescribeTraceLocationResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Item
|
||||
struct RegionConfig
|
||||
{
|
||||
long pv;
|
||||
long timeStamp;
|
||||
std::string regionNo;
|
||||
std::string url;
|
||||
};
|
||||
|
||||
|
||||
DescribeRuleSummaryResult();
|
||||
explicit DescribeRuleSummaryResult(const std::string &payload);
|
||||
~DescribeRuleSummaryResult();
|
||||
std::vector<Item> getRuleSummarys()const;
|
||||
DescribeTraceLocationResult();
|
||||
explicit DescribeTraceLocationResult(const std::string &payload);
|
||||
~DescribeTraceLocationResult();
|
||||
std::vector<RegionConfig> getRegionConfigs()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<Item> ruleSummarys_;
|
||||
std::vector<RegionConfig> regionConfigs_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_WAF_OPENAPI_MODEL_DESCRIBERULESUMMARYRESULT_H_
|
||||
#endif // !ALIBABACLOUD_ARMS_MODEL_DESCRIBETRACELOCATIONRESULT_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ARMS_MODEL_GETMULTIPLETRACEREQUEST_H_
|
||||
#define ALIBABACLOUD_ARMS_MODEL_GETMULTIPLETRACEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/arms/ARMSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace ARMS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ARMS_EXPORT GetMultipleTraceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetMultipleTraceRequest();
|
||||
~GetMultipleTraceRequest();
|
||||
|
||||
std::vector<std::string> getTraceIDs()const;
|
||||
void setTraceIDs(const std::vector<std::string>& traceIDs);
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
|
||||
private:
|
||||
std::vector<std::string> traceIDs_;
|
||||
std::string regionId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ARMS_MODEL_GETMULTIPLETRACEREQUEST_H_
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ARMS_MODEL_GETMULTIPLETRACERESULT_H_
|
||||
#define ALIBABACLOUD_ARMS_MODEL_GETMULTIPLETRACERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/arms/ARMSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace ARMS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ARMS_EXPORT GetMultipleTraceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct MultiCallChainInfo
|
||||
{
|
||||
struct Span
|
||||
{
|
||||
struct TagEntry
|
||||
{
|
||||
std::string value;
|
||||
std::string key;
|
||||
};
|
||||
struct LogEvent
|
||||
{
|
||||
struct TagEntry2
|
||||
{
|
||||
std::string value;
|
||||
std::string key;
|
||||
};
|
||||
std::vector<LogEvent::TagEntry2> tagEntryList1;
|
||||
long timestamp;
|
||||
};
|
||||
bool haveStack;
|
||||
std::string serviceIp;
|
||||
std::vector<Span::LogEvent> logEventList;
|
||||
std::string operationName;
|
||||
std::string serviceName;
|
||||
std::string rpcId;
|
||||
int rpcType;
|
||||
std::string traceID;
|
||||
long duration;
|
||||
std::vector<Span::TagEntry> tagEntryList;
|
||||
long timestamp;
|
||||
std::string resultCode;
|
||||
};
|
||||
std::string traceID;
|
||||
std::vector<MultiCallChainInfo::Span> spans;
|
||||
};
|
||||
|
||||
|
||||
GetMultipleTraceResult();
|
||||
explicit GetMultipleTraceResult(const std::string &payload);
|
||||
~GetMultipleTraceResult();
|
||||
std::vector<MultiCallChainInfo> getMultiCallChainInfos()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<MultiCallChainInfo> multiCallChainInfos_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ARMS_MODEL_GETMULTIPLETRACERESULT_H_
|
||||
54
arms/include/alibabacloud/arms/model/GetStackRequest.h
Normal file
54
arms/include/alibabacloud/arms/model/GetStackRequest.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ARMS_MODEL_GETSTACKREQUEST_H_
|
||||
#define ALIBABACLOUD_ARMS_MODEL_GETSTACKREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/arms/ARMSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace ARMS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ARMS_EXPORT GetStackRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetStackRequest();
|
||||
~GetStackRequest();
|
||||
|
||||
std::string getTraceID()const;
|
||||
void setTraceID(const std::string& traceID);
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
std::string getRpcID()const;
|
||||
void setRpcID(const std::string& rpcID);
|
||||
|
||||
private:
|
||||
std::string traceID_;
|
||||
std::string regionId_;
|
||||
std::string rpcID_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ARMS_MODEL_GETSTACKREQUEST_H_
|
||||
67
arms/include/alibabacloud/arms/model/GetStackResult.h
Normal file
67
arms/include/alibabacloud/arms/model/GetStackResult.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ARMS_MODEL_GETSTACKRESULT_H_
|
||||
#define ALIBABACLOUD_ARMS_MODEL_GETSTACKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/arms/ARMSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace ARMS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ARMS_EXPORT GetStackResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct StackInfoItem
|
||||
{
|
||||
struct ExtInfoItem
|
||||
{
|
||||
std::string type;
|
||||
std::string info;
|
||||
};
|
||||
std::string line;
|
||||
std::string serviceName;
|
||||
std::vector<StackInfoItem::ExtInfoItem> extInfo;
|
||||
std::string rpcId;
|
||||
long startTime;
|
||||
long duration;
|
||||
std::string api;
|
||||
std::string exception;
|
||||
};
|
||||
|
||||
|
||||
GetStackResult();
|
||||
explicit GetStackResult(const std::string &payload);
|
||||
~GetStackResult();
|
||||
std::vector<StackInfoItem> getStackInfo()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<StackInfoItem> stackInfo_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ARMS_MODEL_GETSTACKRESULT_H_
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ARMS_MODEL_SEARCHTRACESBYPAGEREQUEST_H_
|
||||
#define ALIBABACLOUD_ARMS_MODEL_SEARCHTRACESBYPAGEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/arms/ARMSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace ARMS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ARMS_EXPORT SearchTracesByPageRequest : public RpcServiceRequest
|
||||
{
|
||||
public:
|
||||
struct ExclusionFilters
|
||||
{
|
||||
std::string value;
|
||||
std::string key;
|
||||
};
|
||||
|
||||
public:
|
||||
SearchTracesByPageRequest();
|
||||
~SearchTracesByPageRequest();
|
||||
|
||||
long getEndTime()const;
|
||||
void setEndTime(long endTime);
|
||||
long getStartTime()const;
|
||||
void setStartTime(long startTime);
|
||||
bool getReverse()const;
|
||||
void setReverse(bool reverse);
|
||||
long getMinDuration()const;
|
||||
void setMinDuration(long minDuration);
|
||||
int getPageNumber()const;
|
||||
void setPageNumber(int pageNumber);
|
||||
std::string getServiceIp()const;
|
||||
void setServiceIp(const std::string& serviceIp);
|
||||
std::vector<ExclusionFilters> getExclusionFilters()const;
|
||||
void setExclusionFilters(const std::vector<ExclusionFilters>& exclusionFilters);
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
std::string getOperationName()const;
|
||||
void setOperationName(const std::string& operationName);
|
||||
int getPageSize()const;
|
||||
void setPageSize(int pageSize);
|
||||
std::string getServiceName()const;
|
||||
void setServiceName(const std::string& serviceName);
|
||||
|
||||
private:
|
||||
long endTime_;
|
||||
long startTime_;
|
||||
bool reverse_;
|
||||
long minDuration_;
|
||||
int pageNumber_;
|
||||
std::string serviceIp_;
|
||||
std::vector<ExclusionFilters> exclusionFilters_;
|
||||
std::string regionId_;
|
||||
std::string operationName_;
|
||||
int pageSize_;
|
||||
std::string serviceName_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ARMS_MODEL_SEARCHTRACESBYPAGEREQUEST_H_
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ARMS_MODEL_SEARCHTRACESBYPAGERESULT_H_
|
||||
#define ALIBABACLOUD_ARMS_MODEL_SEARCHTRACESBYPAGERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/arms/ARMSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace ARMS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ARMS_EXPORT SearchTracesByPageResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct PageBean
|
||||
{
|
||||
struct TraceInfo
|
||||
{
|
||||
std::string serviceIp;
|
||||
std::string operationName;
|
||||
std::string serviceName;
|
||||
std::string traceID;
|
||||
long duration;
|
||||
long timestamp;
|
||||
};
|
||||
int pageSize;
|
||||
int pageNumber;
|
||||
int total;
|
||||
std::vector<TraceInfo> traceInfos;
|
||||
};
|
||||
|
||||
|
||||
SearchTracesByPageResult();
|
||||
explicit SearchTracesByPageResult(const std::string &payload);
|
||||
~SearchTracesByPageResult();
|
||||
PageBean getPageBean()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
PageBean pageBean_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ARMS_MODEL_SEARCHTRACESBYPAGERESULT_H_
|
||||
@@ -447,6 +447,114 @@ ARMSClient::DeleteRetcodeAppOutcomeCallable ARMSClient::deleteRetcodeAppCallable
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::DeleteTraceAppOutcome ARMSClient::deleteTraceApp(const DeleteTraceAppRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DeleteTraceAppOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DeleteTraceAppOutcome(DeleteTraceAppResult(outcome.result()));
|
||||
else
|
||||
return DeleteTraceAppOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::deleteTraceAppAsync(const DeleteTraceAppRequest& request, const DeleteTraceAppAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, deleteTraceApp(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::DeleteTraceAppOutcomeCallable ARMSClient::deleteTraceAppCallable(const DeleteTraceAppRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DeleteTraceAppOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->deleteTraceApp(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::DescribeTraceLicenseKeyOutcome ARMSClient::describeTraceLicenseKey(const DescribeTraceLicenseKeyRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DescribeTraceLicenseKeyOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DescribeTraceLicenseKeyOutcome(DescribeTraceLicenseKeyResult(outcome.result()));
|
||||
else
|
||||
return DescribeTraceLicenseKeyOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::describeTraceLicenseKeyAsync(const DescribeTraceLicenseKeyRequest& request, const DescribeTraceLicenseKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, describeTraceLicenseKey(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::DescribeTraceLicenseKeyOutcomeCallable ARMSClient::describeTraceLicenseKeyCallable(const DescribeTraceLicenseKeyRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DescribeTraceLicenseKeyOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->describeTraceLicenseKey(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::DescribeTraceLocationOutcome ARMSClient::describeTraceLocation(const DescribeTraceLocationRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DescribeTraceLocationOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DescribeTraceLocationOutcome(DescribeTraceLocationResult(outcome.result()));
|
||||
else
|
||||
return DescribeTraceLocationOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::describeTraceLocationAsync(const DescribeTraceLocationRequest& request, const DescribeTraceLocationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, describeTraceLocation(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::DescribeTraceLocationOutcomeCallable ARMSClient::describeTraceLocationCallable(const DescribeTraceLocationRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DescribeTraceLocationOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->describeTraceLocation(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::GetConsistencySnapshotOutcome ARMSClient::getConsistencySnapshot(const GetConsistencySnapshotRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -483,6 +591,42 @@ ARMSClient::GetConsistencySnapshotOutcomeCallable ARMSClient::getConsistencySnap
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::GetMultipleTraceOutcome ARMSClient::getMultipleTrace(const GetMultipleTraceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetMultipleTraceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetMultipleTraceOutcome(GetMultipleTraceResult(outcome.result()));
|
||||
else
|
||||
return GetMultipleTraceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::getMultipleTraceAsync(const GetMultipleTraceRequest& request, const GetMultipleTraceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getMultipleTrace(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::GetMultipleTraceOutcomeCallable ARMSClient::getMultipleTraceCallable(const GetMultipleTraceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetMultipleTraceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getMultipleTrace(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::GetPrometheusApiTokenOutcome ARMSClient::getPrometheusApiToken(const GetPrometheusApiTokenRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -555,6 +699,42 @@ ARMSClient::GetRetcodeShareUrlOutcomeCallable ARMSClient::getRetcodeShareUrlCall
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::GetStackOutcome ARMSClient::getStack(const GetStackRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetStackOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetStackOutcome(GetStackResult(outcome.result()));
|
||||
else
|
||||
return GetStackOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::getStackAsync(const GetStackRequest& request, const GetStackAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getStack(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::GetStackOutcomeCallable ARMSClient::getStackCallable(const GetStackRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetStackOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getStack(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::GetTraceOutcome ARMSClient::getTrace(const GetTraceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -1239,6 +1419,42 @@ ARMSClient::SearchTracesOutcomeCallable ARMSClient::searchTracesCallable(const S
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::SearchTracesByPageOutcome ARMSClient::searchTracesByPage(const SearchTracesByPageRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return SearchTracesByPageOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return SearchTracesByPageOutcome(SearchTracesByPageResult(outcome.result()));
|
||||
else
|
||||
return SearchTracesByPageOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::searchTracesByPageAsync(const SearchTracesByPageRequest& request, const SearchTracesByPageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, searchTracesByPage(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::SearchTracesByPageOutcomeCallable ARMSClient::searchTracesByPageCallable(const SearchTracesByPageRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<SearchTracesByPageOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->searchTracesByPage(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::SetRetcodeShareStatusOutcome ARMSClient::setRetcodeShareStatus(const SetRetcodeShareStatusRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
62
arms/src/model/DeleteTraceAppRequest.cc
Normal file
62
arms/src/model/DeleteTraceAppRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DeleteTraceAppRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::DeleteTraceAppRequest;
|
||||
|
||||
DeleteTraceAppRequest::DeleteTraceAppRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "DeleteTraceApp")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DeleteTraceAppRequest::~DeleteTraceAppRequest()
|
||||
{}
|
||||
|
||||
std::string DeleteTraceAppRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void DeleteTraceAppRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string DeleteTraceAppRequest::getAppId()const
|
||||
{
|
||||
return appId_;
|
||||
}
|
||||
|
||||
void DeleteTraceAppRequest::setAppId(const std::string& appId)
|
||||
{
|
||||
appId_ = appId;
|
||||
setParameter("AppId", appId);
|
||||
}
|
||||
|
||||
std::string DeleteTraceAppRequest::getType()const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
void DeleteTraceAppRequest::setType(const std::string& type)
|
||||
{
|
||||
type_ = type;
|
||||
setParameter("Type", type);
|
||||
}
|
||||
|
||||
@@ -14,26 +14,26 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/waf-openapi/model/CreateIPBlockResult.h>
|
||||
#include <alibabacloud/arms/model/DeleteTraceAppResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Waf_openapi;
|
||||
using namespace AlibabaCloud::Waf_openapi::Model;
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
CreateIPBlockResult::CreateIPBlockResult() :
|
||||
DeleteTraceAppResult::DeleteTraceAppResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateIPBlockResult::CreateIPBlockResult(const std::string &payload) :
|
||||
DeleteTraceAppResult::DeleteTraceAppResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateIPBlockResult::~CreateIPBlockResult()
|
||||
DeleteTraceAppResult::~DeleteTraceAppResult()
|
||||
{}
|
||||
|
||||
void CreateIPBlockResult::parse(const std::string &payload)
|
||||
void DeleteTraceAppResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
@@ -44,7 +44,7 @@ void CreateIPBlockResult::parse(const std::string &payload)
|
||||
|
||||
}
|
||||
|
||||
std::string CreateIPBlockResult::getData()const
|
||||
std::string DeleteTraceAppResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
@@ -14,28 +14,27 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/cs/model/ServiceMeshApiServerRequest.h>
|
||||
#include <alibabacloud/arms/model/DescribeTraceLicenseKeyRequest.h>
|
||||
|
||||
using AlibabaCloud::CS::Model::ServiceMeshApiServerRequest;
|
||||
using AlibabaCloud::ARMS::Model::DescribeTraceLicenseKeyRequest;
|
||||
|
||||
ServiceMeshApiServerRequest::ServiceMeshApiServerRequest() :
|
||||
RoaServiceRequest("cs", "2015-12-15")
|
||||
DescribeTraceLicenseKeyRequest::DescribeTraceLicenseKeyRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "DescribeTraceLicenseKey")
|
||||
{
|
||||
setResourcePath("/servicemesh/[ServiceMeshId]/api_proxy");
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ServiceMeshApiServerRequest::~ServiceMeshApiServerRequest()
|
||||
DescribeTraceLicenseKeyRequest::~DescribeTraceLicenseKeyRequest()
|
||||
{}
|
||||
|
||||
std::string ServiceMeshApiServerRequest::getServiceMeshId()const
|
||||
std::string DescribeTraceLicenseKeyRequest::getRegionId()const
|
||||
{
|
||||
return serviceMeshId_;
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void ServiceMeshApiServerRequest::setServiceMeshId(const std::string& serviceMeshId)
|
||||
void DescribeTraceLicenseKeyRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
serviceMeshId_ = serviceMeshId;
|
||||
setParameter("ServiceMeshId", serviceMeshId);
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
@@ -14,38 +14,38 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/waf-openapi/model/DescribeDomainStatusResult.h>
|
||||
#include <alibabacloud/arms/model/DescribeTraceLicenseKeyResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Waf_openapi;
|
||||
using namespace AlibabaCloud::Waf_openapi::Model;
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
DescribeDomainStatusResult::DescribeDomainStatusResult() :
|
||||
DescribeTraceLicenseKeyResult::DescribeTraceLicenseKeyResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DescribeDomainStatusResult::DescribeDomainStatusResult(const std::string &payload) :
|
||||
DescribeTraceLicenseKeyResult::DescribeTraceLicenseKeyResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DescribeDomainStatusResult::~DescribeDomainStatusResult()
|
||||
DescribeTraceLicenseKeyResult::~DescribeTraceLicenseKeyResult()
|
||||
{}
|
||||
|
||||
void DescribeDomainStatusResult::parse(const std::string &payload)
|
||||
void DescribeTraceLicenseKeyResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["ConfigStatus"].isNull())
|
||||
configStatus_ = value["ConfigStatus"].asString();
|
||||
if(!value["LicenseKey"].isNull())
|
||||
licenseKey_ = value["LicenseKey"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string DescribeDomainStatusResult::getConfigStatus()const
|
||||
std::string DescribeTraceLicenseKeyResult::getLicenseKey()const
|
||||
{
|
||||
return configStatus_;
|
||||
return licenseKey_;
|
||||
}
|
||||
|
||||
40
arms/src/model/DescribeTraceLocationRequest.cc
Normal file
40
arms/src/model/DescribeTraceLocationRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DescribeTraceLocationRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::DescribeTraceLocationRequest;
|
||||
|
||||
DescribeTraceLocationRequest::DescribeTraceLocationRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "DescribeTraceLocation")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DescribeTraceLocationRequest::~DescribeTraceLocationRequest()
|
||||
{}
|
||||
|
||||
std::string DescribeTraceLocationRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void DescribeTraceLocationRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
59
arms/src/model/DescribeTraceLocationResult.cc
Normal file
59
arms/src/model/DescribeTraceLocationResult.cc
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DescribeTraceLocationResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
DescribeTraceLocationResult::DescribeTraceLocationResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DescribeTraceLocationResult::DescribeTraceLocationResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DescribeTraceLocationResult::~DescribeTraceLocationResult()
|
||||
{}
|
||||
|
||||
void DescribeTraceLocationResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allRegionConfigsNode = value["RegionConfigs"]["RegionConfig"];
|
||||
for (auto valueRegionConfigsRegionConfig : allRegionConfigsNode)
|
||||
{
|
||||
RegionConfig regionConfigsObject;
|
||||
if(!valueRegionConfigsRegionConfig["RegionNo"].isNull())
|
||||
regionConfigsObject.regionNo = valueRegionConfigsRegionConfig["RegionNo"].asString();
|
||||
if(!valueRegionConfigsRegionConfig["Url"].isNull())
|
||||
regionConfigsObject.url = valueRegionConfigsRegionConfig["Url"].asString();
|
||||
regionConfigs_.push_back(regionConfigsObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::vector<DescribeTraceLocationResult::RegionConfig> DescribeTraceLocationResult::getRegionConfigs()const
|
||||
{
|
||||
return regionConfigs_;
|
||||
}
|
||||
|
||||
53
arms/src/model/GetMultipleTraceRequest.cc
Normal file
53
arms/src/model/GetMultipleTraceRequest.cc
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/GetMultipleTraceRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::GetMultipleTraceRequest;
|
||||
|
||||
GetMultipleTraceRequest::GetMultipleTraceRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "GetMultipleTrace")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetMultipleTraceRequest::~GetMultipleTraceRequest()
|
||||
{}
|
||||
|
||||
std::vector<std::string> GetMultipleTraceRequest::getTraceIDs()const
|
||||
{
|
||||
return traceIDs_;
|
||||
}
|
||||
|
||||
void GetMultipleTraceRequest::setTraceIDs(const std::vector<std::string>& traceIDs)
|
||||
{
|
||||
traceIDs_ = traceIDs;
|
||||
for(int dep1 = 0; dep1!= traceIDs.size(); dep1++) {
|
||||
setParameter("TraceIDs."+ std::to_string(dep1), traceIDs.at(dep1));
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetMultipleTraceRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void GetMultipleTraceRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
111
arms/src/model/GetMultipleTraceResult.cc
Normal file
111
arms/src/model/GetMultipleTraceResult.cc
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/GetMultipleTraceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
GetMultipleTraceResult::GetMultipleTraceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetMultipleTraceResult::GetMultipleTraceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetMultipleTraceResult::~GetMultipleTraceResult()
|
||||
{}
|
||||
|
||||
void GetMultipleTraceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allMultiCallChainInfosNode = value["MultiCallChainInfos"]["MultiCallChainInfo"];
|
||||
for (auto valueMultiCallChainInfosMultiCallChainInfo : allMultiCallChainInfosNode)
|
||||
{
|
||||
MultiCallChainInfo multiCallChainInfosObject;
|
||||
if(!valueMultiCallChainInfosMultiCallChainInfo["TraceID"].isNull())
|
||||
multiCallChainInfosObject.traceID = valueMultiCallChainInfosMultiCallChainInfo["TraceID"].asString();
|
||||
auto allSpansNode = allMultiCallChainInfosNode["Spans"]["Span"];
|
||||
for (auto allMultiCallChainInfosNodeSpansSpan : allSpansNode)
|
||||
{
|
||||
MultiCallChainInfo::Span spansObject;
|
||||
if(!allMultiCallChainInfosNodeSpansSpan["TraceID"].isNull())
|
||||
spansObject.traceID = allMultiCallChainInfosNodeSpansSpan["TraceID"].asString();
|
||||
if(!allMultiCallChainInfosNodeSpansSpan["OperationName"].isNull())
|
||||
spansObject.operationName = allMultiCallChainInfosNodeSpansSpan["OperationName"].asString();
|
||||
if(!allMultiCallChainInfosNodeSpansSpan["Duration"].isNull())
|
||||
spansObject.duration = std::stol(allMultiCallChainInfosNodeSpansSpan["Duration"].asString());
|
||||
if(!allMultiCallChainInfosNodeSpansSpan["ServiceName"].isNull())
|
||||
spansObject.serviceName = allMultiCallChainInfosNodeSpansSpan["ServiceName"].asString();
|
||||
if(!allMultiCallChainInfosNodeSpansSpan["ServiceIp"].isNull())
|
||||
spansObject.serviceIp = allMultiCallChainInfosNodeSpansSpan["ServiceIp"].asString();
|
||||
if(!allMultiCallChainInfosNodeSpansSpan["Timestamp"].isNull())
|
||||
spansObject.timestamp = std::stol(allMultiCallChainInfosNodeSpansSpan["Timestamp"].asString());
|
||||
if(!allMultiCallChainInfosNodeSpansSpan["RpcId"].isNull())
|
||||
spansObject.rpcId = allMultiCallChainInfosNodeSpansSpan["RpcId"].asString();
|
||||
if(!allMultiCallChainInfosNodeSpansSpan["ResultCode"].isNull())
|
||||
spansObject.resultCode = allMultiCallChainInfosNodeSpansSpan["ResultCode"].asString();
|
||||
if(!allMultiCallChainInfosNodeSpansSpan["HaveStack"].isNull())
|
||||
spansObject.haveStack = allMultiCallChainInfosNodeSpansSpan["HaveStack"].asString() == "true";
|
||||
if(!allMultiCallChainInfosNodeSpansSpan["RpcType"].isNull())
|
||||
spansObject.rpcType = std::stoi(allMultiCallChainInfosNodeSpansSpan["RpcType"].asString());
|
||||
auto allTagEntryListNode = allSpansNode["TagEntryList"]["TagEntry"];
|
||||
for (auto allSpansNodeTagEntryListTagEntry : allTagEntryListNode)
|
||||
{
|
||||
MultiCallChainInfo::Span::TagEntry tagEntryListObject;
|
||||
if(!allSpansNodeTagEntryListTagEntry["Key"].isNull())
|
||||
tagEntryListObject.key = allSpansNodeTagEntryListTagEntry["Key"].asString();
|
||||
if(!allSpansNodeTagEntryListTagEntry["Value"].isNull())
|
||||
tagEntryListObject.value = allSpansNodeTagEntryListTagEntry["Value"].asString();
|
||||
spansObject.tagEntryList.push_back(tagEntryListObject);
|
||||
}
|
||||
auto allLogEventListNode = allSpansNode["LogEventList"]["LogEvent"];
|
||||
for (auto allSpansNodeLogEventListLogEvent : allLogEventListNode)
|
||||
{
|
||||
MultiCallChainInfo::Span::LogEvent logEventListObject;
|
||||
if(!allSpansNodeLogEventListLogEvent["Timestamp"].isNull())
|
||||
logEventListObject.timestamp = std::stol(allSpansNodeLogEventListLogEvent["Timestamp"].asString());
|
||||
auto allTagEntryList1Node = allLogEventListNode["TagEntryList"]["TagEntry"];
|
||||
for (auto allLogEventListNodeTagEntryListTagEntry : allTagEntryList1Node)
|
||||
{
|
||||
MultiCallChainInfo::Span::LogEvent::TagEntry2 tagEntryList1Object;
|
||||
if(!allLogEventListNodeTagEntryListTagEntry["Key"].isNull())
|
||||
tagEntryList1Object.key = allLogEventListNodeTagEntryListTagEntry["Key"].asString();
|
||||
if(!allLogEventListNodeTagEntryListTagEntry["Value"].isNull())
|
||||
tagEntryList1Object.value = allLogEventListNodeTagEntryListTagEntry["Value"].asString();
|
||||
logEventListObject.tagEntryList1.push_back(tagEntryList1Object);
|
||||
}
|
||||
spansObject.logEventList.push_back(logEventListObject);
|
||||
}
|
||||
multiCallChainInfosObject.spans.push_back(spansObject);
|
||||
}
|
||||
multiCallChainInfos_.push_back(multiCallChainInfosObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::vector<GetMultipleTraceResult::MultiCallChainInfo> GetMultipleTraceResult::getMultiCallChainInfos()const
|
||||
{
|
||||
return multiCallChainInfos_;
|
||||
}
|
||||
|
||||
62
arms/src/model/GetStackRequest.cc
Normal file
62
arms/src/model/GetStackRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/GetStackRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::GetStackRequest;
|
||||
|
||||
GetStackRequest::GetStackRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "GetStack")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetStackRequest::~GetStackRequest()
|
||||
{}
|
||||
|
||||
std::string GetStackRequest::getTraceID()const
|
||||
{
|
||||
return traceID_;
|
||||
}
|
||||
|
||||
void GetStackRequest::setTraceID(const std::string& traceID)
|
||||
{
|
||||
traceID_ = traceID;
|
||||
setParameter("TraceID", traceID);
|
||||
}
|
||||
|
||||
std::string GetStackRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void GetStackRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string GetStackRequest::getRpcID()const
|
||||
{
|
||||
return rpcID_;
|
||||
}
|
||||
|
||||
void GetStackRequest::setRpcID(const std::string& rpcID)
|
||||
{
|
||||
rpcID_ = rpcID;
|
||||
setParameter("RpcID", rpcID);
|
||||
}
|
||||
|
||||
79
arms/src/model/GetStackResult.cc
Normal file
79
arms/src/model/GetStackResult.cc
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/GetStackResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
GetStackResult::GetStackResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetStackResult::GetStackResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetStackResult::~GetStackResult()
|
||||
{}
|
||||
|
||||
void GetStackResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allStackInfoNode = value["StackInfo"]["StackInfoItem"];
|
||||
for (auto valueStackInfoStackInfoItem : allStackInfoNode)
|
||||
{
|
||||
StackInfoItem stackInfoObject;
|
||||
if(!valueStackInfoStackInfoItem["StartTime"].isNull())
|
||||
stackInfoObject.startTime = std::stol(valueStackInfoStackInfoItem["StartTime"].asString());
|
||||
if(!valueStackInfoStackInfoItem["Duration"].isNull())
|
||||
stackInfoObject.duration = std::stol(valueStackInfoStackInfoItem["Duration"].asString());
|
||||
if(!valueStackInfoStackInfoItem["RpcId"].isNull())
|
||||
stackInfoObject.rpcId = valueStackInfoStackInfoItem["RpcId"].asString();
|
||||
if(!valueStackInfoStackInfoItem["ServiceName"].isNull())
|
||||
stackInfoObject.serviceName = valueStackInfoStackInfoItem["ServiceName"].asString();
|
||||
if(!valueStackInfoStackInfoItem["Api"].isNull())
|
||||
stackInfoObject.api = valueStackInfoStackInfoItem["Api"].asString();
|
||||
if(!valueStackInfoStackInfoItem["Exception"].isNull())
|
||||
stackInfoObject.exception = valueStackInfoStackInfoItem["Exception"].asString();
|
||||
if(!valueStackInfoStackInfoItem["Line"].isNull())
|
||||
stackInfoObject.line = valueStackInfoStackInfoItem["Line"].asString();
|
||||
auto allExtInfoNode = allStackInfoNode["ExtInfo"]["ExtInfoItem"];
|
||||
for (auto allStackInfoNodeExtInfoExtInfoItem : allExtInfoNode)
|
||||
{
|
||||
StackInfoItem::ExtInfoItem extInfoObject;
|
||||
if(!allStackInfoNodeExtInfoExtInfoItem["Type"].isNull())
|
||||
extInfoObject.type = allStackInfoNodeExtInfoExtInfoItem["Type"].asString();
|
||||
if(!allStackInfoNodeExtInfoExtInfoItem["Info"].isNull())
|
||||
extInfoObject.info = allStackInfoNodeExtInfoExtInfoItem["Info"].asString();
|
||||
stackInfoObject.extInfo.push_back(extInfoObject);
|
||||
}
|
||||
stackInfo_.push_back(stackInfoObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::vector<GetStackResult::StackInfoItem> GetStackResult::getStackInfo()const
|
||||
{
|
||||
return stackInfo_;
|
||||
}
|
||||
|
||||
155
arms/src/model/SearchTracesByPageRequest.cc
Normal file
155
arms/src/model/SearchTracesByPageRequest.cc
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/SearchTracesByPageRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::SearchTracesByPageRequest;
|
||||
|
||||
SearchTracesByPageRequest::SearchTracesByPageRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "SearchTracesByPage")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SearchTracesByPageRequest::~SearchTracesByPageRequest()
|
||||
{}
|
||||
|
||||
long SearchTracesByPageRequest::getEndTime()const
|
||||
{
|
||||
return endTime_;
|
||||
}
|
||||
|
||||
void SearchTracesByPageRequest::setEndTime(long endTime)
|
||||
{
|
||||
endTime_ = endTime;
|
||||
setParameter("EndTime", std::to_string(endTime));
|
||||
}
|
||||
|
||||
long SearchTracesByPageRequest::getStartTime()const
|
||||
{
|
||||
return startTime_;
|
||||
}
|
||||
|
||||
void SearchTracesByPageRequest::setStartTime(long startTime)
|
||||
{
|
||||
startTime_ = startTime;
|
||||
setParameter("StartTime", std::to_string(startTime));
|
||||
}
|
||||
|
||||
bool SearchTracesByPageRequest::getReverse()const
|
||||
{
|
||||
return reverse_;
|
||||
}
|
||||
|
||||
void SearchTracesByPageRequest::setReverse(bool reverse)
|
||||
{
|
||||
reverse_ = reverse;
|
||||
setParameter("Reverse", reverse ? "true" : "false");
|
||||
}
|
||||
|
||||
long SearchTracesByPageRequest::getMinDuration()const
|
||||
{
|
||||
return minDuration_;
|
||||
}
|
||||
|
||||
void SearchTracesByPageRequest::setMinDuration(long minDuration)
|
||||
{
|
||||
minDuration_ = minDuration;
|
||||
setParameter("MinDuration", std::to_string(minDuration));
|
||||
}
|
||||
|
||||
int SearchTracesByPageRequest::getPageNumber()const
|
||||
{
|
||||
return pageNumber_;
|
||||
}
|
||||
|
||||
void SearchTracesByPageRequest::setPageNumber(int pageNumber)
|
||||
{
|
||||
pageNumber_ = pageNumber;
|
||||
setParameter("PageNumber", std::to_string(pageNumber));
|
||||
}
|
||||
|
||||
std::string SearchTracesByPageRequest::getServiceIp()const
|
||||
{
|
||||
return serviceIp_;
|
||||
}
|
||||
|
||||
void SearchTracesByPageRequest::setServiceIp(const std::string& serviceIp)
|
||||
{
|
||||
serviceIp_ = serviceIp;
|
||||
setParameter("ServiceIp", serviceIp);
|
||||
}
|
||||
|
||||
std::vector<SearchTracesByPageRequest::ExclusionFilters> SearchTracesByPageRequest::getExclusionFilters()const
|
||||
{
|
||||
return exclusionFilters_;
|
||||
}
|
||||
|
||||
void SearchTracesByPageRequest::setExclusionFilters(const std::vector<ExclusionFilters>& exclusionFilters)
|
||||
{
|
||||
exclusionFilters_ = exclusionFilters;
|
||||
for(int dep1 = 0; dep1!= exclusionFilters.size(); dep1++) {
|
||||
auto exclusionFiltersObj = exclusionFilters.at(dep1);
|
||||
std::string exclusionFiltersObjStr = "ExclusionFilters." + std::to_string(dep1 + 1);
|
||||
setParameter(exclusionFiltersObjStr + ".Value", exclusionFiltersObj.value);
|
||||
setParameter(exclusionFiltersObjStr + ".Key", exclusionFiltersObj.key);
|
||||
}
|
||||
}
|
||||
|
||||
std::string SearchTracesByPageRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void SearchTracesByPageRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string SearchTracesByPageRequest::getOperationName()const
|
||||
{
|
||||
return operationName_;
|
||||
}
|
||||
|
||||
void SearchTracesByPageRequest::setOperationName(const std::string& operationName)
|
||||
{
|
||||
operationName_ = operationName;
|
||||
setParameter("OperationName", operationName);
|
||||
}
|
||||
|
||||
int SearchTracesByPageRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void SearchTracesByPageRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
std::string SearchTracesByPageRequest::getServiceName()const
|
||||
{
|
||||
return serviceName_;
|
||||
}
|
||||
|
||||
void SearchTracesByPageRequest::setServiceName(const std::string& serviceName)
|
||||
{
|
||||
serviceName_ = serviceName;
|
||||
setParameter("ServiceName", serviceName);
|
||||
}
|
||||
|
||||
74
arms/src/model/SearchTracesByPageResult.cc
Normal file
74
arms/src/model/SearchTracesByPageResult.cc
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/SearchTracesByPageResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
SearchTracesByPageResult::SearchTracesByPageResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SearchTracesByPageResult::SearchTracesByPageResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SearchTracesByPageResult::~SearchTracesByPageResult()
|
||||
{}
|
||||
|
||||
void SearchTracesByPageResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto pageBeanNode = value["PageBean"];
|
||||
if(!pageBeanNode["Total"].isNull())
|
||||
pageBean_.total = std::stoi(pageBeanNode["Total"].asString());
|
||||
if(!pageBeanNode["PageNumber"].isNull())
|
||||
pageBean_.pageNumber = std::stoi(pageBeanNode["PageNumber"].asString());
|
||||
if(!pageBeanNode["PageSize"].isNull())
|
||||
pageBean_.pageSize = std::stoi(pageBeanNode["PageSize"].asString());
|
||||
auto allTraceInfosNode = pageBeanNode["TraceInfos"]["TraceInfo"];
|
||||
for (auto pageBeanNodeTraceInfosTraceInfo : allTraceInfosNode)
|
||||
{
|
||||
PageBean::TraceInfo traceInfoObject;
|
||||
if(!pageBeanNodeTraceInfosTraceInfo["TraceID"].isNull())
|
||||
traceInfoObject.traceID = pageBeanNodeTraceInfosTraceInfo["TraceID"].asString();
|
||||
if(!pageBeanNodeTraceInfosTraceInfo["OperationName"].isNull())
|
||||
traceInfoObject.operationName = pageBeanNodeTraceInfosTraceInfo["OperationName"].asString();
|
||||
if(!pageBeanNodeTraceInfosTraceInfo["ServiceName"].isNull())
|
||||
traceInfoObject.serviceName = pageBeanNodeTraceInfosTraceInfo["ServiceName"].asString();
|
||||
if(!pageBeanNodeTraceInfosTraceInfo["ServiceIp"].isNull())
|
||||
traceInfoObject.serviceIp = pageBeanNodeTraceInfosTraceInfo["ServiceIp"].asString();
|
||||
if(!pageBeanNodeTraceInfosTraceInfo["Duration"].isNull())
|
||||
traceInfoObject.duration = std::stol(pageBeanNodeTraceInfosTraceInfo["Duration"].asString());
|
||||
if(!pageBeanNodeTraceInfosTraceInfo["Timestamp"].isNull())
|
||||
traceInfoObject.timestamp = std::stol(pageBeanNodeTraceInfosTraceInfo["Timestamp"].asString());
|
||||
pageBean_.traceInfos.push_back(traceInfoObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SearchTracesByPageResult::PageBean SearchTracesByPageResult::getPageBean()const
|
||||
{
|
||||
return pageBean_;
|
||||
}
|
||||
|
||||
@@ -37,14 +37,11 @@ namespace AlibabaCloud
|
||||
|
||||
std::string getBizType()const;
|
||||
void setBizType(const std::string& bizType);
|
||||
std::string getSourceIp()const;
|
||||
void setSourceIp(const std::string& sourceIp);
|
||||
std::string getBizId()const;
|
||||
void setBizId(const std::string& bizId);
|
||||
|
||||
private:
|
||||
std::string bizType_;
|
||||
std::string sourceIp_;
|
||||
std::string bizId_;
|
||||
|
||||
};
|
||||
|
||||
@@ -39,8 +39,6 @@ namespace AlibabaCloud
|
||||
void setFaceRetainedImageUrl(const std::string& faceRetainedImageUrl);
|
||||
std::string getUserId()const;
|
||||
void setUserId(const std::string& userId);
|
||||
std::string getSourceIp()const;
|
||||
void setSourceIp(const std::string& sourceIp);
|
||||
std::string getCallbackSeed()const;
|
||||
void setCallbackSeed(const std::string& callbackSeed);
|
||||
std::string getUserIp()const;
|
||||
@@ -71,7 +69,6 @@ namespace AlibabaCloud
|
||||
private:
|
||||
std::string faceRetainedImageUrl_;
|
||||
std::string userId_;
|
||||
std::string sourceIp_;
|
||||
std::string callbackSeed_;
|
||||
std::string userIp_;
|
||||
std::string idCardBackImageUrl_;
|
||||
|
||||
@@ -35,19 +35,13 @@ namespace AlibabaCloud
|
||||
GetMaterialsRequest();
|
||||
~GetMaterialsRequest();
|
||||
|
||||
long getResourceOwnerId()const;
|
||||
void setResourceOwnerId(long resourceOwnerId);
|
||||
std::string getBiz()const;
|
||||
void setBiz(const std::string& biz);
|
||||
std::string getSourceIp()const;
|
||||
void setSourceIp(const std::string& sourceIp);
|
||||
std::string getTicketId()const;
|
||||
void setTicketId(const std::string& ticketId);
|
||||
|
||||
private:
|
||||
long resourceOwnerId_;
|
||||
std::string biz_;
|
||||
std::string sourceIp_;
|
||||
std::string ticketId_;
|
||||
|
||||
};
|
||||
|
||||
@@ -35,19 +35,13 @@ namespace AlibabaCloud
|
||||
GetStatusRequest();
|
||||
~GetStatusRequest();
|
||||
|
||||
long getResourceOwnerId()const;
|
||||
void setResourceOwnerId(long resourceOwnerId);
|
||||
std::string getBiz()const;
|
||||
void setBiz(const std::string& biz);
|
||||
std::string getSourceIp()const;
|
||||
void setSourceIp(const std::string& sourceIp);
|
||||
std::string getTicketId()const;
|
||||
void setTicketId(const std::string& ticketId);
|
||||
|
||||
private:
|
||||
long resourceOwnerId_;
|
||||
std::string biz_;
|
||||
std::string sourceIp_;
|
||||
std::string ticketId_;
|
||||
|
||||
};
|
||||
|
||||
@@ -35,8 +35,6 @@ namespace AlibabaCloud
|
||||
GetVerifyTokenRequest();
|
||||
~GetVerifyTokenRequest();
|
||||
|
||||
long getResourceOwnerId()const;
|
||||
void setResourceOwnerId(long resourceOwnerId);
|
||||
std::string getBinding()const;
|
||||
void setBinding(const std::string& binding);
|
||||
std::string getVerifyConfigs()const;
|
||||
@@ -45,18 +43,14 @@ namespace AlibabaCloud
|
||||
void setUserData(const std::string& userData);
|
||||
std::string getBiz()const;
|
||||
void setBiz(const std::string& biz);
|
||||
std::string getSourceIp()const;
|
||||
void setSourceIp(const std::string& sourceIp);
|
||||
std::string getTicketId()const;
|
||||
void setTicketId(const std::string& ticketId);
|
||||
|
||||
private:
|
||||
long resourceOwnerId_;
|
||||
std::string binding_;
|
||||
std::string verifyConfigs_;
|
||||
std::string userData_;
|
||||
std::string biz_;
|
||||
std::string sourceIp_;
|
||||
std::string ticketId_;
|
||||
|
||||
};
|
||||
|
||||
@@ -51,6 +51,8 @@ namespace AlibabaCloud
|
||||
void setCertType(const std::string& certType);
|
||||
std::string getFaceContrastPictureUrl()const;
|
||||
void setFaceContrastPictureUrl(const std::string& faceContrastPictureUrl);
|
||||
std::string getModel()const;
|
||||
void setModel(const std::string& model);
|
||||
std::string getMetaInfo()const;
|
||||
void setMetaInfo(const std::string& metaInfo);
|
||||
std::string getOssObjectName()const;
|
||||
@@ -77,6 +79,7 @@ namespace AlibabaCloud
|
||||
std::string outerOrderNo_;
|
||||
std::string certType_;
|
||||
std::string faceContrastPictureUrl_;
|
||||
std::string model_;
|
||||
std::string metaInfo_;
|
||||
std::string ossObjectName_;
|
||||
std::string certName_;
|
||||
|
||||
@@ -39,8 +39,6 @@ namespace AlibabaCloud
|
||||
void setFaceImageUrl(const std::string& faceImageUrl);
|
||||
std::string getUserId()const;
|
||||
void setUserId(const std::string& userId);
|
||||
std::string getSourceIp()const;
|
||||
void setSourceIp(const std::string& sourceIp);
|
||||
std::string getIdCardBackImageUrl()const;
|
||||
void setIdCardBackImageUrl(const std::string& idCardBackImageUrl);
|
||||
std::string getIdCardNumber()const;
|
||||
@@ -57,7 +55,6 @@ namespace AlibabaCloud
|
||||
private:
|
||||
std::string faceImageUrl_;
|
||||
std::string userId_;
|
||||
std::string sourceIp_;
|
||||
std::string idCardBackImageUrl_;
|
||||
std::string idCardNumber_;
|
||||
std::string idCardFrontImageUrl_;
|
||||
|
||||
@@ -38,17 +38,6 @@ void DescribeVerifyResultRequest::setBizType(const std::string& bizType)
|
||||
setParameter("BizType", bizType);
|
||||
}
|
||||
|
||||
std::string DescribeVerifyResultRequest::getSourceIp()const
|
||||
{
|
||||
return sourceIp_;
|
||||
}
|
||||
|
||||
void DescribeVerifyResultRequest::setSourceIp(const std::string& sourceIp)
|
||||
{
|
||||
sourceIp_ = sourceIp;
|
||||
setParameter("SourceIp", sourceIp);
|
||||
}
|
||||
|
||||
std::string DescribeVerifyResultRequest::getBizId()const
|
||||
{
|
||||
return bizId_;
|
||||
|
||||
@@ -49,17 +49,6 @@ void DescribeVerifyTokenRequest::setUserId(const std::string& userId)
|
||||
setParameter("UserId", userId);
|
||||
}
|
||||
|
||||
std::string DescribeVerifyTokenRequest::getSourceIp()const
|
||||
{
|
||||
return sourceIp_;
|
||||
}
|
||||
|
||||
void DescribeVerifyTokenRequest::setSourceIp(const std::string& sourceIp)
|
||||
{
|
||||
sourceIp_ = sourceIp;
|
||||
setParameter("SourceIp", sourceIp);
|
||||
}
|
||||
|
||||
std::string DescribeVerifyTokenRequest::getCallbackSeed()const
|
||||
{
|
||||
return callbackSeed_;
|
||||
|
||||
@@ -27,17 +27,6 @@ GetMaterialsRequest::GetMaterialsRequest() :
|
||||
GetMaterialsRequest::~GetMaterialsRequest()
|
||||
{}
|
||||
|
||||
long GetMaterialsRequest::getResourceOwnerId()const
|
||||
{
|
||||
return resourceOwnerId_;
|
||||
}
|
||||
|
||||
void GetMaterialsRequest::setResourceOwnerId(long resourceOwnerId)
|
||||
{
|
||||
resourceOwnerId_ = resourceOwnerId;
|
||||
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
|
||||
}
|
||||
|
||||
std::string GetMaterialsRequest::getBiz()const
|
||||
{
|
||||
return biz_;
|
||||
@@ -49,17 +38,6 @@ void GetMaterialsRequest::setBiz(const std::string& biz)
|
||||
setParameter("Biz", biz);
|
||||
}
|
||||
|
||||
std::string GetMaterialsRequest::getSourceIp()const
|
||||
{
|
||||
return sourceIp_;
|
||||
}
|
||||
|
||||
void GetMaterialsRequest::setSourceIp(const std::string& sourceIp)
|
||||
{
|
||||
sourceIp_ = sourceIp;
|
||||
setParameter("SourceIp", sourceIp);
|
||||
}
|
||||
|
||||
std::string GetMaterialsRequest::getTicketId()const
|
||||
{
|
||||
return ticketId_;
|
||||
|
||||
@@ -27,17 +27,6 @@ GetStatusRequest::GetStatusRequest() :
|
||||
GetStatusRequest::~GetStatusRequest()
|
||||
{}
|
||||
|
||||
long GetStatusRequest::getResourceOwnerId()const
|
||||
{
|
||||
return resourceOwnerId_;
|
||||
}
|
||||
|
||||
void GetStatusRequest::setResourceOwnerId(long resourceOwnerId)
|
||||
{
|
||||
resourceOwnerId_ = resourceOwnerId;
|
||||
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
|
||||
}
|
||||
|
||||
std::string GetStatusRequest::getBiz()const
|
||||
{
|
||||
return biz_;
|
||||
@@ -49,17 +38,6 @@ void GetStatusRequest::setBiz(const std::string& biz)
|
||||
setParameter("Biz", biz);
|
||||
}
|
||||
|
||||
std::string GetStatusRequest::getSourceIp()const
|
||||
{
|
||||
return sourceIp_;
|
||||
}
|
||||
|
||||
void GetStatusRequest::setSourceIp(const std::string& sourceIp)
|
||||
{
|
||||
sourceIp_ = sourceIp;
|
||||
setParameter("SourceIp", sourceIp);
|
||||
}
|
||||
|
||||
std::string GetStatusRequest::getTicketId()const
|
||||
{
|
||||
return ticketId_;
|
||||
|
||||
@@ -27,17 +27,6 @@ GetVerifyTokenRequest::GetVerifyTokenRequest() :
|
||||
GetVerifyTokenRequest::~GetVerifyTokenRequest()
|
||||
{}
|
||||
|
||||
long GetVerifyTokenRequest::getResourceOwnerId()const
|
||||
{
|
||||
return resourceOwnerId_;
|
||||
}
|
||||
|
||||
void GetVerifyTokenRequest::setResourceOwnerId(long resourceOwnerId)
|
||||
{
|
||||
resourceOwnerId_ = resourceOwnerId;
|
||||
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
|
||||
}
|
||||
|
||||
std::string GetVerifyTokenRequest::getBinding()const
|
||||
{
|
||||
return binding_;
|
||||
@@ -82,17 +71,6 @@ void GetVerifyTokenRequest::setBiz(const std::string& biz)
|
||||
setParameter("Biz", biz);
|
||||
}
|
||||
|
||||
std::string GetVerifyTokenRequest::getSourceIp()const
|
||||
{
|
||||
return sourceIp_;
|
||||
}
|
||||
|
||||
void GetVerifyTokenRequest::setSourceIp(const std::string& sourceIp)
|
||||
{
|
||||
sourceIp_ = sourceIp;
|
||||
setParameter("SourceIp", sourceIp);
|
||||
}
|
||||
|
||||
std::string GetVerifyTokenRequest::getTicketId()const
|
||||
{
|
||||
return ticketId_;
|
||||
|
||||
@@ -115,6 +115,17 @@ void InitFaceVerifyRequest::setFaceContrastPictureUrl(const std::string& faceCon
|
||||
setParameter("FaceContrastPictureUrl", faceContrastPictureUrl);
|
||||
}
|
||||
|
||||
std::string InitFaceVerifyRequest::getModel()const
|
||||
{
|
||||
return model_;
|
||||
}
|
||||
|
||||
void InitFaceVerifyRequest::setModel(const std::string& model)
|
||||
{
|
||||
model_ = model;
|
||||
setBodyParameter("Model", model);
|
||||
}
|
||||
|
||||
std::string InitFaceVerifyRequest::getMetaInfo()const
|
||||
{
|
||||
return metaInfo_;
|
||||
|
||||
@@ -49,17 +49,6 @@ void VerifyMaterialRequest::setUserId(const std::string& userId)
|
||||
setParameter("UserId", userId);
|
||||
}
|
||||
|
||||
std::string VerifyMaterialRequest::getSourceIp()const
|
||||
{
|
||||
return sourceIp_;
|
||||
}
|
||||
|
||||
void VerifyMaterialRequest::setSourceIp(const std::string& sourceIp)
|
||||
{
|
||||
sourceIp_ = sourceIp;
|
||||
setParameter("SourceIp", sourceIp);
|
||||
}
|
||||
|
||||
std::string VerifyMaterialRequest::getIdCardBackImageUrl()const
|
||||
{
|
||||
return idCardBackImageUrl_;
|
||||
|
||||
@@ -43,12 +43,16 @@ class ALIBABACLOUD_CORE_EXPORT ClientConfiguration {
|
||||
void setConnectTimeout(const long connectTimeout);
|
||||
void setReadTimeout(const long readTimeout);
|
||||
|
||||
bool rejectUnauthorized() const;
|
||||
void setRejectUnauthorized(const bool rejectUnauthorized);
|
||||
|
||||
private:
|
||||
std::string endpoint_;
|
||||
NetworkProxy proxy_;
|
||||
std::string regionId_;
|
||||
long connectTimeout_;
|
||||
long readTimeout_;
|
||||
bool rejectUnauthorized_ = true;
|
||||
};
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
|
||||
@@ -34,9 +34,12 @@ class HttpClient {
|
||||
virtual HttpResponseOutcome makeRequest(const HttpRequest &request) = 0;
|
||||
NetworkProxy proxy()const;
|
||||
void setProxy(const NetworkProxy &proxy);
|
||||
bool rejectUnauthorized()const;
|
||||
void setRejectUnauthorized(const bool &rejectUnauthorized);
|
||||
|
||||
private:
|
||||
NetworkProxy proxy_;
|
||||
bool rejectUnauthorized_;
|
||||
};
|
||||
} // namespace AlibabaCloud
|
||||
#endif // CORE_INCLUDE_ALIBABACLOUD_CORE_HTTPCLIENT_H_
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/core/AlibabaCloud.h>
|
||||
#include "Executor.h"
|
||||
#include <alibabacloud/core/AlibabaCloud.h>
|
||||
|
||||
static AlibabaCloud::Executor * executor = nullptr;
|
||||
static AlibabaCloud::Executor *executor = nullptr;
|
||||
|
||||
void AlibabaCloud::InitializeSdk() {
|
||||
if (IsSdkInitialized())
|
||||
@@ -27,9 +27,7 @@ void AlibabaCloud::InitializeSdk() {
|
||||
executor->start();
|
||||
}
|
||||
|
||||
bool AlibabaCloud::IsSdkInitialized() {
|
||||
return executor != nullptr;
|
||||
}
|
||||
bool AlibabaCloud::IsSdkInitialized() { return executor != nullptr; }
|
||||
|
||||
void AlibabaCloud::ShutdownSdk() {
|
||||
if (!IsSdkInitialized())
|
||||
|
||||
@@ -17,29 +17,16 @@
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/Utils.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AlibabaCloud {
|
||||
|
||||
AsyncCallerContext::AsyncCallerContext() : uuid_(GenerateUuid())
|
||||
{
|
||||
}
|
||||
AsyncCallerContext::AsyncCallerContext() : uuid_(GenerateUuid()) {}
|
||||
|
||||
AsyncCallerContext::AsyncCallerContext(const std::string &uuid) : uuid_(uuid)
|
||||
{
|
||||
}
|
||||
AsyncCallerContext::AsyncCallerContext(const std::string &uuid) : uuid_(uuid) {}
|
||||
|
||||
AsyncCallerContext::~AsyncCallerContext()
|
||||
{
|
||||
}
|
||||
AsyncCallerContext::~AsyncCallerContext() {}
|
||||
|
||||
std::string AsyncCallerContext::uuid() const
|
||||
{
|
||||
return uuid_;
|
||||
}
|
||||
std::string AsyncCallerContext::uuid() const { return uuid_; }
|
||||
|
||||
void AsyncCallerContext::setUuid(const std::string &uuid)
|
||||
{
|
||||
uuid_ = uuid;
|
||||
}
|
||||
void AsyncCallerContext::setUuid(const std::string &uuid) { uuid_ = uuid; }
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -14,36 +14,26 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/core/ClientConfiguration.h>
|
||||
#include <alibabacloud/core/AlibabaCloud.h>
|
||||
#include <alibabacloud/core/ClientConfiguration.h>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
|
||||
ClientConfiguration::ClientConfiguration(const std::string ®ionId,
|
||||
const NetworkProxy &proxy):
|
||||
regionId_(regionId),
|
||||
proxy_(proxy),
|
||||
endpoint_(),
|
||||
connectTimeout_(kDefaultConnectTimeout),
|
||||
readTimeout_(kDefaultReadTimeout) {
|
||||
}
|
||||
const NetworkProxy &proxy)
|
||||
: regionId_(regionId), proxy_(proxy), endpoint_(),
|
||||
connectTimeout_(kDefaultConnectTimeout),
|
||||
readTimeout_(kDefaultReadTimeout) {}
|
||||
|
||||
ClientConfiguration::~ClientConfiguration() {
|
||||
}
|
||||
ClientConfiguration::~ClientConfiguration() {}
|
||||
|
||||
std::string ClientConfiguration::endpoint() const {
|
||||
return endpoint_;
|
||||
}
|
||||
std::string ClientConfiguration::endpoint() const { return endpoint_; }
|
||||
|
||||
NetworkProxy ClientConfiguration::proxy()const {
|
||||
return proxy_;
|
||||
}
|
||||
NetworkProxy ClientConfiguration::proxy() const { return proxy_; }
|
||||
|
||||
std::string ClientConfiguration::regionId()const {
|
||||
return regionId_;
|
||||
}
|
||||
std::string ClientConfiguration::regionId() const { return regionId_; }
|
||||
|
||||
void ClientConfiguration::setEndpoint(const std::string & endpoint) {
|
||||
void ClientConfiguration::setEndpoint(const std::string &endpoint) {
|
||||
endpoint_ = endpoint;
|
||||
}
|
||||
|
||||
@@ -55,13 +45,9 @@ void ClientConfiguration::setRegionId(const std::string ®ionId) {
|
||||
regionId_ = regionId;
|
||||
}
|
||||
|
||||
long ClientConfiguration::connectTimeout() const {
|
||||
return connectTimeout_;
|
||||
}
|
||||
long ClientConfiguration::connectTimeout() const { return connectTimeout_; }
|
||||
|
||||
long ClientConfiguration::readTimeout() const {
|
||||
return readTimeout_;
|
||||
}
|
||||
long ClientConfiguration::readTimeout() const { return readTimeout_; }
|
||||
|
||||
void ClientConfiguration::setConnectTimeout(const long connectTimeout) {
|
||||
connectTimeout_ = connectTimeout;
|
||||
@@ -71,4 +57,12 @@ void ClientConfiguration::setReadTimeout(const long readTimeout) {
|
||||
readTimeout_ = readTimeout;
|
||||
}
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
bool ClientConfiguration::rejectUnauthorized() const {
|
||||
return rejectUnauthorized_;
|
||||
}
|
||||
|
||||
void ClientConfiguration::setRejectUnauthorized(const bool rejectUnauthorized) {
|
||||
rejectUnauthorized_ = rejectUnauthorized;
|
||||
}
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -1,81 +1,73 @@
|
||||
/*
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <alibabacloud/core/AlibabaCloud.h>
|
||||
#include <alibabacloud/core/CommonClient.h>
|
||||
#include <alibabacloud/core/location/LocationClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
#include <alibabacloud/core/location/LocationClient.h>
|
||||
#include <ctime>
|
||||
#include <algorithm>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
#include <alibabacloud/core/Utils.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AlibabaCloud {
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace {
|
||||
const std::string SERVICE_NAME = "Common";
|
||||
}
|
||||
|
||||
CommonClient::CommonClient(const Credentials &credentials,
|
||||
const ClientConfiguration &configuration) : CoreClient(SERVICE_NAME, configuration),
|
||||
credentialsProvider_(
|
||||
std::make_shared<SimpleCredentialsProvider>(credentials)),
|
||||
signer_(std::make_shared<HmacSha1Signer>())
|
||||
{
|
||||
}
|
||||
const ClientConfiguration &configuration)
|
||||
: CoreClient(SERVICE_NAME, configuration),
|
||||
credentialsProvider_(
|
||||
std::make_shared<SimpleCredentialsProvider>(credentials)),
|
||||
signer_(std::make_shared<HmacSha1Signer>()) {}
|
||||
|
||||
CommonClient::CommonClient(
|
||||
const std::shared_ptr<CredentialsProvider> &credentialsProvider,
|
||||
const ClientConfiguration &configuration) : CoreClient(SERVICE_NAME, configuration),
|
||||
credentialsProvider_(credentialsProvider),
|
||||
signer_(std::make_shared<HmacSha1Signer>())
|
||||
{
|
||||
}
|
||||
const ClientConfiguration &configuration)
|
||||
: CoreClient(SERVICE_NAME, configuration),
|
||||
credentialsProvider_(credentialsProvider),
|
||||
signer_(std::make_shared<HmacSha1Signer>()) {}
|
||||
|
||||
CommonClient::CommonClient(const std::string &accessKeyId,
|
||||
const std::string &accessKeySecret,
|
||||
const ClientConfiguration &configuration) : CoreClient(SERVICE_NAME, configuration),
|
||||
credentialsProvider_(std::make_shared<SimpleCredentialsProvider>(accessKeyId,
|
||||
accessKeySecret)),
|
||||
signer_(std::make_shared<HmacSha1Signer>())
|
||||
{
|
||||
}
|
||||
const ClientConfiguration &configuration)
|
||||
: CoreClient(SERVICE_NAME, configuration),
|
||||
credentialsProvider_(std::make_shared<SimpleCredentialsProvider>(
|
||||
accessKeyId, accessKeySecret)),
|
||||
signer_(std::make_shared<HmacSha1Signer>()) {}
|
||||
|
||||
CommonClient::~CommonClient()
|
||||
{
|
||||
}
|
||||
CommonClient::~CommonClient() {}
|
||||
|
||||
CommonClient::JsonOutcome CommonClient::makeRequest(const std::string &endpoint,
|
||||
const CommonRequest &msg, HttpRequest::Method method) const
|
||||
{
|
||||
CommonClient::JsonOutcome
|
||||
CommonClient::makeRequest(const std::string &endpoint, const CommonRequest &msg,
|
||||
HttpRequest::Method method) const {
|
||||
auto outcome = AttemptRequest(endpoint, msg, method);
|
||||
if (outcome.isSuccess())
|
||||
return JsonOutcome(std::string(outcome.result().body(),
|
||||
outcome.result().bodySize()));
|
||||
return JsonOutcome(
|
||||
std::string(outcome.result().body(), outcome.result().bodySize()));
|
||||
else
|
||||
return JsonOutcome(outcome.error());
|
||||
}
|
||||
|
||||
CommonClient::CommonResponseOutcome CommonClient::commonResponse(
|
||||
const CommonRequest &request) const
|
||||
{
|
||||
CommonClient::CommonResponseOutcome
|
||||
CommonClient::commonResponse(const CommonRequest &request) const {
|
||||
auto outcome = makeRequest(request.domain(), request, request.httpMethod());
|
||||
if (outcome.isSuccess())
|
||||
return CommonResponseOutcome(CommonResponse(outcome.result()));
|
||||
@@ -83,10 +75,9 @@ CommonClient::CommonResponseOutcome CommonClient::commonResponse(
|
||||
return CommonResponseOutcome(Error(outcome.error()));
|
||||
}
|
||||
|
||||
void CommonClient::commonResponseAsync(const CommonRequest &request,
|
||||
const CommonResponseAsyncHandler &handler,
|
||||
const std::shared_ptr<const AsyncCallerContext> &context) const
|
||||
{
|
||||
void CommonClient::commonResponseAsync(
|
||||
const CommonRequest &request, const CommonResponseAsyncHandler &handler,
|
||||
const std::shared_ptr<const AsyncCallerContext> &context) const {
|
||||
auto fn = [this, request, handler, context]() {
|
||||
handler(this, request, commonResponse(request), context);
|
||||
};
|
||||
@@ -95,45 +86,40 @@ void CommonClient::commonResponseAsync(const CommonRequest &request,
|
||||
}
|
||||
|
||||
CommonClient::CommonResponseOutcomeCallable
|
||||
CommonClient::commonResponseCallable(const CommonRequest &request) const
|
||||
{
|
||||
CommonClient::commonResponseCallable(const CommonRequest &request) const {
|
||||
auto task = std::make_shared<std::packaged_task<CommonResponseOutcome()>>(
|
||||
[this, request]() {
|
||||
return this->commonResponse(request);
|
||||
});
|
||||
[this, request]() { return this->commonResponse(request); });
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
HttpRequest CommonClient::buildHttpRequest(const std::string &endpoint,
|
||||
const ServiceRequest &msg, HttpRequest::Method method) const
|
||||
{
|
||||
return buildHttpRequest(endpoint,
|
||||
dynamic_cast<const CommonRequest &>(msg), method);
|
||||
const ServiceRequest &msg,
|
||||
HttpRequest::Method method) const {
|
||||
return buildHttpRequest(endpoint, dynamic_cast<const CommonRequest &>(msg),
|
||||
method);
|
||||
}
|
||||
|
||||
HttpRequest CommonClient::buildHttpRequest(const std::string &endpoint,
|
||||
const CommonRequest &msg, HttpRequest::Method method) const
|
||||
{
|
||||
const CommonRequest &msg,
|
||||
HttpRequest::Method method) const {
|
||||
if (msg.requestPattern() == CommonRequest::RpcPattern)
|
||||
return buildRpcHttpRequest(endpoint, msg, method);
|
||||
else
|
||||
return buildRoaHttpRequest(endpoint, msg, method);
|
||||
}
|
||||
|
||||
HttpRequest CommonClient::buildRoaHttpRequest(const std::string &endpoint,
|
||||
const CommonRequest &msg, HttpRequest::Method method) const
|
||||
{
|
||||
HttpRequest
|
||||
CommonClient::buildRoaHttpRequest(const std::string &endpoint,
|
||||
const CommonRequest &msg,
|
||||
HttpRequest::Method method) const {
|
||||
const Credentials credentials = credentialsProvider_->getCredentials();
|
||||
|
||||
Url url;
|
||||
if (msg.scheme().empty())
|
||||
{
|
||||
if (msg.scheme().empty()) {
|
||||
url.setScheme("https");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
url.setScheme(msg.scheme());
|
||||
}
|
||||
url.setHost(endpoint);
|
||||
@@ -141,17 +127,14 @@ HttpRequest CommonClient::buildRoaHttpRequest(const std::string &endpoint,
|
||||
|
||||
auto params = msg.headerParameters();
|
||||
std::map<std::string, std::string> queryParams;
|
||||
for (const auto &p : params)
|
||||
{
|
||||
for (const auto &p : params) {
|
||||
if (!p.second.empty())
|
||||
queryParams[p.first] = p.second;
|
||||
}
|
||||
|
||||
if (!queryParams.empty())
|
||||
{
|
||||
if (!queryParams.empty()) {
|
||||
std::stringstream queryString;
|
||||
for (const auto &p : queryParams)
|
||||
{
|
||||
for (const auto &p : queryParams) {
|
||||
if (p.second.empty())
|
||||
queryString << "&" << p.first;
|
||||
else
|
||||
@@ -163,42 +146,30 @@ HttpRequest CommonClient::buildRoaHttpRequest(const std::string &endpoint,
|
||||
HttpRequest request(url);
|
||||
request.setMethod(method);
|
||||
|
||||
if (msg.connectTimeout() != kInvalidTimeout)
|
||||
{
|
||||
if (msg.connectTimeout() != kInvalidTimeout) {
|
||||
request.setConnectTimeout(msg.connectTimeout());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
request.setConnectTimeout(configuration().connectTimeout());
|
||||
}
|
||||
|
||||
if (msg.readTimeout() != kInvalidTimeout)
|
||||
{
|
||||
if (msg.readTimeout() != kInvalidTimeout) {
|
||||
request.setReadTimeout(msg.readTimeout());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
request.setReadTimeout(configuration().readTimeout());
|
||||
}
|
||||
|
||||
if (msg.headerParameter("Accept").empty())
|
||||
{
|
||||
if (msg.headerParameter("Accept").empty()) {
|
||||
request.setHeader("Accept", "application/json");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
request.setHeader("Accept", msg.headerParameter("Accept"));
|
||||
}
|
||||
|
||||
std::stringstream ss;
|
||||
ss << msg.contentSize();
|
||||
request.setHeader("Content-Length", ss.str());
|
||||
if (msg.headerParameter("Content-Type").empty())
|
||||
{
|
||||
if (msg.headerParameter("Content-Type").empty()) {
|
||||
request.setHeader("Content-Type", "application/octet-stream");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
request.setHeader("Content-Type", msg.headerParameter("Content-Type"));
|
||||
}
|
||||
request.setHeader("Content-MD5",
|
||||
@@ -239,26 +210,22 @@ HttpRequest CommonClient::buildRoaHttpRequest(const std::string &endpoint,
|
||||
plaintext << url.path() << "?" << url.query();
|
||||
|
||||
std::stringstream sign;
|
||||
sign << "acs "
|
||||
<< credentials.accessKeyId()
|
||||
<< ":"
|
||||
sign << "acs " << credentials.accessKeyId() << ":"
|
||||
<< signer_->generate(plaintext.str(), credentials.accessKeySecret());
|
||||
request.setHeader("Authorization", sign.str());
|
||||
return request;
|
||||
}
|
||||
|
||||
HttpRequest CommonClient::buildRpcHttpRequest(const std::string &endpoint,
|
||||
const CommonRequest &msg, HttpRequest::Method method) const
|
||||
{
|
||||
HttpRequest
|
||||
CommonClient::buildRpcHttpRequest(const std::string &endpoint,
|
||||
const CommonRequest &msg,
|
||||
HttpRequest::Method method) const {
|
||||
const Credentials credentials = credentialsProvider_->getCredentials();
|
||||
|
||||
Url url;
|
||||
if (msg.scheme().empty())
|
||||
{
|
||||
if (msg.scheme().empty()) {
|
||||
url.setScheme("https");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
url.setScheme(msg.scheme());
|
||||
}
|
||||
url.setHost(endpoint);
|
||||
@@ -266,8 +233,7 @@ HttpRequest CommonClient::buildRpcHttpRequest(const std::string &endpoint,
|
||||
|
||||
auto params = msg.queryParameters();
|
||||
std::map<std::string, std::string> queryParams;
|
||||
for (const auto &p : params)
|
||||
{
|
||||
for (const auto &p : params) {
|
||||
if (!p.second.empty())
|
||||
queryParams[p.first] = p.second;
|
||||
}
|
||||
@@ -294,21 +260,17 @@ HttpRequest CommonClient::buildRpcHttpRequest(const std::string &endpoint,
|
||||
std::string bodyParamString;
|
||||
auto signParams = queryParams;
|
||||
auto bodyParams = msg.bodyParameters();
|
||||
for (const auto &p : bodyParams)
|
||||
{
|
||||
for (const auto &p : bodyParams) {
|
||||
bodyParamString += "&";
|
||||
bodyParamString += (p.first + "=" + UrlEncode(p.second));
|
||||
signParams[p.first] = p.second;
|
||||
}
|
||||
|
||||
std::stringstream plaintext;
|
||||
plaintext << HttpMethodToString(method)
|
||||
<< "&"
|
||||
<< UrlEncode(url.path())
|
||||
<< "&"
|
||||
plaintext << HttpMethodToString(method) << "&" << UrlEncode(url.path()) << "&"
|
||||
<< UrlEncode(canonicalizedQuery(signParams));
|
||||
queryParams["Signature"] = signer_->generate(plaintext.str(),
|
||||
credentials.accessKeySecret() + "&");
|
||||
queryParams["Signature"] =
|
||||
signer_->generate(plaintext.str(), credentials.accessKeySecret() + "&");
|
||||
|
||||
std::stringstream queryString;
|
||||
for (const auto &p : queryParams)
|
||||
@@ -316,21 +278,15 @@ HttpRequest CommonClient::buildRpcHttpRequest(const std::string &endpoint,
|
||||
url.setQuery(queryString.str().substr(1));
|
||||
|
||||
HttpRequest request(url);
|
||||
if (msg.connectTimeout() != kInvalidTimeout)
|
||||
{
|
||||
if (msg.connectTimeout() != kInvalidTimeout) {
|
||||
request.setConnectTimeout(msg.connectTimeout());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
request.setConnectTimeout(configuration().connectTimeout());
|
||||
}
|
||||
|
||||
if (msg.readTimeout() != kInvalidTimeout)
|
||||
{
|
||||
if (msg.readTimeout() != kInvalidTimeout) {
|
||||
request.setReadTimeout(msg.readTimeout());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
request.setReadTimeout(configuration().readTimeout());
|
||||
}
|
||||
|
||||
@@ -339,8 +295,7 @@ HttpRequest CommonClient::buildRpcHttpRequest(const std::string &endpoint,
|
||||
request.setHeader("x-sdk-client",
|
||||
std::string("CPP/").append(ALIBABACLOUD_VERSION_STR));
|
||||
|
||||
if (!bodyParamString.empty())
|
||||
{
|
||||
if (!bodyParamString.empty()) {
|
||||
request.setBody(bodyParamString.c_str() + 1, bodyParamString.size() - 1);
|
||||
}
|
||||
return request;
|
||||
|
||||
@@ -1,41 +1,32 @@
|
||||
/*
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/core/CommonRequest.h>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
|
||||
CommonRequest::CommonRequest(RequestPattern pattern):
|
||||
ServiceRequest("", ""),
|
||||
domain_(),
|
||||
queryParams_(),
|
||||
httpMethod_(HttpRequest::Get),
|
||||
requestPattern_(pattern) {
|
||||
}
|
||||
CommonRequest::CommonRequest(RequestPattern pattern)
|
||||
: ServiceRequest("", ""), domain_(), queryParams_(),
|
||||
httpMethod_(HttpRequest::Get), requestPattern_(pattern) {}
|
||||
|
||||
CommonRequest::~CommonRequest() {
|
||||
}
|
||||
CommonRequest::~CommonRequest() {}
|
||||
|
||||
std::string CommonRequest::domain()const {
|
||||
return domain_;
|
||||
}
|
||||
std::string CommonRequest::domain() const { return domain_; }
|
||||
|
||||
void CommonRequest::setDomain(const std::string &domain) {
|
||||
domain_ = domain;
|
||||
}
|
||||
void CommonRequest::setDomain(const std::string &domain) { domain_ = domain; }
|
||||
|
||||
CommonRequest::RequestPattern CommonRequest::requestPattern() const {
|
||||
return requestPattern_;
|
||||
@@ -49,12 +40,10 @@ void CommonRequest::setHttpMethod(HttpRequest::Method method) {
|
||||
httpMethod_ = method;
|
||||
}
|
||||
|
||||
HttpRequest::Method CommonRequest::httpMethod() const {
|
||||
return httpMethod_;
|
||||
}
|
||||
HttpRequest::Method CommonRequest::httpMethod() const { return httpMethod_; }
|
||||
|
||||
CommonRequest::ParameterValueType CommonRequest::queryParameter(
|
||||
const ParameterNameType &name) const {
|
||||
CommonRequest::ParameterValueType
|
||||
CommonRequest::queryParameter(const ParameterNameType &name) const {
|
||||
ParameterCollection::const_iterator it = queryParams_.find(name);
|
||||
if (it == queryParams_.end()) {
|
||||
return ParameterValueType("");
|
||||
@@ -62,19 +51,18 @@ CommonRequest::ParameterValueType CommonRequest::queryParameter(
|
||||
return it->second;
|
||||
}
|
||||
|
||||
|
||||
CommonRequest::ParameterCollection CommonRequest::queryParameters() const {
|
||||
return queryParams_;
|
||||
}
|
||||
|
||||
void CommonRequest::setQueryParameter(const ParameterNameType &name,
|
||||
const ParameterValueType &value) {
|
||||
const ParameterValueType &value) {
|
||||
queryParams_[name] = value;
|
||||
}
|
||||
|
||||
CommonRequest::ParameterValueType CommonRequest::headerParameter(
|
||||
const ParameterNameType &name) const {
|
||||
const ParameterCollection::const_iterator it = headerParams_.find(name);
|
||||
CommonRequest::ParameterValueType
|
||||
CommonRequest::headerParameter(const ParameterNameType &name) const {
|
||||
const ParameterCollection::const_iterator it = headerParams_.find(name);
|
||||
if (it == headerParams_.end()) {
|
||||
return ParameterValueType("");
|
||||
}
|
||||
@@ -86,8 +74,8 @@ CommonRequest::ParameterCollection CommonRequest::headerParameters() const {
|
||||
}
|
||||
|
||||
void CommonRequest::setHeaderParameter(const ParameterNameType &name,
|
||||
const ParameterValueType &value) {
|
||||
const ParameterValueType &value) {
|
||||
headerParams_[name] = value;
|
||||
}
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -1,36 +1,30 @@
|
||||
/*
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/core/CommonResponse.h>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
|
||||
CommonResponse::CommonResponse() :
|
||||
payload_() {
|
||||
}
|
||||
CommonResponse::CommonResponse() : payload_() {}
|
||||
|
||||
CommonResponse::CommonResponse(const std::string &payload) :
|
||||
payload_(payload) {
|
||||
}
|
||||
CommonResponse::CommonResponse(const std::string &payload)
|
||||
: payload_(payload) {}
|
||||
|
||||
CommonResponse::~CommonResponse() {
|
||||
}
|
||||
CommonResponse::~CommonResponse() {}
|
||||
|
||||
std::string CommonResponse::payload() const {
|
||||
return payload_;
|
||||
}
|
||||
std::string CommonResponse::payload() const { return payload_; }
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
#include "CurlHttpClient.h"
|
||||
#include "Executor.h"
|
||||
#include <alibabacloud/core/Utils.h>
|
||||
#include <alibabacloud/core/CoreClient.h>
|
||||
#include <alibabacloud/core/Signer.h>
|
||||
#include <alibabacloud/core/Utils.h>
|
||||
#include <json/json.h>
|
||||
|
||||
/*!
|
||||
@@ -33,6 +33,7 @@ CoreClient::CoreClient(const std::string &servicename,
|
||||
: serviceName_(servicename), configuration_(configuration),
|
||||
httpClient_(new CurlHttpClient) {
|
||||
httpClient_->setProxy(configuration.proxy());
|
||||
httpClient_->setRejectUnauthorized(configuration.rejectUnauthorized());
|
||||
}
|
||||
|
||||
CoreClient::~CoreClient() { delete httpClient_; }
|
||||
@@ -62,14 +63,10 @@ CoreClient::AttemptRequest(const std::string &endpoint,
|
||||
Error CoreClient::buildCoreError(const HttpResponse &response) const {
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
if (!reader.parse(std::string(response.body(), response.bodySize()), value))
|
||||
{
|
||||
if (response.bodySize() > 0)
|
||||
{
|
||||
if (!reader.parse(std::string(response.body(), response.bodySize()), value)) {
|
||||
if (response.bodySize() > 0) {
|
||||
return Error("InvalidResponse", response.body());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return Error("InvalidResponse", "body is empty");
|
||||
}
|
||||
}
|
||||
@@ -79,8 +76,7 @@ Error CoreClient::buildCoreError(const HttpResponse &response) const {
|
||||
error.setErrorMessage(value["Message"].asString());
|
||||
error.setHost(value["HostId"].asString());
|
||||
error.setRequestId(value["RequestId"].asString());
|
||||
if (value["Code"].asString().empty() || value["Message"].asString().empty())
|
||||
{
|
||||
if (value["Code"].asString().empty() || value["Message"].asString().empty()) {
|
||||
error.setDetail(std::string(response.body()));
|
||||
}
|
||||
return error;
|
||||
|
||||
27
core/src/Credentials.cc
Executable file → Normal file
27
core/src/Credentials.cc
Executable file → Normal file
@@ -19,23 +19,16 @@
|
||||
namespace AlibabaCloud {
|
||||
|
||||
Credentials::Credentials(const std::string &accessKeyId,
|
||||
const std::string &accessKeySecret,
|
||||
const std::string &sessionToken) :
|
||||
accessKeyId_(accessKeyId),
|
||||
accessKeySecret_(accessKeySecret),
|
||||
sessionToken_(sessionToken) {
|
||||
}
|
||||
const std::string &accessKeySecret,
|
||||
const std::string &sessionToken)
|
||||
: accessKeyId_(accessKeyId), accessKeySecret_(accessKeySecret),
|
||||
sessionToken_(sessionToken) {}
|
||||
|
||||
Credentials::~Credentials() {
|
||||
}
|
||||
Credentials::~Credentials() {}
|
||||
|
||||
std::string Credentials::accessKeyId() const {
|
||||
return accessKeyId_;
|
||||
}
|
||||
std::string Credentials::accessKeyId() const { return accessKeyId_; }
|
||||
|
||||
std::string Credentials::accessKeySecret() const {
|
||||
return accessKeySecret_;
|
||||
}
|
||||
std::string Credentials::accessKeySecret() const { return accessKeySecret_; }
|
||||
|
||||
void Credentials::setAccessKeyId(const std::string &accessKeyId) {
|
||||
accessKeyId_ = accessKeyId;
|
||||
@@ -49,8 +42,6 @@ void Credentials::setSessionToken(const std::string &sessionToken) {
|
||||
sessionToken_ = sessionToken;
|
||||
}
|
||||
|
||||
std::string Credentials::sessionToken() const {
|
||||
return sessionToken_;
|
||||
}
|
||||
std::string Credentials::sessionToken() const { return sessionToken_; }
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#include <alibabacloud/core/Utils.h>
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <string.h>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
|
||||
@@ -52,13 +52,13 @@ static size_t readCallback(void *ptr, size_t size, size_t nmemb, void *stream) {
|
||||
}
|
||||
|
||||
size_t recvBody(char *ptr, size_t size, size_t nmemb, void *userdata) {
|
||||
std::ostringstream &out = *static_cast<std::ostringstream*>(userdata);
|
||||
out << std::string(ptr, nmemb*size);
|
||||
std::ostringstream &out = *static_cast<std::ostringstream *>(userdata);
|
||||
out << std::string(ptr, nmemb * size);
|
||||
return nmemb * size;
|
||||
}
|
||||
|
||||
size_t recvHeaders(char *buffer, size_t size, size_t nitems, void *userdata) {
|
||||
HttpResponse *response = static_cast<HttpResponse*>(userdata);
|
||||
HttpResponse *response = static_cast<HttpResponse *>(userdata);
|
||||
std::string line(buffer);
|
||||
auto pos = line.find(':');
|
||||
if (pos != line.npos) {
|
||||
@@ -98,16 +98,12 @@ void setCUrlProxy(CURL *curlHandle, const NetworkProxy &proxy) {
|
||||
curl_easy_setopt(curlHandle, CURLOPT_PROXYUSERPWD, out.str().c_str());
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
CurlHttpClient::CurlHttpClient() :
|
||||
HttpClient(),
|
||||
curlHandle_(curl_easy_init()) {
|
||||
}
|
||||
CurlHttpClient::CurlHttpClient()
|
||||
: HttpClient(), curlHandle_(curl_easy_init()) {}
|
||||
|
||||
CurlHttpClient::~CurlHttpClient() {
|
||||
curl_easy_cleanup(curlHandle_);
|
||||
}
|
||||
CurlHttpClient::~CurlHttpClient() { curl_easy_cleanup(curlHandle_); }
|
||||
|
||||
HttpClient::HttpResponseOutcome
|
||||
CurlHttpClient::makeRequest(const HttpRequest &request) {
|
||||
@@ -119,52 +115,54 @@ CurlHttpClient::makeRequest(const HttpRequest &request) {
|
||||
|
||||
std::string url = request.url().toString();
|
||||
switch (request.method()) {
|
||||
case HttpRequest::Method::Get:
|
||||
case HttpRequest::Method::Get:
|
||||
break;
|
||||
case HttpRequest::Method::Post: {
|
||||
if (request.bodySize() > 0) {
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_POSTFIELDS, request.body());
|
||||
} else {
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_POSTFIELDS, "");
|
||||
}
|
||||
case HttpRequest::Method::Post: {
|
||||
if (request.bodySize() > 0) {
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_POSTFIELDS, request.body());
|
||||
} else {
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_POSTFIELDS, "");
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
|
||||
case HttpRequest::Method::Put: {
|
||||
uploadContext* ctx = (uploadContext *)malloc(sizeof(uploadContext));
|
||||
// this is impossible, as the size is 24 Bytes
|
||||
if (ctx == nullptr) {
|
||||
return HttpResponseOutcome(
|
||||
case HttpRequest::Method::Put: {
|
||||
uploadContext *ctx = (uploadContext *)malloc(sizeof(uploadContext));
|
||||
// this is impossible, as the size is 24 Bytes
|
||||
if (ctx == nullptr) {
|
||||
return HttpResponseOutcome(
|
||||
Error("MemoryAllocateError",
|
||||
"There is not enough memory for http transfer."));
|
||||
}
|
||||
ctx->data = request.body();
|
||||
ctx->pos = request.body();
|
||||
ctx->last = ctx->pos + request.bodySize();
|
||||
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_READFUNCTION, readCallback);
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_UPLOAD, 1L);
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_READDATA, ctx);
|
||||
"There is not enough memory for http transfer."));
|
||||
}
|
||||
break;
|
||||
ctx->data = request.body();
|
||||
ctx->pos = request.body();
|
||||
ctx->last = ctx->pos + request.bodySize();
|
||||
|
||||
case HttpRequest::Method::Delete: {
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_CUSTOMREQUEST, "DELETE");
|
||||
if (request.bodySize() > 0) {
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_POSTFIELDS, request.body());
|
||||
} else {
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_POSTFIELDS, "");
|
||||
}
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_READFUNCTION, readCallback);
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_UPLOAD, 1L);
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_READDATA, ctx);
|
||||
} break;
|
||||
|
||||
case HttpRequest::Method::Delete: {
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_CUSTOMREQUEST, "DELETE");
|
||||
if (request.bodySize() > 0) {
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_POSTFIELDS, request.body());
|
||||
} else {
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_POSTFIELDS, "");
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
|
||||
default:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_URL, url.c_str());
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_SSL_VERIFYPEER, 1L);
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_SSL_VERIFYHOST, 2L);
|
||||
if (rejectUnauthorized()) {
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_SSL_VERIFYPEER, 1L);
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_SSL_VERIFYHOST, 2L);
|
||||
} else {
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
}
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_HEADERDATA, &response);
|
||||
curl_easy_setopt(curlHandle_, CURLOPT_HEADERFUNCTION, recvHeaders);
|
||||
|
||||
@@ -195,33 +193,34 @@ CurlHttpClient::makeRequest(const HttpRequest &request) {
|
||||
|
||||
CURLcode res = curl_easy_perform(curlHandle_);
|
||||
switch (res) {
|
||||
case CURLE_OK: {
|
||||
long response_code;
|
||||
curl_easy_getinfo(curlHandle_, CURLINFO_RESPONSE_CODE, &response_code);
|
||||
response.setStatusCode(response_code);
|
||||
response.setBody(out.str().c_str(), out.str().length());
|
||||
return HttpResponseOutcome(response);
|
||||
}
|
||||
case CURLE_SSL_CONNECT_ERROR:
|
||||
return HttpResponseOutcome(
|
||||
case CURLE_OK: {
|
||||
long response_code;
|
||||
curl_easy_getinfo(curlHandle_, CURLINFO_RESPONSE_CODE, &response_code);
|
||||
response.setStatusCode(response_code);
|
||||
response.setBody(out.str().c_str(), out.str().length());
|
||||
return HttpResponseOutcome(response);
|
||||
}
|
||||
case CURLE_SSL_CONNECT_ERROR:
|
||||
return HttpResponseOutcome(
|
||||
Error("SSLConnectError",
|
||||
"A problem occurred somewhere in the SSL/TLS handshake."));
|
||||
case CURLE_OPERATION_TIMEDOUT:
|
||||
return HttpResponseOutcome(
|
||||
"A problem occurred somewhere in the SSL/TLS handshake."));
|
||||
case CURLE_OPERATION_TIMEDOUT:
|
||||
return HttpResponseOutcome(
|
||||
Error("OperationTimeoutError",
|
||||
"Timeout (connectTimeout: " +
|
||||
std::to_string(connect_timeout) + "ms, readTimeout: " +
|
||||
std::to_string(read_timeout) + "ms) when connect or read data: " +
|
||||
HttpMethodToString(request.method()) + " " + request.url().toString()));
|
||||
"Timeout (connectTimeout: " + std::to_string(connect_timeout) +
|
||||
"ms, readTimeout: " + std::to_string(read_timeout) +
|
||||
"ms) when connect or read data: " +
|
||||
HttpMethodToString(request.method()) + " " +
|
||||
request.url().toString()));
|
||||
|
||||
default: {
|
||||
return HttpResponseOutcome(
|
||||
Error("NetworkError",
|
||||
"Failed to connect to host or proxy: " +
|
||||
HttpMethodToString(request.method()) + " " + request.url().toString()));
|
||||
}
|
||||
default: {
|
||||
return HttpResponseOutcome(
|
||||
Error("NetworkError", "Failed to connect to host or proxy: " +
|
||||
HttpMethodToString(request.method()) + " " +
|
||||
request.url().toString()));
|
||||
}
|
||||
}
|
||||
curl_slist_free_all(list);
|
||||
}
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
|
||||
namespace AlibabaCloud {
|
||||
class CurlHttpClient : public HttpClient {
|
||||
public:
|
||||
public:
|
||||
CurlHttpClient();
|
||||
~CurlHttpClient();
|
||||
|
||||
HttpResponseOutcome makeRequest(const HttpRequest &request) override;
|
||||
|
||||
private:
|
||||
private:
|
||||
CURL *curlHandle_;
|
||||
};
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
#endif // CORE_SRC_CURLHTTPCLIENT_H_
|
||||
#endif // CORE_SRC_CURLHTTPCLIENT_H_
|
||||
|
||||
@@ -1,38 +1,34 @@
|
||||
/*
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/core/Url.h>
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
#include "EcsMetadataFetcher.h"
|
||||
#include "CurlHttpClient.h"
|
||||
#include <alibabacloud/core/Url.h>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
|
||||
EcsMetadataFetcher::EcsMetadataFetcher() {
|
||||
}
|
||||
EcsMetadataFetcher::EcsMetadataFetcher() {}
|
||||
|
||||
EcsMetadataFetcher::~EcsMetadataFetcher() {
|
||||
}
|
||||
EcsMetadataFetcher::~EcsMetadataFetcher() {}
|
||||
|
||||
std::string EcsMetadataFetcher::roleName()const {
|
||||
return roleName_;
|
||||
}
|
||||
std::string EcsMetadataFetcher::roleName() const { return roleName_; }
|
||||
|
||||
void EcsMetadataFetcher::setRoleName(const std::string & roleName) {
|
||||
void EcsMetadataFetcher::setRoleName(const std::string &roleName) {
|
||||
roleName_ = roleName;
|
||||
}
|
||||
|
||||
@@ -41,7 +37,7 @@ std::string EcsMetadataFetcher::getMetadata() {
|
||||
}
|
||||
|
||||
std::string EcsMetadataFetcher::getMetadata(const std::string host,
|
||||
const std::string in_path) {
|
||||
const std::string in_path) {
|
||||
std::stringstream path;
|
||||
path << in_path << roleName_;
|
||||
|
||||
@@ -61,4 +57,4 @@ std::string EcsMetadataFetcher::getMetadata(const std::string host,
|
||||
return outcome.error().errorCode();
|
||||
}
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef CORE_SRC_ECSMETADATAFETCHER_H_
|
||||
#define CORE_SRC_ECSMETADATAFETCHER_H_
|
||||
@@ -20,26 +20,26 @@
|
||||
#include <string>
|
||||
|
||||
namespace {
|
||||
const int DEFAULT_TIMEOUT_IN_MILLISECONDS = 5000;
|
||||
const char* const METADATA_SERVICE_HOST = "100.100.100.200";
|
||||
const char* const URL_IN_ECS_METADATA =
|
||||
"/latest/meta-data/ram/security-credentials/";
|
||||
}
|
||||
const int DEFAULT_TIMEOUT_IN_MILLISECONDS = 5000;
|
||||
const char *const METADATA_SERVICE_HOST = "100.100.100.200";
|
||||
const char *const URL_IN_ECS_METADATA =
|
||||
"/latest/meta-data/ram/security-credentials/";
|
||||
} // namespace
|
||||
|
||||
namespace AlibabaCloud {
|
||||
class EcsMetadataFetcher {
|
||||
public:
|
||||
public:
|
||||
EcsMetadataFetcher();
|
||||
~EcsMetadataFetcher();
|
||||
|
||||
std::string roleName()const;
|
||||
void setRoleName(const std::string & roleName);
|
||||
std::string roleName() const;
|
||||
void setRoleName(const std::string &roleName);
|
||||
std::string getMetadata(const std::string host, const std::string path);
|
||||
virtual std::string getMetadata();
|
||||
|
||||
private:
|
||||
private:
|
||||
std::string roleName_;
|
||||
};
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
#endif // CORE_SRC_ECSMETADATAFETCHER_H_
|
||||
#endif // CORE_SRC_ECSMETADATAFETCHER_H_
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <condition_variable>
|
||||
#include <iomanip>
|
||||
#include <json/json.h>
|
||||
#include <mutex>
|
||||
#include <sstream>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
|
||||
#ifndef WIN32
|
||||
#include "LocalEndpoints.h"
|
||||
@@ -30,11 +30,9 @@
|
||||
#include "LocalEndpointsForWindows.h"
|
||||
#endif
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AlibabaCloud {
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace {
|
||||
#if defined(WIN32) && defined(_MSC_VER)
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
@@ -52,8 +50,7 @@ typedef std::string endpointType;
|
||||
typedef std::string mappingType;
|
||||
typedef std::vector<regionType> regionsType;
|
||||
typedef std::map<productType, endpointType> regionalType;
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
regionsType regions;
|
||||
regionalType regional;
|
||||
} productInfoType;
|
||||
@@ -62,14 +59,12 @@ static std::vector<regionType> allRegions;
|
||||
static std::vector<productType> allProductsInLocalEndpoints;
|
||||
static std::map<productType, productInfoType> allLocalEndpoints;
|
||||
|
||||
static void LoadLocalEndpoints()
|
||||
{
|
||||
static void LoadLocalEndpoints() {
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
std::unique_lock<std::mutex> lock(mutex);
|
||||
|
||||
if (local_endpoints_loaded)
|
||||
{
|
||||
if (local_endpoints_loaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -79,42 +74,38 @@ static void LoadLocalEndpoints()
|
||||
WIN_LOCAL_ENDPOINTS_CONFIG_3;
|
||||
#endif
|
||||
|
||||
if (!reader.parse(LOCAL_ENDPOINTS_CONFIG, value))
|
||||
{
|
||||
if (!reader.parse(LOCAL_ENDPOINTS_CONFIG, value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
cv.wait(lock, [] { return !local_endpoints_loading; });// continue if loading completed
|
||||
cv.wait(lock, [] {
|
||||
return !local_endpoints_loading;
|
||||
}); // continue if loading completed
|
||||
|
||||
local_endpoints_loading = true;
|
||||
|
||||
auto regions = value["regions"];
|
||||
for (const auto ®ion : regions)
|
||||
{
|
||||
for (const auto ®ion : regions) {
|
||||
allRegions.push_back(region.asString());
|
||||
}
|
||||
|
||||
auto products = value["products"];
|
||||
for (const auto &product : products)
|
||||
{
|
||||
for (const auto &product : products) {
|
||||
allProductsInLocalEndpoints.push_back(product.asString());
|
||||
}
|
||||
|
||||
auto endpoints = value["endpoints"];
|
||||
for (auto &product : allProductsInLocalEndpoints)
|
||||
{
|
||||
for (auto &product : allProductsInLocalEndpoints) {
|
||||
auto endpoint_per_product = endpoints[product];
|
||||
productInfoType p;
|
||||
|
||||
auto regions = endpoint_per_product["regions"];
|
||||
auto regional = endpoint_per_product["regional"];
|
||||
|
||||
for (auto &r : regions)
|
||||
{
|
||||
for (auto &r : regions) {
|
||||
const std::string region = r.asString();
|
||||
p.regions.push_back(region);
|
||||
p.regional[region] =
|
||||
endpoint_per_product["regional"][region].asString();
|
||||
p.regional[region] = endpoint_per_product["regional"][region].asString();
|
||||
}
|
||||
allLocalEndpoints[product] = p;
|
||||
}
|
||||
@@ -133,8 +124,7 @@ EndpointProvider::EndpointProvider(
|
||||
const std::string serviceCode, int durationSeconds)
|
||||
: LocationClient(locationClient), regionId_(regionId), product_(product),
|
||||
serviceCode_(serviceCode), durationSeconds_(durationSeconds),
|
||||
cachedMutex_(), cachedEndpoint_(), expiry_()
|
||||
{
|
||||
cachedMutex_(), cachedEndpoint_(), expiry_() {
|
||||
transform(product_.begin(), product_.end(), product_.begin(), ::tolower);
|
||||
loadLocalProductsInfo();
|
||||
}
|
||||
@@ -148,34 +138,29 @@ EndpointProvider::EndpointProvider(const Credentials &credentials,
|
||||
: LocationClient(credentials, configuration), regionId_(regionId),
|
||||
product_(product), serviceCode_(serviceCode),
|
||||
durationSeconds_(durationSeconds), cachedMutex_(), cachedEndpoint_(),
|
||||
expiry_()
|
||||
{
|
||||
expiry_() {
|
||||
transform(product_.begin(), product_.end(), product_.begin(), ::tolower);
|
||||
loadLocalProductsInfo();
|
||||
}
|
||||
|
||||
EndpointProvider::~EndpointProvider() {}
|
||||
|
||||
bool EndpointProvider::loadLocalProductsInfo()
|
||||
{
|
||||
bool EndpointProvider::loadLocalProductsInfo() {
|
||||
LoadLocalEndpoints();
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string EndpointProvider::localEndpoint(const std::string regionId,
|
||||
const std::string product)
|
||||
{
|
||||
const std::string product) {
|
||||
|
||||
if (!local_endpoints_loaded)
|
||||
{
|
||||
if (!local_endpoints_loaded) {
|
||||
// impossible
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::vector<regionType>::iterator allRegionsit;
|
||||
allRegionsit = std::find(allRegions.begin(), allRegions.end(), regionId);
|
||||
if (allRegionsit == allRegions.end())
|
||||
{
|
||||
if (allRegionsit == allRegions.end()) {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
@@ -183,47 +168,40 @@ std::string EndpointProvider::localEndpoint(const std::string regionId,
|
||||
allProductsInLocalEndpointsit =
|
||||
std::find(allProductsInLocalEndpoints.begin(),
|
||||
allProductsInLocalEndpoints.end(), product);
|
||||
if (allProductsInLocalEndpointsit == allProductsInLocalEndpoints.end())
|
||||
{
|
||||
if (allProductsInLocalEndpointsit == allProductsInLocalEndpoints.end()) {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::vector<regionType> vec = allLocalEndpoints[product].regions;
|
||||
std::vector<regionType>::iterator it;
|
||||
it = std::find(vec.begin(), vec.end(), regionId);
|
||||
if (it == vec.end())
|
||||
{
|
||||
if (it == vec.end()) {
|
||||
return std::string();
|
||||
}
|
||||
return allLocalEndpoints[product].regional[regionId];
|
||||
}
|
||||
|
||||
bool EndpointProvider::checkExpiry() const
|
||||
{
|
||||
bool EndpointProvider::checkExpiry() const {
|
||||
auto now = std::chrono::system_clock::now();
|
||||
auto diff =
|
||||
std::chrono::duration_cast<std::chrono::seconds>(now - expiry_).count();
|
||||
return (diff > 0 - 60);
|
||||
}
|
||||
|
||||
EndpointProvider::EndpointOutcome EndpointProvider::getEndpoint()
|
||||
{
|
||||
EndpointProvider::EndpointOutcome EndpointProvider::getEndpoint() {
|
||||
// 1st priority: user specified via configuration
|
||||
if (!configuration().endpoint().empty())
|
||||
{
|
||||
if (!configuration().endpoint().empty()) {
|
||||
return EndpointOutcome(configuration().endpoint());
|
||||
}
|
||||
|
||||
// 2nd priority: local configuration
|
||||
std::string endpoint = localEndpoint(regionId_, product_);
|
||||
if (!endpoint.empty())
|
||||
{
|
||||
if (!endpoint.empty()) {
|
||||
return EndpointOutcome(endpoint);
|
||||
}
|
||||
|
||||
// service code is mandatory for location service.
|
||||
if (serviceCode_.empty())
|
||||
{
|
||||
if (serviceCode_.empty()) {
|
||||
return EndpointOutcome(
|
||||
Error("InvalidRegionId", "Product[" + product_ + "] at region[" +
|
||||
regionId_ + "] does not exist."));
|
||||
@@ -231,26 +209,21 @@ EndpointProvider::EndpointOutcome EndpointProvider::getEndpoint()
|
||||
|
||||
// 3rd priority: request from location service
|
||||
EndpointOutcome outcome = loadRemoteEndpoint();
|
||||
if (outcome.isSuccess())
|
||||
{
|
||||
if (outcome.isSuccess()) {
|
||||
return outcome;
|
||||
}
|
||||
|
||||
if (outcome.error().errorCode() == "Illegal Parameter")
|
||||
{
|
||||
if (outcome.error().errorCode() == "Illegal Parameter") {
|
||||
return EndpointOutcome(Error("InvalidProduct", "Prodcut[" + serviceCode_ +
|
||||
"] does not exist."));
|
||||
}
|
||||
return outcome;
|
||||
}
|
||||
|
||||
EndpointProvider::EndpointOutcome EndpointProvider::loadRemoteEndpoint()
|
||||
{
|
||||
if (checkExpiry())
|
||||
{
|
||||
EndpointProvider::EndpointOutcome EndpointProvider::loadRemoteEndpoint() {
|
||||
if (checkExpiry()) {
|
||||
std::lock_guard<std::mutex> locker(cachedMutex_);
|
||||
if (checkExpiry())
|
||||
{
|
||||
if (checkExpiry()) {
|
||||
Location::Model::DescribeEndpointsRequest request;
|
||||
request.setId(regionId_);
|
||||
request.setServiceCode(serviceCode_);
|
||||
|
||||
@@ -18,23 +18,18 @@
|
||||
|
||||
namespace AlibabaCloud {
|
||||
|
||||
Error::Error(std::string code, const std::string message) :
|
||||
errorCode_(code),
|
||||
message_(message),
|
||||
host_(),
|
||||
requestId_(),
|
||||
detail_() {
|
||||
}
|
||||
Error::Error(std::string code, const std::string message)
|
||||
: errorCode_(code), message_(message), host_(), requestId_(), detail_() {}
|
||||
|
||||
std::string Error::errorCode()const { return errorCode_; }
|
||||
std::string Error::errorCode() const { return errorCode_; }
|
||||
std::string Error::errorMessage() const { return message_; }
|
||||
std::string Error::host() const { return host_; }
|
||||
std::string Error::requestId() const { return requestId_; }
|
||||
std::string Error::detail() const { return detail_; }
|
||||
void Error::setErrorCode(const std::string &code) { errorCode_ = code; }
|
||||
void Error::setErrorMessage(const std::string& message) { message_ = message; }
|
||||
void Error::setHost(const std::string& host) { host_ = host; }
|
||||
void Error::setRequestId(const std::string& request) { requestId_ = request; }
|
||||
void Error::setDetail(const std::string& detail) { detail_ = detail; }
|
||||
void Error::setErrorMessage(const std::string &message) { message_ = message; }
|
||||
void Error::setHost(const std::string &host) { host_ = host; }
|
||||
void Error::setRequestId(const std::string &request) { requestId_ = request; }
|
||||
void Error::setDetail(const std::string &detail) { detail_ = detail; }
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "Executor.h"
|
||||
#include <alibabacloud/core/Runnable.h>
|
||||
@@ -21,12 +21,9 @@ namespace AlibabaCloud {
|
||||
|
||||
Executor *Executor::self_ = nullptr;
|
||||
|
||||
Executor::Executor() :
|
||||
cvMutex_(),
|
||||
shutdown_(true),
|
||||
tasksQueue_(),
|
||||
tasksQueueMutex_(),
|
||||
thread_() {
|
||||
Executor::Executor()
|
||||
: cvMutex_(), shutdown_(true), tasksQueue_(), tasksQueueMutex_(),
|
||||
thread_() {
|
||||
self_ = this;
|
||||
}
|
||||
|
||||
@@ -35,9 +32,7 @@ Executor::~Executor() {
|
||||
shutdown();
|
||||
}
|
||||
|
||||
Executor * Executor::instance() {
|
||||
return self_;
|
||||
}
|
||||
Executor *Executor::instance() { return self_; }
|
||||
|
||||
bool Executor::start() {
|
||||
if (!isShutdown())
|
||||
@@ -73,11 +68,9 @@ bool Executor::start() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Executor::isShutdown()const {
|
||||
return shutdown_;
|
||||
}
|
||||
bool Executor::isShutdown() const { return shutdown_; }
|
||||
|
||||
void Executor::execute(Runnable* task) {
|
||||
void Executor::execute(Runnable *task) {
|
||||
if (isShutdown())
|
||||
return;
|
||||
|
||||
@@ -111,4 +104,4 @@ void Executor::shutdown() {
|
||||
thread_.join();
|
||||
}
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
/*
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef CORE_SRC_EXECUTOR_H_
|
||||
#define CORE_SRC_EXECUTOR_H_
|
||||
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
class Runnable;
|
||||
class Executor {
|
||||
public:
|
||||
public:
|
||||
Executor();
|
||||
~Executor();
|
||||
|
||||
static Executor * instance();
|
||||
void execute(Runnable* task);
|
||||
bool isShutdown()const;
|
||||
static Executor *instance();
|
||||
void execute(Runnable *task);
|
||||
bool isShutdown() const;
|
||||
bool start();
|
||||
void shutdown();
|
||||
void wakeUp();
|
||||
|
||||
private:
|
||||
private:
|
||||
static Executor *self_;
|
||||
std::atomic<bool> shutdown_;
|
||||
std::queue<Runnable*> tasksQueue_;
|
||||
std::queue<Runnable *> tasksQueue_;
|
||||
std::mutex tasksQueueMutex_;
|
||||
std::thread thread_;
|
||||
std::condition_variable cv_;
|
||||
std::mutex cvMutex_;
|
||||
};
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
#endif // CORE_SRC_EXECUTOR_H_
|
||||
#endif // CORE_SRC_EXECUTOR_H_
|
||||
|
||||
@@ -16,23 +16,20 @@
|
||||
|
||||
#include <alibabacloud/core/HmacSha1Signer.h>
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <wincrypt.h>
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <openssl/hmac.h>
|
||||
#endif
|
||||
|
||||
namespace AlibabaCloud {
|
||||
|
||||
HmacSha1Signer::HmacSha1Signer() :
|
||||
Signer(HmacSha1, "HMAC-SHA1", "1.0") {
|
||||
}
|
||||
HmacSha1Signer::HmacSha1Signer() : Signer(HmacSha1, "HMAC-SHA1", "1.0") {}
|
||||
|
||||
HmacSha1Signer::~HmacSha1Signer() {
|
||||
}
|
||||
HmacSha1Signer::~HmacSha1Signer() {}
|
||||
|
||||
std::string HmacSha1Signer::generate(const std::string & src,
|
||||
const std::string & secret) const {
|
||||
std::string HmacSha1Signer::generate(const std::string &src,
|
||||
const std::string &secret) const {
|
||||
if (src.empty())
|
||||
return std::string();
|
||||
|
||||
@@ -41,10 +38,10 @@ std::string HmacSha1Signer::generate(const std::string & src,
|
||||
BLOBHEADER hdr;
|
||||
DWORD dwKeySize;
|
||||
BYTE rgbKeyData[];
|
||||
}my_blob;
|
||||
} my_blob;
|
||||
|
||||
DWORD kbLen = sizeof(my_blob) + secret.size();
|
||||
my_blob * kb = (my_blob *)LocalAlloc(LPTR, kbLen);
|
||||
my_blob *kb = (my_blob *)LocalAlloc(LPTR, kbLen);
|
||||
kb->hdr.bType = PLAINTEXTKEYBLOB;
|
||||
kb->hdr.bVersion = CUR_BLOB_VERSION;
|
||||
kb->hdr.reserved = 0;
|
||||
@@ -61,12 +58,12 @@ std::string HmacSha1Signer::generate(const std::string & src,
|
||||
ZeroMemory(&HmacInfo, sizeof(HmacInfo));
|
||||
HmacInfo.HashAlgid = CALG_SHA1;
|
||||
|
||||
CryptAcquireContext(&hProv, NULL,
|
||||
MS_ENHANCED_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_NEWKEYSET);
|
||||
CryptImportKey(hProv, (BYTE*)kb, kbLen, 0, CRYPT_IPSEC_HMAC_KEY, &hKey);
|
||||
CryptAcquireContext(&hProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL,
|
||||
CRYPT_VERIFYCONTEXT | CRYPT_NEWKEYSET);
|
||||
CryptImportKey(hProv, (BYTE *)kb, kbLen, 0, CRYPT_IPSEC_HMAC_KEY, &hKey);
|
||||
CryptCreateHash(hProv, CALG_HMAC, hKey, 0, &hHmacHash);
|
||||
CryptSetHashParam(hHmacHash, HP_HMAC_INFO, (BYTE*)&HmacInfo, 0);
|
||||
CryptHashData(hHmacHash, (BYTE*)(src.c_str()), src.size(), 0);
|
||||
CryptSetHashParam(hHmacHash, HP_HMAC_INFO, (BYTE *)&HmacInfo, 0);
|
||||
CryptHashData(hHmacHash, (BYTE *)(src.c_str()), src.size(), 0);
|
||||
CryptGetHashParam(hHmacHash, HP_HASHVAL, pbHash, &dwDataLen, 0);
|
||||
|
||||
LocalFree(kb);
|
||||
@@ -75,11 +72,11 @@ std::string HmacSha1Signer::generate(const std::string & src,
|
||||
CryptReleaseContext(hProv, 0);
|
||||
|
||||
DWORD dlen = 0;
|
||||
CryptBinaryToString(pbHash,
|
||||
dwDataLen, CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, NULL, &dlen);
|
||||
char* dest = new char[dlen];
|
||||
CryptBinaryToString(pbHash,
|
||||
dwDataLen, CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, dest, &dlen);
|
||||
CryptBinaryToString(pbHash, dwDataLen,
|
||||
CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, NULL, &dlen);
|
||||
char *dest = new char[dlen];
|
||||
CryptBinaryToString(pbHash, dwDataLen,
|
||||
CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, dest, &dlen);
|
||||
|
||||
std::string ret = std::string(dest, dlen);
|
||||
delete dest;
|
||||
@@ -89,14 +86,14 @@ std::string HmacSha1Signer::generate(const std::string & src,
|
||||
unsigned int mdLen = EVP_MAX_BLOCK_LENGTH;
|
||||
|
||||
if (HMAC(EVP_sha1(), secret.c_str(), secret.size(),
|
||||
reinterpret_cast<const unsigned char*>(src.c_str()), src.size(),
|
||||
md, &mdLen) == nullptr)
|
||||
reinterpret_cast<const unsigned char *>(src.c_str()), src.size(), md,
|
||||
&mdLen) == nullptr)
|
||||
return std::string();
|
||||
|
||||
char encodedData[100];
|
||||
EVP_EncodeBlock(reinterpret_cast<unsigned char*>(encodedData), md, mdLen);
|
||||
EVP_EncodeBlock(reinterpret_cast<unsigned char *>(encodedData), md, mdLen);
|
||||
return encodedData;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -16,24 +16,23 @@
|
||||
|
||||
#include <alibabacloud/core/HttpClient.h>
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
|
||||
HttpClient::HttpClient() :
|
||||
proxy_() {
|
||||
HttpClient::HttpClient() : proxy_() {}
|
||||
|
||||
HttpClient::~HttpClient() {}
|
||||
|
||||
NetworkProxy HttpClient::proxy() const { return proxy_; }
|
||||
|
||||
void HttpClient::setProxy(const NetworkProxy &proxy) { proxy_ = proxy; }
|
||||
|
||||
bool HttpClient::rejectUnauthorized() const { return rejectUnauthorized_; }
|
||||
|
||||
void HttpClient::setRejectUnauthorized(const bool &rejectUnauthorized) {
|
||||
rejectUnauthorized_ = rejectUnauthorized;
|
||||
}
|
||||
|
||||
HttpClient::~HttpClient() {
|
||||
}
|
||||
|
||||
NetworkProxy HttpClient::proxy()const {
|
||||
return proxy_;
|
||||
}
|
||||
|
||||
void HttpClient::setProxy(const NetworkProxy &proxy) {
|
||||
proxy_ = proxy;
|
||||
}
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -14,54 +14,44 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/core/HttpMessage.h>
|
||||
#include <algorithm>
|
||||
#include <alibabacloud/core/HttpMessage.h>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
|
||||
namespace {
|
||||
#if defined(WIN32) && defined(_MSC_VER)
|
||||
# define strcasecmp _stricmp
|
||||
# define strncasecmp _strnicmp
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
#else
|
||||
# include <strings.h>
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
std::string KnownHeaderMapper[] {
|
||||
"Accept",
|
||||
"Accept-Charset",
|
||||
"Accept-Encoding",
|
||||
"Accept-Language",
|
||||
"Authorization",
|
||||
"Connection",
|
||||
"Content-Length",
|
||||
"Content-MD5",
|
||||
"Content-Type",
|
||||
"Date",
|
||||
"Host",
|
||||
"Server",
|
||||
"User-Agent"
|
||||
};
|
||||
} // namespace
|
||||
std::string KnownHeaderMapper[]{"Accept",
|
||||
"Accept-Charset",
|
||||
"Accept-Encoding",
|
||||
"Accept-Language",
|
||||
"Authorization",
|
||||
"Connection",
|
||||
"Content-Length",
|
||||
"Content-MD5",
|
||||
"Content-Type",
|
||||
"Date",
|
||||
"Host",
|
||||
"Server",
|
||||
"User-Agent"};
|
||||
} // namespace
|
||||
|
||||
HttpMessage::HttpMessage() :
|
||||
body_(nullptr),
|
||||
bodySize_(0),
|
||||
headers_() {
|
||||
}
|
||||
HttpMessage::HttpMessage() : body_(nullptr), bodySize_(0), headers_() {}
|
||||
|
||||
HttpMessage::HttpMessage(const HttpMessage &other) :
|
||||
body_(nullptr),
|
||||
bodySize_(other.bodySize_),
|
||||
headers_(other.headers_) {
|
||||
HttpMessage::HttpMessage(const HttpMessage &other)
|
||||
: body_(nullptr), bodySize_(other.bodySize_), headers_(other.headers_) {
|
||||
setBody(other.body_, other.bodySize_);
|
||||
}
|
||||
|
||||
HttpMessage::HttpMessage(HttpMessage &&other) {
|
||||
*this = std::move(other);
|
||||
}
|
||||
HttpMessage::HttpMessage(HttpMessage &&other) { *this = std::move(other); }
|
||||
|
||||
HttpMessage& HttpMessage::operator=(const HttpMessage &other) {
|
||||
HttpMessage &HttpMessage::operator=(const HttpMessage &other) {
|
||||
if (this != &other) {
|
||||
body_ = nullptr;
|
||||
bodySize_ = 0;
|
||||
@@ -71,23 +61,23 @@ HttpMessage& HttpMessage::operator=(const HttpMessage &other) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
HttpMessage& HttpMessage::operator=(HttpMessage &&other) {
|
||||
HttpMessage &HttpMessage::operator=(HttpMessage &&other) {
|
||||
if (this != &other)
|
||||
*this = std::move(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void HttpMessage::addHeader(const HeaderNameType & name,
|
||||
const HeaderValueType & value) {
|
||||
void HttpMessage::addHeader(const HeaderNameType &name,
|
||||
const HeaderValueType &value) {
|
||||
setHeader(name, value);
|
||||
}
|
||||
|
||||
void HttpMessage::addHeader(KnownHeader header, const HeaderValueType & value) {
|
||||
void HttpMessage::addHeader(KnownHeader header, const HeaderValueType &value) {
|
||||
setHeader(header, value);
|
||||
}
|
||||
|
||||
HttpMessage::HeaderValueType HttpMessage::header(
|
||||
const HeaderNameType & name) const {
|
||||
HttpMessage::HeaderValueType
|
||||
HttpMessage::header(const HeaderNameType &name) const {
|
||||
auto it = headers_.find(name);
|
||||
if (it != headers_.end())
|
||||
return it->second;
|
||||
@@ -95,11 +85,9 @@ HttpMessage::HeaderValueType HttpMessage::header(
|
||||
return std::string();
|
||||
}
|
||||
|
||||
HttpMessage::HeaderCollection HttpMessage::headers() const {
|
||||
return headers_;
|
||||
}
|
||||
HttpMessage::HeaderCollection HttpMessage::headers() const { return headers_; }
|
||||
|
||||
void HttpMessage::removeHeader(const HeaderNameType & name) {
|
||||
void HttpMessage::removeHeader(const HeaderNameType &name) {
|
||||
headers_.erase(name);
|
||||
}
|
||||
|
||||
@@ -107,33 +95,24 @@ void HttpMessage::removeHeader(KnownHeader header) {
|
||||
removeHeader(KnownHeaderMapper[header]);
|
||||
}
|
||||
|
||||
void HttpMessage::setHeader(const HeaderNameType & name,
|
||||
const HeaderValueType & value) {
|
||||
void HttpMessage::setHeader(const HeaderNameType &name,
|
||||
const HeaderValueType &value) {
|
||||
headers_[name] = value;
|
||||
}
|
||||
|
||||
void HttpMessage::setHeader(KnownHeader header,
|
||||
const std::string & value) {
|
||||
void HttpMessage::setHeader(KnownHeader header, const std::string &value) {
|
||||
setHeader(KnownHeaderMapper[header], value);
|
||||
}
|
||||
|
||||
HttpMessage::~HttpMessage() {
|
||||
setBody(nullptr, 0);
|
||||
}
|
||||
HttpMessage::~HttpMessage() { setBody(nullptr, 0); }
|
||||
|
||||
const char* HttpMessage::body()const {
|
||||
return body_;
|
||||
}
|
||||
const char *HttpMessage::body() const { return body_; }
|
||||
|
||||
size_t HttpMessage::bodySize()const {
|
||||
return bodySize_;
|
||||
}
|
||||
size_t HttpMessage::bodySize() const { return bodySize_; }
|
||||
|
||||
bool HttpMessage::hasBody() const {
|
||||
return (bodySize_ != 0);
|
||||
}
|
||||
bool HttpMessage::hasBody() const { return (bodySize_ != 0); }
|
||||
|
||||
HttpMessage::HeaderValueType HttpMessage::header(KnownHeader header)const {
|
||||
HttpMessage::HeaderValueType HttpMessage::header(KnownHeader header) const {
|
||||
return this->header(KnownHeaderMapper[header]);
|
||||
}
|
||||
|
||||
@@ -150,9 +129,9 @@ void HttpMessage::setBody(const char *data, size_t size) {
|
||||
}
|
||||
}
|
||||
|
||||
bool HttpMessage::nocaseLess::operator()(const std::string & s1,
|
||||
const std::string & s2) const {
|
||||
bool HttpMessage::nocaseLess::operator()(const std::string &s1,
|
||||
const std::string &s2) const {
|
||||
return strcasecmp(s1.c_str(), s2.c_str()) < 0;
|
||||
}
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -14,46 +14,29 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/core/HttpRequest.h>
|
||||
#include <alibabacloud/core/AlibabaCloud.h>
|
||||
#include <alibabacloud/core/HttpRequest.h>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
|
||||
HttpRequest::HttpRequest(const Url &url, Method method) :
|
||||
HttpMessage(),
|
||||
url_(url),
|
||||
method_(method),
|
||||
connectTimeout_(kDefaultConnectTimeout),
|
||||
readTimeout_(kDefaultReadTimeout) {
|
||||
}
|
||||
HttpRequest::HttpRequest(const Url &url, Method method)
|
||||
: HttpMessage(), url_(url), method_(method),
|
||||
connectTimeout_(kDefaultConnectTimeout),
|
||||
readTimeout_(kDefaultReadTimeout) {}
|
||||
|
||||
HttpRequest::~HttpRequest() {
|
||||
}
|
||||
HttpRequest::~HttpRequest() {}
|
||||
|
||||
HttpRequest::Method HttpRequest::method() const {
|
||||
return method_;
|
||||
}
|
||||
HttpRequest::Method HttpRequest::method() const { return method_; }
|
||||
|
||||
void HttpRequest::setMethod(Method method) { method_ = method; }
|
||||
|
||||
void HttpRequest::setMethod(Method method) {
|
||||
method_ = method;
|
||||
}
|
||||
void HttpRequest::setUrl(const Url &url) { url_ = url; }
|
||||
|
||||
void HttpRequest::setUrl(const Url &url) {
|
||||
url_ = url;
|
||||
}
|
||||
Url HttpRequest::url() const { return url_; }
|
||||
|
||||
Url HttpRequest::url()const {
|
||||
return url_;
|
||||
}
|
||||
long HttpRequest::connectTimeout() const { return connectTimeout_; }
|
||||
|
||||
long HttpRequest::connectTimeout() const {
|
||||
return connectTimeout_;
|
||||
}
|
||||
|
||||
long HttpRequest::readTimeout() const {
|
||||
return readTimeout_;
|
||||
}
|
||||
long HttpRequest::readTimeout() const { return readTimeout_; }
|
||||
|
||||
void HttpRequest::setConnectTimeout(const long connectTimeout) {
|
||||
connectTimeout_ = connectTimeout;
|
||||
@@ -63,4 +46,4 @@ void HttpRequest::setReadTimeout(const long readTimeout) {
|
||||
readTimeout_ = readTimeout;
|
||||
}
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -17,36 +17,23 @@
|
||||
#include <alibabacloud/core/HttpResponse.h>
|
||||
|
||||
namespace {
|
||||
#define INVALID_STATUS_CODE -1
|
||||
}
|
||||
#define INVALID_STATUS_CODE -1
|
||||
} // namespace
|
||||
|
||||
namespace AlibabaCloud {
|
||||
|
||||
HttpResponse::HttpResponse() :
|
||||
HttpMessage(),
|
||||
request_(),
|
||||
statusCode_(INVALID_STATUS_CODE) {
|
||||
}
|
||||
HttpResponse::HttpResponse()
|
||||
: HttpMessage(), request_(), statusCode_(INVALID_STATUS_CODE) {}
|
||||
|
||||
HttpResponse::HttpResponse(const HttpRequest & request) :
|
||||
HttpMessage(),
|
||||
request_(request),
|
||||
statusCode_(INVALID_STATUS_CODE) {
|
||||
}
|
||||
HttpResponse::HttpResponse(const HttpRequest &request)
|
||||
: HttpMessage(), request_(request), statusCode_(INVALID_STATUS_CODE) {}
|
||||
|
||||
HttpResponse::~HttpResponse() {
|
||||
}
|
||||
HttpResponse::~HttpResponse() {}
|
||||
|
||||
HttpRequest HttpResponse::request() const {
|
||||
return request_;
|
||||
}
|
||||
HttpRequest HttpResponse::request() const { return request_; }
|
||||
|
||||
void HttpResponse::setStatusCode(int code) {
|
||||
statusCode_ = code;
|
||||
}
|
||||
void HttpResponse::setStatusCode(int code) { statusCode_ = code; }
|
||||
|
||||
int HttpResponse::statusCode() const {
|
||||
return statusCode_;
|
||||
}
|
||||
int HttpResponse::statusCode() const { return statusCode_; }
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -18,11 +18,9 @@
|
||||
|
||||
namespace AlibabaCloud {
|
||||
|
||||
InstanceProfileCredentials::InstanceProfileCredentials() :
|
||||
BasicSessionCredentials(Credentials::InstanceProfile) {
|
||||
}
|
||||
InstanceProfileCredentials::InstanceProfileCredentials()
|
||||
: BasicSessionCredentials(Credentials::InstanceProfile) {}
|
||||
|
||||
InstanceProfileCredentials::~InstanceProfileCredentials() {
|
||||
}
|
||||
InstanceProfileCredentials::~InstanceProfileCredentials() {}
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
@@ -15,37 +15,33 @@
|
||||
*/
|
||||
|
||||
#include "EcsMetadataFetcher.h"
|
||||
#include <alibabacloud/core/Utils.h>
|
||||
#include <alibabacloud/core/InstanceProfileCredentialsProvider.h>
|
||||
#include <alibabacloud/core/Utils.h>
|
||||
#include <chrono>
|
||||
#include <iomanip>
|
||||
#include <json/json.h>
|
||||
#include <mutex>
|
||||
#include <sstream>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AlibabaCloud {
|
||||
|
||||
InstanceProfileCredentialsProvider::InstanceProfileCredentialsProvider(
|
||||
const std::string &roleName, int durationSeconds)
|
||||
: CredentialsProvider(), EcsMetadataFetcher(),
|
||||
durationSeconds_(durationSeconds), cachedMutex_(),
|
||||
cachedCredentials_("", ""), expiry_()
|
||||
{
|
||||
cachedCredentials_("", ""), expiry_() {
|
||||
setRoleName(roleName);
|
||||
}
|
||||
|
||||
InstanceProfileCredentialsProvider::~InstanceProfileCredentialsProvider() {}
|
||||
|
||||
Credentials InstanceProfileCredentialsProvider::getCredentials()
|
||||
{
|
||||
Credentials InstanceProfileCredentialsProvider::getCredentials() {
|
||||
loadCredentials();
|
||||
std::lock_guard<std::mutex> locker(cachedMutex_);
|
||||
return cachedCredentials_;
|
||||
}
|
||||
|
||||
bool InstanceProfileCredentialsProvider::checkExpiry() const
|
||||
{
|
||||
bool InstanceProfileCredentialsProvider::checkExpiry() const {
|
||||
auto now = std::chrono::system_clock::now();
|
||||
auto diff =
|
||||
std::chrono::duration_cast<std::chrono::seconds>(now - expiry_).count();
|
||||
@@ -53,20 +49,17 @@ bool InstanceProfileCredentialsProvider::checkExpiry() const
|
||||
return (diff > 0 - 60);
|
||||
}
|
||||
|
||||
void InstanceProfileCredentialsProvider::loadCredentials()
|
||||
{
|
||||
if (checkExpiry())
|
||||
{
|
||||
void InstanceProfileCredentialsProvider::loadCredentials() {
|
||||
if (checkExpiry()) {
|
||||
std::lock_guard<std::mutex> locker(cachedMutex_);
|
||||
if (checkExpiry())
|
||||
{
|
||||
if (checkExpiry()) {
|
||||
auto outcome = getMetadata();
|
||||
Json::Value value;
|
||||
Json::Reader reader;
|
||||
if (reader.parse(outcome, value))
|
||||
{
|
||||
if (value["Code"].empty() && value["AccessKeyId"].empty() && value["AccessKeySecret"].empty() && value["SecurityToken"].empty() && value["Expiration"].empty())
|
||||
{
|
||||
if (reader.parse(outcome, value)) {
|
||||
if (value["Code"].empty() && value["AccessKeyId"].empty() &&
|
||||
value["AccessKeySecret"].empty() &&
|
||||
value["SecurityToken"].empty() && value["Expiration"].empty()) {
|
||||
cachedCredentials_ = Credentials("", "");
|
||||
return;
|
||||
}
|
||||
@@ -77,9 +70,8 @@ void InstanceProfileCredentialsProvider::loadCredentials()
|
||||
auto securityToken = value["SecurityToken"].asString();
|
||||
auto expiration = value["Expiration"].asString();
|
||||
|
||||
cachedCredentials_ = Credentials(accessKeyId,
|
||||
accessKeySecret,
|
||||
securityToken);
|
||||
cachedCredentials_ =
|
||||
Credentials(accessKeyId, accessKeySecret, securityToken);
|
||||
|
||||
std::tm tm = {};
|
||||
#if defined(__GNUG__) && __GNUC__ < 5
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user