123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401 |
- /*##############################################################################
- HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
- 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 "xslprocessor.hpp"
- SCMenum ThresholdType
- {
- THRESHOLD_PERCENTAGE,
- THRESHOLD_MB
- };
- ESPrequest GetMachineInfoRequest
- {
- ESParray<string> Addresses;
- [hidden] string SortBy;
- TpMachineType ClusterType;
- string Cluster;
- string OldIP;
- string Path;
- string AddProcessesToFilter;
- bool ApplyProcessFilter;
- bool GetProcessorInfo;
- bool GetStorageInfo;
- [min_ver("1.11")] bool LocalFileSystemsOnly;
- bool GetSoftwareInfo;
- int MemThreshold;
- int DiskThreshold;
- int CpuThreshold;
- int AutoRefresh;
- ThresholdType MemThresholdType;
- ThresholdType DiskThresholdType;
- string UserName;
- [password, cols(20)] string Password;
- [password, cols(20)] string SecurityString;
- };
- //--define a struct that mimics GetMachineInfoRequest so it can be
- //--echoed back in the response
- //
- ESPstruct RequestInfoStruct
- {
- ESParray<string> Addresses;
- [hidden] string SortBy;
- TpMachineType ClusterType;
- string Cluster;
- string OldIP; //used for swap node
- string Path;
- string AddProcessesToFilter;
- bool ApplyProcessFilter;
- bool GetProcessorInfo;
- bool GetStorageInfo;
- [min_ver("1.11")] bool LocalFileSystemsOnly;
- bool GetSoftwareInfo;
- int MemThreshold;
- int DiskThreshold;
- int CpuThreshold;
- int AutoRefresh;
- ThresholdType MemThresholdType;
- ThresholdType DiskThresholdType;
- [password, cols(20)] string SecurityString;
- [min_ver("1.02")] string UserName;
- [min_ver("1.02"), password, cols(20)] string Password;
- [min_ver("1.03")] bool EnableSNMP;
- };
- ESPstruct ProcessorInfo
- {
- string Type;
- int Load;
- };
- ESPstruct StorageInfo
- {
- string Description;
- string Type;
- int64 Available;
- int PercentAvail;
- int64 Total;
- int Failures;
- };
- ESPstruct SWRunInfo
- {
- string Name;
- int Instances;
- int State;
- };
- ESPstruct ProcessInfo
- {
- int PID;
- string Description;
- string Parameter;
- };
-
- ESPStruct [nil_remove] ComponentInfo
- {
- int Condition;
- int State;
- string UpTime;//component's uptime
- };
- ESPstruct MachineInfoEx
- {
- string Address;
- [min_ver("1.04")] string ConfigAddress;
- string Name;
- string ProcessType;
- string DisplayType;
- string Description;
- string AgentVersion;
- string Contact;
- string Location;
- string UpTime;
- string ComponentName;
- string ComponentPath;
- [min_ver("1.13")] string RoxieState;
- [min_ver("1.13")] string RoxieStateDetails;
- int OS;
- [min_ver("1.10")] int ProcessNumber;
- ESParray<ESPstruct ProcessorInfo> Processors;
- ESParray<ESPstruct StorageInfo> Storage;
- ESParray<ESPstruct SWRunInfo> Running;
- ESPstruct StorageInfo PhysicalMemory;
- ESPstruct StorageInfo VirtualMemory;
- ESPstruct ComponentInfo ComponentInfo;
- };
- ESPresponse [encode(0), exceptions_inline] GetMachineInfoResponse
- {
- ESPstruct RequestInfoStruct RequestInfo;
- ESParray<string> Columns;
- ESParray<ESPstruct MachineInfoEx> Machines;
- string TimeStamp;
- [min_ver("1.02")] string UserName;
- [min_ver("1.02"), password, cols(20)] string Password;
- [min_ver("1.12")] string AcceptLanguage;
- };
- ESPrequest GetMachineInfoRequestEx
- {
- ESParray<string> Addresses;
- TpMachineType ClusterType;
- };
- ESPresponse [encode(0), exceptions_inline] GetMachineInfoResponseEx
- {
- [min_ver("1.12")] string AcceptLanguage;
- ESParray<ESPstruct MachineInfoEx> Machines;
- };
- //-------- GetMetrics ---------
- //
- ESPrequest MetricsRequest
- {
- [password, cols(20)] string SecurityString;
- ESParray<string> Addresses;
- ESParray<string> ShowColumns;
- int AutoRefresh;
- bool SelectAllChecked(false);
- [min_ver("1.02")] string Cluster;
- [min_ver("1.07")] bool AutoUpdate(true);
- };
- ESPresponse [encode(0), exceptions_inline] MetricsResponse
- {
- string FieldInformation;
- string Metrics;
- int AutoRefresh;
- [min_ver("1.02")] string Cluster;
- [min_ver("1.06")] bool SelectAllChecked(false);
- [min_ver("1.07")] bool AutoUpdate(true);
- [min_ver("1.12")] string AcceptLanguage;
- };
- ESPstruct RemoteExecResult
- {
- TpMachineType ClusterType;
- [min_ver("1.01")] string AddressOrig;
- string Address;
- string Response;
- int ResultCode;
- };
- ESPrequest StartStopBeginRequest
- {
- ESParray<string> Addresses;
- string Key1;
- [password, cols(20)] string Key2;
- bool Stop;
- [min_ver("1.08")] int MemThreshold;
- [min_ver("1.08")] int DiskThreshold;
- [min_ver("1.08")] int CpuThreshold;
- [min_ver("1.08")] int AutoRefresh;
- [min_ver("1.08")] ThresholdType MemThresholdType;
- [min_ver("1.08")] ThresholdType DiskThresholdType;
- };
- ESPresponse [exceptions_inline] StartStopBeginResponse
- {
- string Addresses;
- string Key1;
- [password, cols(20)] string Key2;
- bool Stop;
- [min_ver("1.08")] int MemThreshold;
- [min_ver("1.08")] int DiskThreshold;
- [min_ver("1.08")] int CpuThreshold;
- [min_ver("1.08")] int AutoRefresh;
- [min_ver("1.08")] ThresholdType MemThresholdType;
- [min_ver("1.08")] ThresholdType DiskThresholdType;
- };
- ESPrequest StartStopDoneRequest
- {
- string Addresses;
- string Key1;
- [password, cols(20)] string Key2;
- bool Stop;
- [min_ver("1.08")] int MemThreshold;
- [min_ver("1.08")] int DiskThreshold;
- [min_ver("1.08")] int CpuThreshold;
- [min_ver("1.08")] int AutoRefresh;
- [min_ver("1.08")] ThresholdType MemThresholdType;
- [min_ver("1.08")] ThresholdType DiskThresholdType;
- };
- ESPrequest StartStopRequest
- {
- ESParray<string> Addresses;
- [min_ver("1.01")] string Key1;
- [min_ver("1.01"), password, cols(20)] string Key2;
- bool Stop;
- };
- ESPstruct StartStopResult
- {
- string AddressOrig;
- string Address;
- string CompType;
- [min_ver("1.05")] string Name;
- string Path;
- string Command;
- string Response;
- int ResultCode;
- int OS;
- };
- ESPresponse [encode(0), exceptions_inline] StartStopResponse
- {
- ESParray<ESPstruct StartStopResult> StartStopResults;
- bool Stop;
- [min_ver("1.09")] bool ContainCluster;
- [min_ver("1.08")] int MemThreshold;
- [min_ver("1.08")] int DiskThreshold;
- [min_ver("1.08")] int CpuThreshold;
- [min_ver("1.08")] int AutoRefresh;
- [min_ver("1.08")] ThresholdType MemThresholdType;
- [min_ver("1.08")] ThresholdType DiskThresholdType;
- };
- ESPrequest GetTargetClusterInfoRequest
- {
- ESParray<string> TargetClusters;
- string AddProcessesToFilter;
- bool ApplyProcessFilter;
- bool GetProcessorInfo;
- bool GetStorageInfo;
- [min_ver("1.11")] bool LocalFileSystemsOnly;
- bool GetSoftwareInfo;
- int MemThreshold;
- int DiskThreshold;
- int CpuThreshold;
- int AutoRefresh;
- ThresholdType MemThresholdType;
- ThresholdType DiskThresholdType;
- };
- ESPstruct TargetClusterInfo
- {
- string Name;
- string Type;
- ESParray<ESPstruct MachineInfoEx> Processes;
- };
- ESPresponse [encode(0), exceptions_inline] GetTargetClusterInfoResponse
- {
- ESParray<string> Columns;
- ESPstruct RequestInfoStruct RequestInfo;
- ESParray<ESPstruct TargetClusterInfo> TargetClusterInfoList;
- string TimeStamp;
- [min_ver("1.12")] string AcceptLanguage;
- };
- ESPstruct [nil_remove] StatusReport
- {
- int StatusID;
- string Status;
- string StatusDetails;
- string Reporter;
- int64 TimeReported;
- string TimeReportedStr;
- string TimeCached;
- string URL;
- };
- ESPstruct [nil_remove] ComponentStatus
- {
- int ComponentTypeID;
- string ComponentType;
- string EndPoint;
- int StatusID;
- string Status;
- int64 TimeReported;
- string TimeReportedStr;
- string Reporter;
- ESParray<ESPstruct StatusReport> StatusReports;
- };
- ESPrequest [nil_remove] GetComponentStatusRequest
- {
- };
- ESPresponse [encode(0), nil_remove, exceptions_inline] GetComponentStatusResponse
- {
- int StatusCode;
- string Status;
- string ComponentType;
- string EndPoint;
- int ComponentStatusID;
- string ComponentStatus;
- int64 TimeReported;
- string TimeReportedStr;
- string Reporter;
- ESPstruct StatusReport StatusReport;
- ESParray<ESPstruct ComponentStatus, ComponentStatus> ComponentStatusList;
- };
- ESPrequest [nil_remove] UpdateComponentStatusRequest
- {
- string Reporter;
- ESParray<ESPstruct ComponentStatus, ComponentStatus> ComponentStatusList;
- };
- ESPresponse [encode(0), nil_remove, exceptions_inline] UpdateComponentStatusResponse
- {
- int StatusCode;
- string Status;
- };
- //-------- service ---------
- ESPservice [auth_feature("DEFERRED"), version("1.13")] ws_machine
- {
- ESPuses ESPstruct RequestInfoStruct;
- ESPuses ESPstruct MachineInfoEx;
- ESPuses ESPstruct ProcessorInfo;
- ESPuses ESPstruct StorageInfo;
- ESPuses ESPstruct SWRunInfo;
- ESPuses ESPstruct RemoteExecResult;
- ESPuses ESPStruct ComponentInfo;
- ESPmethod [resp_xsl_default("./smc_xslt/clusterprocesses.xslt"), exceptions_inline("./smc_xslt/exceptions.xslt")]
- GetTargetClusterInfo(GetTargetClusterInfoRequest, GetTargetClusterInfoResponse);
- ESPmethod [resp_xsl_default("./smc_xslt/ws_machine/machines.xslt"), exceptions_inline("./smc_xslt/exceptions.xslt")]
- GetMachineInfo(GetMachineInfoRequest, GetMachineInfoResponse);
- ESPmethod [resp_xsl_default("./smc_xslt/ws_machine/machines.xslt"), exceptions_inline("./smc_xslt/exceptions.xslt")]
- GetMachineInfoEx(GetMachineInfoRequestEx, GetMachineInfoResponseEx);
- ESPmethod GetComponentStatus(GetComponentStatusRequest, GetComponentStatusResponse);
- ESPmethod UpdateComponentStatus(UpdateComponentStatusRequest, UpdateComponentStatusResponse);
- ESPmethod [resp_xsl_default("./smc_xslt/ws_machine/metrics.xslt"), exceptions_inline("./smc_xslt/exceptions.xslt")]
- GetMetrics(MetricsRequest, MetricsResponse);
- };
- SCMexportdef(ws_machine);
- SCMapi(ws_machine) IClientws_machine *createws_machineClient();
|