diff --git a/CHANGELOG b/CHANGELOG index b5c8224a0..654a6070f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2019-08-30 Version 1.36.100 +- Add api for getTrace and searchTracelist. + 2019-08-29 Version 1.36.99 - Move StopExecution params to body. diff --git a/VERSION b/VERSION index 79b832536..3a5a40c61 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.99 \ No newline at end of file +1.36.100 \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/XtraceExport.h b/xtrace/include/alibabacloud/xtrace/XtraceExport.h new file mode 100644 index 000000000..0d3a19ab4 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/XtraceExport.h @@ -0,0 +1,32 @@ +/* + * 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_XTRACE_XTRACEEXPORT_H_ +#define ALIBABACLOUD_XTRACE_XTRACEEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_XTRACE_LIBRARY) +# define ALIBABACLOUD_XTRACE_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_XTRACE_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_XTRACE_EXPORT +#endif + +#endif // !ALIBABACLOUD_XTRACE_XTRACEEXPORT_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/GetTagKeyRequest.h b/xtrace/include/alibabacloud/xtrace/model/GetTagKeyRequest.h new file mode 100644 index 000000000..10adeeb03 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/GetTagKeyRequest.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_XTRACE_MODEL_GETTAGKEYREQUEST_H_ +#define ALIBABACLOUD_XTRACE_MODEL_GETTAGKEYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT GetTagKeyRequest : public RpcServiceRequest + { + + public: + GetTagKeyRequest(); + ~GetTagKeyRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + long getEndTime()const; + void setEndTime(long endTime); + std::string getServiceName()const; + void setServiceName(const std::string& serviceName); + long getStartTime()const; + void setStartTime(long startTime); + std::string getSpanName()const; + void setSpanName(const std::string& spanName); + + private: + std::string regionId_; + long endTime_; + std::string serviceName_; + long startTime_; + std::string spanName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_GETTAGKEYREQUEST_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/GetTagKeyResult.h b/xtrace/include/alibabacloud/xtrace/model/GetTagKeyResult.h new file mode 100644 index 000000000..e6f320ab1 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/GetTagKeyResult.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_XTRACE_MODEL_GETTAGKEYRESULT_H_ +#define ALIBABACLOUD_XTRACE_MODEL_GETTAGKEYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT GetTagKeyResult : public ServiceResult + { + public: + + + GetTagKeyResult(); + explicit GetTagKeyResult(const std::string &payload); + ~GetTagKeyResult(); + std::vector getTagKeys()const; + + protected: + void parse(const std::string &payload); + private: + std::vector tagKeys_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_GETTAGKEYRESULT_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/GetTagValRequest.h b/xtrace/include/alibabacloud/xtrace/model/GetTagValRequest.h new file mode 100644 index 000000000..3dab62904 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/GetTagValRequest.h @@ -0,0 +1,63 @@ +/* + * 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_XTRACE_MODEL_GETTAGVALREQUEST_H_ +#define ALIBABACLOUD_XTRACE_MODEL_GETTAGVALREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT GetTagValRequest : public RpcServiceRequest + { + + public: + GetTagValRequest(); + ~GetTagValRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + long getEndTime()const; + void setEndTime(long endTime); + std::string getServiceName()const; + void setServiceName(const std::string& serviceName); + long getStartTime()const; + void setStartTime(long startTime); + std::string getTagKey()const; + void setTagKey(const std::string& tagKey); + std::string getSpanName()const; + void setSpanName(const std::string& spanName); + + private: + std::string regionId_; + long endTime_; + std::string serviceName_; + long startTime_; + std::string tagKey_; + std::string spanName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_GETTAGVALREQUEST_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/GetTagValResult.h b/xtrace/include/alibabacloud/xtrace/model/GetTagValResult.h new file mode 100644 index 000000000..503be2892 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/GetTagValResult.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_XTRACE_MODEL_GETTAGVALRESULT_H_ +#define ALIBABACLOUD_XTRACE_MODEL_GETTAGVALRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT GetTagValResult : public ServiceResult + { + public: + + + GetTagValResult(); + explicit GetTagValResult(const std::string &payload); + ~GetTagValResult(); + std::vector getTagValues()const; + + protected: + void parse(const std::string &payload); + private: + std::vector tagValues_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_GETTAGVALRESULT_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/GetTokenRequest.h b/xtrace/include/alibabacloud/xtrace/model/GetTokenRequest.h new file mode 100644 index 000000000..8c15182e4 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/GetTokenRequest.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_XTRACE_MODEL_GETTOKENREQUEST_H_ +#define ALIBABACLOUD_XTRACE_MODEL_GETTOKENREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT GetTokenRequest : public RpcServiceRequest + { + + public: + GetTokenRequest(); + ~GetTokenRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getAppType()const; + void setAppType(const std::string& appType); + + private: + std::string regionId_; + std::string appType_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_GETTOKENREQUEST_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/GetTokenResult.h b/xtrace/include/alibabacloud/xtrace/model/GetTokenResult.h new file mode 100644 index 000000000..aed36630f --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/GetTokenResult.h @@ -0,0 +1,58 @@ +/* + * 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_XTRACE_MODEL_GETTOKENRESULT_H_ +#define ALIBABACLOUD_XTRACE_MODEL_GETTOKENRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT GetTokenResult : public ServiceResult + { + public: + struct Token + { + std::string pid; + std::string domain; + std::string internalDomain; + std::string licenseKey; + }; + + + GetTokenResult(); + explicit GetTokenResult(const std::string &payload); + ~GetTokenResult(); + Token getToken()const; + + protected: + void parse(const std::string &payload); + private: + Token token_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_GETTOKENRESULT_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/GetTraceRequest.h b/xtrace/include/alibabacloud/xtrace/model/GetTraceRequest.h new file mode 100644 index 000000000..445436846 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/GetTraceRequest.h @@ -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_XTRACE_MODEL_GETTRACEREQUEST_H_ +#define ALIBABACLOUD_XTRACE_MODEL_GETTRACEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT GetTraceRequest : public RpcServiceRequest + { + + public: + GetTraceRequest(); + ~GetTraceRequest(); + + std::string getTraceID()const; + void setTraceID(const std::string& traceID); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getAppType()const; + void setAppType(const std::string& appType); + + private: + std::string traceID_; + std::string regionId_; + std::string appType_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_GETTRACEREQUEST_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/GetTraceResult.h b/xtrace/include/alibabacloud/xtrace/model/GetTraceResult.h new file mode 100644 index 000000000..8cdb24bc6 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/GetTraceResult.h @@ -0,0 +1,80 @@ +/* + * 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_XTRACE_MODEL_GETTRACERESULT_H_ +#define ALIBABACLOUD_XTRACE_MODEL_GETTRACERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT GetTraceResult : public ServiceResult + { + public: + struct Span + { + struct TagEntry + { + std::string value; + std::string key; + }; + struct LogEvent + { + struct TagEntry2 + { + std::string value; + std::string key; + }; + std::vector tagEntryList1; + long timestamp; + }; + bool haveStack; + std::string serviceIp; + std::vector logEventList; + std::string operationName; + std::string serviceName; + std::string rpcId; + std::string traceID; + long duration; + std::vector tagEntryList; + long timestamp; + std::string resultCode; + }; + + + GetTraceResult(); + explicit GetTraceResult(const std::string &payload); + ~GetTraceResult(); + std::vector getSpans()const; + + protected: + void parse(const std::string &payload); + private: + std::vector spans_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_GETTRACERESULT_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/ListIpOrHostsRequest.h b/xtrace/include/alibabacloud/xtrace/model/ListIpOrHostsRequest.h new file mode 100644 index 000000000..0a35fc427 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/ListIpOrHostsRequest.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_XTRACE_MODEL_LISTIPORHOSTSREQUEST_H_ +#define ALIBABACLOUD_XTRACE_MODEL_LISTIPORHOSTSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT ListIpOrHostsRequest : public RpcServiceRequest + { + + public: + ListIpOrHostsRequest(); + ~ListIpOrHostsRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + long getEndTime()const; + void setEndTime(long endTime); + std::string getServiceName()const; + void setServiceName(const std::string& serviceName); + long getStartTime()const; + void setStartTime(long startTime); + + private: + std::string regionId_; + long endTime_; + std::string serviceName_; + long startTime_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_LISTIPORHOSTSREQUEST_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/ListIpOrHostsResult.h b/xtrace/include/alibabacloud/xtrace/model/ListIpOrHostsResult.h new file mode 100644 index 000000000..fc5e24806 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/ListIpOrHostsResult.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_XTRACE_MODEL_LISTIPORHOSTSRESULT_H_ +#define ALIBABACLOUD_XTRACE_MODEL_LISTIPORHOSTSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT ListIpOrHostsResult : public ServiceResult + { + public: + + + ListIpOrHostsResult(); + explicit ListIpOrHostsResult(const std::string &payload); + ~ListIpOrHostsResult(); + std::vector getIpNames()const; + + protected: + void parse(const std::string &payload); + private: + std::vector ipNames_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_LISTIPORHOSTSRESULT_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/ListServicesRequest.h b/xtrace/include/alibabacloud/xtrace/model/ListServicesRequest.h new file mode 100644 index 000000000..ad62aad56 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/ListServicesRequest.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_XTRACE_MODEL_LISTSERVICESREQUEST_H_ +#define ALIBABACLOUD_XTRACE_MODEL_LISTSERVICESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT ListServicesRequest : public RpcServiceRequest + { + + public: + ListServicesRequest(); + ~ListServicesRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getAppType()const; + void setAppType(const std::string& appType); + + private: + std::string regionId_; + std::string appType_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_LISTSERVICESREQUEST_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/ListServicesResult.h b/xtrace/include/alibabacloud/xtrace/model/ListServicesResult.h new file mode 100644 index 000000000..89f8ddf83 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/ListServicesResult.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_XTRACE_MODEL_LISTSERVICESRESULT_H_ +#define ALIBABACLOUD_XTRACE_MODEL_LISTSERVICESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT ListServicesResult : public ServiceResult + { + public: + struct Service + { + std::string serviceName; + std::string pid; + std::string regionId; + }; + + + ListServicesResult(); + explicit ListServicesResult(const std::string &payload); + ~ListServicesResult(); + std::vector getServices()const; + + protected: + void parse(const std::string &payload); + private: + std::vector services_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_LISTSERVICESRESULT_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/ListSpanNamesRequest.h b/xtrace/include/alibabacloud/xtrace/model/ListSpanNamesRequest.h new file mode 100644 index 000000000..04e5c3771 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/ListSpanNamesRequest.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_XTRACE_MODEL_LISTSPANNAMESREQUEST_H_ +#define ALIBABACLOUD_XTRACE_MODEL_LISTSPANNAMESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT ListSpanNamesRequest : public RpcServiceRequest + { + + public: + ListSpanNamesRequest(); + ~ListSpanNamesRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + long getEndTime()const; + void setEndTime(long endTime); + std::string getServiceName()const; + void setServiceName(const std::string& serviceName); + long getStartTime()const; + void setStartTime(long startTime); + + private: + std::string regionId_; + long endTime_; + std::string serviceName_; + long startTime_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_LISTSPANNAMESREQUEST_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/ListSpanNamesResult.h b/xtrace/include/alibabacloud/xtrace/model/ListSpanNamesResult.h new file mode 100644 index 000000000..ff9277852 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/ListSpanNamesResult.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_XTRACE_MODEL_LISTSPANNAMESRESULT_H_ +#define ALIBABACLOUD_XTRACE_MODEL_LISTSPANNAMESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT ListSpanNamesResult : public ServiceResult + { + public: + + + ListSpanNamesResult(); + explicit ListSpanNamesResult(const std::string &payload); + ~ListSpanNamesResult(); + std::vector getSpanNames()const; + + protected: + void parse(const std::string &payload); + private: + std::vector spanNames_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_LISTSPANNAMESRESULT_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/SearchTracesRequest.h b/xtrace/include/alibabacloud/xtrace/model/SearchTracesRequest.h new file mode 100644 index 000000000..768d4324f --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/SearchTracesRequest.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_XTRACE_MODEL_SEARCHTRACESREQUEST_H_ +#define ALIBABACLOUD_XTRACE_MODEL_SEARCHTRACESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT SearchTracesRequest : public RpcServiceRequest + { + struct Tag + { + std::string value; + std::string key; + }; + + public: + SearchTracesRequest(); + ~SearchTracesRequest(); + + std::string getServiceIp()const; + void setServiceIp(const std::string& serviceIp); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getOperationName()const; + void setOperationName(const std::string& operationName); + std::string getAppType()const; + void setAppType(const std::string& appType); + int getPageSize()const; + void setPageSize(int pageSize); + long getEndTime()const; + void setEndTime(long endTime); + std::string getServiceName()const; + void setServiceName(const std::string& serviceName); + long getStartTime()const; + void setStartTime(long startTime); + std::vector getTag()const; + void setTag(const std::vector& tag); + bool getReverse()const; + void setReverse(bool reverse); + long getMinDuration()const; + void setMinDuration(long minDuration); + int getPageNumber()const; + void setPageNumber(int pageNumber); + + private: + std::string serviceIp_; + std::string regionId_; + std::string operationName_; + std::string appType_; + int pageSize_; + long endTime_; + std::string serviceName_; + long startTime_; + std::vector tag_; + bool reverse_; + long minDuration_; + int pageNumber_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_SEARCHTRACESREQUEST_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/SearchTracesResult.h b/xtrace/include/alibabacloud/xtrace/model/SearchTracesResult.h new file mode 100644 index 000000000..a29a9f1ff --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/SearchTracesResult.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_XTRACE_MODEL_SEARCHTRACESRESULT_H_ +#define ALIBABACLOUD_XTRACE_MODEL_SEARCHTRACESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT SearchTracesResult : public ServiceResult + { + public: + struct PageBean + { + struct TraceInfo + { + std::string serviceIp; + std::string operationName; + std::string serviceName; + std::string traceID; + long duration; + long timestamp; + }; + long totalCount; + int pageSize; + int pageNumber; + std::vector traceInfos; + }; + + + SearchTracesResult(); + explicit SearchTracesResult(const std::string &payload); + ~SearchTracesResult(); + PageBean getPageBean()const; + + protected: + void parse(const std::string &payload); + private: + PageBean pageBean_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_SEARCHTRACESRESULT_H_ \ No newline at end of file diff --git a/xtrace/src/model/GetTagKeyRequest.cc b/xtrace/src/model/GetTagKeyRequest.cc new file mode 100644 index 000000000..e6c912881 --- /dev/null +++ b/xtrace/src/model/GetTagKeyRequest.cc @@ -0,0 +1,82 @@ +/* + * 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 + +using AlibabaCloud::Xtrace::Model::GetTagKeyRequest; + +GetTagKeyRequest::GetTagKeyRequest() : + RpcServiceRequest("xtrace", "2019-08-08", "GetTagKey") +{} + +GetTagKeyRequest::~GetTagKeyRequest() +{} + +std::string GetTagKeyRequest::getRegionId()const +{ + return regionId_; +} + +void GetTagKeyRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +long GetTagKeyRequest::getEndTime()const +{ + return endTime_; +} + +void GetTagKeyRequest::setEndTime(long endTime) +{ + endTime_ = endTime; + setCoreParameter("EndTime", std::to_string(endTime)); +} + +std::string GetTagKeyRequest::getServiceName()const +{ + return serviceName_; +} + +void GetTagKeyRequest::setServiceName(const std::string& serviceName) +{ + serviceName_ = serviceName; + setCoreParameter("ServiceName", serviceName); +} + +long GetTagKeyRequest::getStartTime()const +{ + return startTime_; +} + +void GetTagKeyRequest::setStartTime(long startTime) +{ + startTime_ = startTime; + setCoreParameter("StartTime", std::to_string(startTime)); +} + +std::string GetTagKeyRequest::getSpanName()const +{ + return spanName_; +} + +void GetTagKeyRequest::setSpanName(const std::string& spanName) +{ + spanName_ = spanName; + setCoreParameter("SpanName", spanName); +} + diff --git a/xtrace/src/model/GetTagKeyResult.cc b/xtrace/src/model/GetTagKeyResult.cc new file mode 100644 index 000000000..53b2bcacf --- /dev/null +++ b/xtrace/src/model/GetTagKeyResult.cc @@ -0,0 +1,56 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Xtrace; +using namespace AlibabaCloud::Xtrace::Model; + +GetTagKeyResult::GetTagKeyResult() : + ServiceResult() +{} + +GetTagKeyResult::GetTagKeyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetTagKeyResult::~GetTagKeyResult() +{} + +void GetTagKeyResult::parse(const std::string &payload) +{ + Json::CharReaderBuilder builder; + Json::CharReader *reader = builder.newCharReader(); + Json::Value *val; + Json::Value value; + JSONCPP_STRING *errs; + reader->parse(payload.data(), payload.data() + payload.size(), val, errs); + value = *val; + setRequestId(value["RequestId"].asString()); + auto allTagKeys = value["TagKeys"]["TagKey"]; + for (const auto &item : allTagKeys) + tagKeys_.push_back(item.asString()); + +} + +std::vector GetTagKeyResult::getTagKeys()const +{ + return tagKeys_; +} + diff --git a/xtrace/src/model/GetTagValRequest.cc b/xtrace/src/model/GetTagValRequest.cc new file mode 100644 index 000000000..35b490b45 --- /dev/null +++ b/xtrace/src/model/GetTagValRequest.cc @@ -0,0 +1,93 @@ +/* + * 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 + +using AlibabaCloud::Xtrace::Model::GetTagValRequest; + +GetTagValRequest::GetTagValRequest() : + RpcServiceRequest("xtrace", "2019-08-08", "GetTagVal") +{} + +GetTagValRequest::~GetTagValRequest() +{} + +std::string GetTagValRequest::getRegionId()const +{ + return regionId_; +} + +void GetTagValRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +long GetTagValRequest::getEndTime()const +{ + return endTime_; +} + +void GetTagValRequest::setEndTime(long endTime) +{ + endTime_ = endTime; + setCoreParameter("EndTime", std::to_string(endTime)); +} + +std::string GetTagValRequest::getServiceName()const +{ + return serviceName_; +} + +void GetTagValRequest::setServiceName(const std::string& serviceName) +{ + serviceName_ = serviceName; + setCoreParameter("ServiceName", serviceName); +} + +long GetTagValRequest::getStartTime()const +{ + return startTime_; +} + +void GetTagValRequest::setStartTime(long startTime) +{ + startTime_ = startTime; + setCoreParameter("StartTime", std::to_string(startTime)); +} + +std::string GetTagValRequest::getTagKey()const +{ + return tagKey_; +} + +void GetTagValRequest::setTagKey(const std::string& tagKey) +{ + tagKey_ = tagKey; + setCoreParameter("TagKey", tagKey); +} + +std::string GetTagValRequest::getSpanName()const +{ + return spanName_; +} + +void GetTagValRequest::setSpanName(const std::string& spanName) +{ + spanName_ = spanName; + setCoreParameter("SpanName", spanName); +} + diff --git a/xtrace/src/model/GetTagValResult.cc b/xtrace/src/model/GetTagValResult.cc new file mode 100644 index 000000000..35c64ca3c --- /dev/null +++ b/xtrace/src/model/GetTagValResult.cc @@ -0,0 +1,56 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Xtrace; +using namespace AlibabaCloud::Xtrace::Model; + +GetTagValResult::GetTagValResult() : + ServiceResult() +{} + +GetTagValResult::GetTagValResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetTagValResult::~GetTagValResult() +{} + +void GetTagValResult::parse(const std::string &payload) +{ + Json::CharReaderBuilder builder; + Json::CharReader *reader = builder.newCharReader(); + Json::Value *val; + Json::Value value; + JSONCPP_STRING *errs; + reader->parse(payload.data(), payload.data() + payload.size(), val, errs); + value = *val; + setRequestId(value["RequestId"].asString()); + auto allTagValues = value["TagValues"]["TagValue"]; + for (const auto &item : allTagValues) + tagValues_.push_back(item.asString()); + +} + +std::vector GetTagValResult::getTagValues()const +{ + return tagValues_; +} + diff --git a/xtrace/src/model/GetTokenRequest.cc b/xtrace/src/model/GetTokenRequest.cc new file mode 100644 index 000000000..f56331bec --- /dev/null +++ b/xtrace/src/model/GetTokenRequest.cc @@ -0,0 +1,49 @@ +/* + * 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 + +using AlibabaCloud::Xtrace::Model::GetTokenRequest; + +GetTokenRequest::GetTokenRequest() : + RpcServiceRequest("xtrace", "2019-08-08", "GetToken") +{} + +GetTokenRequest::~GetTokenRequest() +{} + +std::string GetTokenRequest::getRegionId()const +{ + return regionId_; +} + +void GetTokenRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +std::string GetTokenRequest::getAppType()const +{ + return appType_; +} + +void GetTokenRequest::setAppType(const std::string& appType) +{ + appType_ = appType; + setCoreParameter("AppType", appType); +} + diff --git a/xtrace/src/model/GetTokenResult.cc b/xtrace/src/model/GetTokenResult.cc new file mode 100644 index 000000000..c7c7fab13 --- /dev/null +++ b/xtrace/src/model/GetTokenResult.cc @@ -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 +#include + +using namespace AlibabaCloud::Xtrace; +using namespace AlibabaCloud::Xtrace::Model; + +GetTokenResult::GetTokenResult() : + ServiceResult() +{} + +GetTokenResult::GetTokenResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetTokenResult::~GetTokenResult() +{} + +void GetTokenResult::parse(const std::string &payload) +{ + Json::CharReaderBuilder builder; + Json::CharReader *reader = builder.newCharReader(); + Json::Value *val; + Json::Value value; + JSONCPP_STRING *errs; + reader->parse(payload.data(), payload.data() + payload.size(), val, errs); + value = *val; + setRequestId(value["RequestId"].asString()); + auto tokenNode = value["Token"]; + if(!tokenNode["Domain"].isNull()) + token_.domain = tokenNode["Domain"].asString(); + if(!tokenNode["LicenseKey"].isNull()) + token_.licenseKey = tokenNode["LicenseKey"].asString(); + if(!tokenNode["Pid"].isNull()) + token_.pid = tokenNode["Pid"].asString(); + if(!tokenNode["InternalDomain"].isNull()) + token_.internalDomain = tokenNode["InternalDomain"].asString(); + +} + +GetTokenResult::Token GetTokenResult::getToken()const +{ + return token_; +} + diff --git a/xtrace/src/model/GetTraceRequest.cc b/xtrace/src/model/GetTraceRequest.cc new file mode 100644 index 000000000..62a0d77b4 --- /dev/null +++ b/xtrace/src/model/GetTraceRequest.cc @@ -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. + */ + +#include + +using AlibabaCloud::Xtrace::Model::GetTraceRequest; + +GetTraceRequest::GetTraceRequest() : + RpcServiceRequest("xtrace", "2019-08-08", "GetTrace") +{} + +GetTraceRequest::~GetTraceRequest() +{} + +std::string GetTraceRequest::getTraceID()const +{ + return traceID_; +} + +void GetTraceRequest::setTraceID(const std::string& traceID) +{ + traceID_ = traceID; + setCoreParameter("TraceID", traceID); +} + +std::string GetTraceRequest::getRegionId()const +{ + return regionId_; +} + +void GetTraceRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +std::string GetTraceRequest::getAppType()const +{ + return appType_; +} + +void GetTraceRequest::setAppType(const std::string& appType) +{ + appType_ = appType; + setCoreParameter("AppType", appType); +} + diff --git a/xtrace/src/model/GetTraceResult.cc b/xtrace/src/model/GetTraceResult.cc new file mode 100644 index 000000000..527848069 --- /dev/null +++ b/xtrace/src/model/GetTraceResult.cc @@ -0,0 +1,105 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Xtrace; +using namespace AlibabaCloud::Xtrace::Model; + +GetTraceResult::GetTraceResult() : + ServiceResult() +{} + +GetTraceResult::GetTraceResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetTraceResult::~GetTraceResult() +{} + +void GetTraceResult::parse(const std::string &payload) +{ + Json::CharReaderBuilder builder; + Json::CharReader *reader = builder.newCharReader(); + Json::Value *val; + Json::Value value; + JSONCPP_STRING *errs; + reader->parse(payload.data(), payload.data() + payload.size(), val, errs); + value = *val; + setRequestId(value["RequestId"].asString()); + auto allSpans = value["Spans"]["Span"]; + for (auto value : allSpans) + { + Span spansObject; + if(!value["TraceID"].isNull()) + spansObject.traceID = value["TraceID"].asString(); + if(!value["OperationName"].isNull()) + spansObject.operationName = value["OperationName"].asString(); + if(!value["Duration"].isNull()) + spansObject.duration = std::stol(value["Duration"].asString()); + if(!value["ServiceName"].isNull()) + spansObject.serviceName = value["ServiceName"].asString(); + if(!value["ServiceIp"].isNull()) + spansObject.serviceIp = value["ServiceIp"].asString(); + if(!value["Timestamp"].isNull()) + spansObject.timestamp = std::stol(value["Timestamp"].asString()); + if(!value["RpcId"].isNull()) + spansObject.rpcId = value["RpcId"].asString(); + if(!value["ResultCode"].isNull()) + spansObject.resultCode = value["ResultCode"].asString(); + if(!value["HaveStack"].isNull()) + spansObject.haveStack = value["HaveStack"].asString() == "true"; + auto allTagEntryList = value["TagEntryList"]["TagEntry"]; + for (auto value : allTagEntryList) + { + Span::TagEntry tagEntryListObject; + if(!value["Key"].isNull()) + tagEntryListObject.key = value["Key"].asString(); + if(!value["Value"].isNull()) + tagEntryListObject.value = value["Value"].asString(); + spansObject.tagEntryList.push_back(tagEntryListObject); + } + auto allLogEventList = value["LogEventList"]["LogEvent"]; + for (auto value : allLogEventList) + { + Span::LogEvent logEventListObject; + if(!value["Timestamp"].isNull()) + logEventListObject.timestamp = std::stol(value["Timestamp"].asString()); + auto allTagEntryList1 = value["TagEntryList"]["TagEntry"]; + for (auto value : allTagEntryList1) + { + Span::LogEvent::TagEntry2 tagEntryList1Object; + if(!value["Key"].isNull()) + tagEntryList1Object.key = value["Key"].asString(); + if(!value["Value"].isNull()) + tagEntryList1Object.value = value["Value"].asString(); + logEventListObject.tagEntryList1.push_back(tagEntryList1Object); + } + spansObject.logEventList.push_back(logEventListObject); + } + spans_.push_back(spansObject); + } + +} + +std::vector GetTraceResult::getSpans()const +{ + return spans_; +} + diff --git a/xtrace/src/model/ListIpOrHostsRequest.cc b/xtrace/src/model/ListIpOrHostsRequest.cc new file mode 100644 index 000000000..42e8ee99b --- /dev/null +++ b/xtrace/src/model/ListIpOrHostsRequest.cc @@ -0,0 +1,71 @@ +/* + * 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 + +using AlibabaCloud::Xtrace::Model::ListIpOrHostsRequest; + +ListIpOrHostsRequest::ListIpOrHostsRequest() : + RpcServiceRequest("xtrace", "2019-08-08", "ListIpOrHosts") +{} + +ListIpOrHostsRequest::~ListIpOrHostsRequest() +{} + +std::string ListIpOrHostsRequest::getRegionId()const +{ + return regionId_; +} + +void ListIpOrHostsRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +long ListIpOrHostsRequest::getEndTime()const +{ + return endTime_; +} + +void ListIpOrHostsRequest::setEndTime(long endTime) +{ + endTime_ = endTime; + setCoreParameter("EndTime", std::to_string(endTime)); +} + +std::string ListIpOrHostsRequest::getServiceName()const +{ + return serviceName_; +} + +void ListIpOrHostsRequest::setServiceName(const std::string& serviceName) +{ + serviceName_ = serviceName; + setCoreParameter("ServiceName", serviceName); +} + +long ListIpOrHostsRequest::getStartTime()const +{ + return startTime_; +} + +void ListIpOrHostsRequest::setStartTime(long startTime) +{ + startTime_ = startTime; + setCoreParameter("StartTime", std::to_string(startTime)); +} + diff --git a/xtrace/src/model/ListIpOrHostsResult.cc b/xtrace/src/model/ListIpOrHostsResult.cc new file mode 100644 index 000000000..3b7ab58f9 --- /dev/null +++ b/xtrace/src/model/ListIpOrHostsResult.cc @@ -0,0 +1,56 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Xtrace; +using namespace AlibabaCloud::Xtrace::Model; + +ListIpOrHostsResult::ListIpOrHostsResult() : + ServiceResult() +{} + +ListIpOrHostsResult::ListIpOrHostsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListIpOrHostsResult::~ListIpOrHostsResult() +{} + +void ListIpOrHostsResult::parse(const std::string &payload) +{ + Json::CharReaderBuilder builder; + Json::CharReader *reader = builder.newCharReader(); + Json::Value *val; + Json::Value value; + JSONCPP_STRING *errs; + reader->parse(payload.data(), payload.data() + payload.size(), val, errs); + value = *val; + setRequestId(value["RequestId"].asString()); + auto allIpNames = value["IpNames"]["IpName"]; + for (const auto &item : allIpNames) + ipNames_.push_back(item.asString()); + +} + +std::vector ListIpOrHostsResult::getIpNames()const +{ + return ipNames_; +} + diff --git a/xtrace/src/model/ListServicesRequest.cc b/xtrace/src/model/ListServicesRequest.cc new file mode 100644 index 000000000..43f15e754 --- /dev/null +++ b/xtrace/src/model/ListServicesRequest.cc @@ -0,0 +1,49 @@ +/* + * 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 + +using AlibabaCloud::Xtrace::Model::ListServicesRequest; + +ListServicesRequest::ListServicesRequest() : + RpcServiceRequest("xtrace", "2019-08-08", "ListServices") +{} + +ListServicesRequest::~ListServicesRequest() +{} + +std::string ListServicesRequest::getRegionId()const +{ + return regionId_; +} + +void ListServicesRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +std::string ListServicesRequest::getAppType()const +{ + return appType_; +} + +void ListServicesRequest::setAppType(const std::string& appType) +{ + appType_ = appType; + setCoreParameter("AppType", appType); +} + diff --git a/xtrace/src/model/ListServicesResult.cc b/xtrace/src/model/ListServicesResult.cc new file mode 100644 index 000000000..231ab1477 --- /dev/null +++ b/xtrace/src/model/ListServicesResult.cc @@ -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 +#include + +using namespace AlibabaCloud::Xtrace; +using namespace AlibabaCloud::Xtrace::Model; + +ListServicesResult::ListServicesResult() : + ServiceResult() +{} + +ListServicesResult::ListServicesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListServicesResult::~ListServicesResult() +{} + +void ListServicesResult::parse(const std::string &payload) +{ + Json::CharReaderBuilder builder; + Json::CharReader *reader = builder.newCharReader(); + Json::Value *val; + Json::Value value; + JSONCPP_STRING *errs; + reader->parse(payload.data(), payload.data() + payload.size(), val, errs); + value = *val; + setRequestId(value["RequestId"].asString()); + auto allServices = value["Services"]["Service"]; + for (auto value : allServices) + { + Service servicesObject; + if(!value["ServiceName"].isNull()) + servicesObject.serviceName = value["ServiceName"].asString(); + if(!value["Pid"].isNull()) + servicesObject.pid = value["Pid"].asString(); + if(!value["RegionId"].isNull()) + servicesObject.regionId = value["RegionId"].asString(); + services_.push_back(servicesObject); + } + +} + +std::vector ListServicesResult::getServices()const +{ + return services_; +} + diff --git a/xtrace/src/model/ListSpanNamesRequest.cc b/xtrace/src/model/ListSpanNamesRequest.cc new file mode 100644 index 000000000..3177a54f3 --- /dev/null +++ b/xtrace/src/model/ListSpanNamesRequest.cc @@ -0,0 +1,71 @@ +/* + * 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 + +using AlibabaCloud::Xtrace::Model::ListSpanNamesRequest; + +ListSpanNamesRequest::ListSpanNamesRequest() : + RpcServiceRequest("xtrace", "2019-08-08", "ListSpanNames") +{} + +ListSpanNamesRequest::~ListSpanNamesRequest() +{} + +std::string ListSpanNamesRequest::getRegionId()const +{ + return regionId_; +} + +void ListSpanNamesRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +long ListSpanNamesRequest::getEndTime()const +{ + return endTime_; +} + +void ListSpanNamesRequest::setEndTime(long endTime) +{ + endTime_ = endTime; + setCoreParameter("EndTime", std::to_string(endTime)); +} + +std::string ListSpanNamesRequest::getServiceName()const +{ + return serviceName_; +} + +void ListSpanNamesRequest::setServiceName(const std::string& serviceName) +{ + serviceName_ = serviceName; + setCoreParameter("ServiceName", serviceName); +} + +long ListSpanNamesRequest::getStartTime()const +{ + return startTime_; +} + +void ListSpanNamesRequest::setStartTime(long startTime) +{ + startTime_ = startTime; + setCoreParameter("StartTime", std::to_string(startTime)); +} + diff --git a/xtrace/src/model/ListSpanNamesResult.cc b/xtrace/src/model/ListSpanNamesResult.cc new file mode 100644 index 000000000..c4ead5202 --- /dev/null +++ b/xtrace/src/model/ListSpanNamesResult.cc @@ -0,0 +1,56 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Xtrace; +using namespace AlibabaCloud::Xtrace::Model; + +ListSpanNamesResult::ListSpanNamesResult() : + ServiceResult() +{} + +ListSpanNamesResult::ListSpanNamesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListSpanNamesResult::~ListSpanNamesResult() +{} + +void ListSpanNamesResult::parse(const std::string &payload) +{ + Json::CharReaderBuilder builder; + Json::CharReader *reader = builder.newCharReader(); + Json::Value *val; + Json::Value value; + JSONCPP_STRING *errs; + reader->parse(payload.data(), payload.data() + payload.size(), val, errs); + value = *val; + setRequestId(value["RequestId"].asString()); + auto allSpanNames = value["SpanNames"]["SpanName"]; + for (const auto &item : allSpanNames) + spanNames_.push_back(item.asString()); + +} + +std::vector ListSpanNamesResult::getSpanNames()const +{ + return spanNames_; +} + diff --git a/xtrace/src/model/SearchTracesRequest.cc b/xtrace/src/model/SearchTracesRequest.cc new file mode 100644 index 000000000..1d8e49283 --- /dev/null +++ b/xtrace/src/model/SearchTracesRequest.cc @@ -0,0 +1,165 @@ +/* + * 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 + +using AlibabaCloud::Xtrace::Model::SearchTracesRequest; + +SearchTracesRequest::SearchTracesRequest() : + RpcServiceRequest("xtrace", "2019-08-08", "SearchTraces") +{} + +SearchTracesRequest::~SearchTracesRequest() +{} + +std::string SearchTracesRequest::getServiceIp()const +{ + return serviceIp_; +} + +void SearchTracesRequest::setServiceIp(const std::string& serviceIp) +{ + serviceIp_ = serviceIp; + setCoreParameter("ServiceIp", serviceIp); +} + +std::string SearchTracesRequest::getRegionId()const +{ + return regionId_; +} + +void SearchTracesRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +std::string SearchTracesRequest::getOperationName()const +{ + return operationName_; +} + +void SearchTracesRequest::setOperationName(const std::string& operationName) +{ + operationName_ = operationName; + setCoreParameter("OperationName", operationName); +} + +std::string SearchTracesRequest::getAppType()const +{ + return appType_; +} + +void SearchTracesRequest::setAppType(const std::string& appType) +{ + appType_ = appType; + setCoreParameter("AppType", appType); +} + +int SearchTracesRequest::getPageSize()const +{ + return pageSize_; +} + +void SearchTracesRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setCoreParameter("PageSize", std::to_string(pageSize)); +} + +long SearchTracesRequest::getEndTime()const +{ + return endTime_; +} + +void SearchTracesRequest::setEndTime(long endTime) +{ + endTime_ = endTime; + setCoreParameter("EndTime", std::to_string(endTime)); +} + +std::string SearchTracesRequest::getServiceName()const +{ + return serviceName_; +} + +void SearchTracesRequest::setServiceName(const std::string& serviceName) +{ + serviceName_ = serviceName; + setCoreParameter("ServiceName", serviceName); +} + +long SearchTracesRequest::getStartTime()const +{ + return startTime_; +} + +void SearchTracesRequest::setStartTime(long startTime) +{ + startTime_ = startTime; + setCoreParameter("StartTime", std::to_string(startTime)); +} + +std::vector SearchTracesRequest::getTag()const +{ + return tag_; +} + +void SearchTracesRequest::setTag(const std::vector& tag) +{ + tag_ = tag; + int i = 0; + for(int i = 0; i!= tag.size(); i++) { + auto obj = tag.at(i); + std::string str ="Tag."+ std::to_string(i); + setCoreParameter(str + ".Value", obj.value); + setCoreParameter(str + ".Key", obj.key); + } +} + +bool SearchTracesRequest::getReverse()const +{ + return reverse_; +} + +void SearchTracesRequest::setReverse(bool reverse) +{ + reverse_ = reverse; + setCoreParameter("Reverse", reverse ? "true" : "false"); +} + +long SearchTracesRequest::getMinDuration()const +{ + return minDuration_; +} + +void SearchTracesRequest::setMinDuration(long minDuration) +{ + minDuration_ = minDuration; + setCoreParameter("MinDuration", std::to_string(minDuration)); +} + +int SearchTracesRequest::getPageNumber()const +{ + return pageNumber_; +} + +void SearchTracesRequest::setPageNumber(int pageNumber) +{ + pageNumber_ = pageNumber; + setCoreParameter("PageNumber", std::to_string(pageNumber)); +} + diff --git a/xtrace/src/model/SearchTracesResult.cc b/xtrace/src/model/SearchTracesResult.cc new file mode 100644 index 000000000..a7d623a2d --- /dev/null +++ b/xtrace/src/model/SearchTracesResult.cc @@ -0,0 +1,78 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Xtrace; +using namespace AlibabaCloud::Xtrace::Model; + +SearchTracesResult::SearchTracesResult() : + ServiceResult() +{} + +SearchTracesResult::SearchTracesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +SearchTracesResult::~SearchTracesResult() +{} + +void SearchTracesResult::parse(const std::string &payload) +{ + Json::CharReaderBuilder builder; + Json::CharReader *reader = builder.newCharReader(); + Json::Value *val; + Json::Value value; + JSONCPP_STRING *errs; + reader->parse(payload.data(), payload.data() + payload.size(), val, errs); + value = *val; + setRequestId(value["RequestId"].asString()); + auto pageBeanNode = value["PageBean"]; + if(!pageBeanNode["TotalCount"].isNull()) + pageBean_.totalCount = std::stol(pageBeanNode["TotalCount"].asString()); + if(!pageBeanNode["PageSize"].isNull()) + pageBean_.pageSize = std::stoi(pageBeanNode["PageSize"].asString()); + if(!pageBeanNode["PageNumber"].isNull()) + pageBean_.pageNumber = std::stoi(pageBeanNode["PageNumber"].asString()); + auto allTraceInfos = value["TraceInfos"]["TraceInfo"]; + for (auto value : allTraceInfos) + { + PageBean::TraceInfo traceInfoObject; + if(!value["TraceID"].isNull()) + traceInfoObject.traceID = value["TraceID"].asString(); + if(!value["OperationName"].isNull()) + traceInfoObject.operationName = value["OperationName"].asString(); + if(!value["ServiceName"].isNull()) + traceInfoObject.serviceName = value["ServiceName"].asString(); + if(!value["ServiceIp"].isNull()) + traceInfoObject.serviceIp = value["ServiceIp"].asString(); + if(!value["Duration"].isNull()) + traceInfoObject.duration = std::stol(value["Duration"].asString()); + if(!value["Timestamp"].isNull()) + traceInfoObject.timestamp = std::stol(value["Timestamp"].asString()); + pageBean_.traceInfos.push_back(traceInfoObject); + } + +} + +SearchTracesResult::PageBean SearchTracesResult::getPageBean()const +{ + return pageBean_; +} +