Zhao, Qingwen created EAGLE-1046: ------------------------------------ Summary: Eagle supports policies import to a new site from a policy prototype Key: EAGLE-1046 URL: https://issues.apache.org/jira/browse/EAGLE-1046 Project: Eagle Issue Type: New Feature Affects Versions: v0.6.0 Reporter: Zhao, Qingwen Assignee: Jilin, Jiang
1. load policies to new site `sandbox` POST /rest/policyProto/loadToSite/sandbox {code} [ { "policyProto": { "name": "JobRpcThroughput", "description": "Policy for MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "inputStreams": [ "MAP_REDUCE_JOB_STREAM" ], "outputStreams": [ "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT" ], "siteId": null, "definition": { "type": "siddhi", "value": "from MAP_REDUCE_JOB_STREAM[mapOpsPerSecond > 1000 or reduceOpsPerSecond > 1000 or avgOpsPerMapTask > 50 or avgOpsPerReduceTask > 50] select * insert into MAP_REDUCE_JOB_STREAM_RPC_THROUGHPUT_OUT;", "handlerClass": null, "properties": {}, "inputStreams": [], "outputStreams": [] }, "stateDefinition": null, "policyStatus": "DISABLED", "alertDefinition": { "templateType": "TEXT", "subject": "$site job rpc", "body": "$site job rpc throughput", "severity": "WARNING", "category": "JPM" }, "alertDeduplications": [ { "outputStreamId": "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "dedupIntervalMin": "0", "dedupFields": [] } ], "partitionSpec": [ { "streamId": "MAP_REDUCE_JOB_STREAM_SANDBOX", "type": "SHUFFLE", "columns": [], "sortSpec": null } ], "dedicated": false, "parallelismHint": 5, "alertSeverity": "WARNING", "alertCategory": "JPM" }, "alertPublishmentIds": [] } ] {code} 2. save a policy prototype with an existing policy POST /rest/policyProto/saveAsProto {code} { "policyProto": { "name": "JobRpcThroughput", "description": "Policy for MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "inputStreams": [ "MAP_REDUCE_JOB_STREAM_SANDBOX" ], "outputStreams": [ "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT" ], "siteId": "sandbox", "definition": { "type": "siddhi", "value": "from MAP_REDUCE_JOB_STREAM_SANDBOX[mapOpsPerSecond > 1000 or reduceOpsPerSecond > 1000 or avgOpsPerMapTask > 50 or avgOpsPerReduceTask > 50] select * insert into MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT;", "handlerClass": null, "properties": {}, "inputStreams": [], "outputStreams": [] }, "stateDefinition": null, "policyStatus": "DISABLED", "alertDefinition": { "templateType": "TEXT", "subject": "$site job rpc", "body": "$site job rpc throughput", "severity": "WARNING", "category": "JPM" }, "alertDeduplications": [ { "outputStreamId": "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "dedupIntervalMin": "0", "dedupFields": [] } ], "partitionSpec": [ { "streamId": "MAP_REDUCE_JOB_STREAM_SANDBOX", "type": "SHUFFLE", "columns": [], "sortSpec": null } ], "dedicated": false, "parallelismHint": 5, "alertSeverity": "WARNING", "alertCategory": "JPM" } } {code} 3. get all policy prototypes GET /rest/policyProto 4. delete a policy prototype DELETE /rest/policyProto/{uuid} 5. update a policy prototype POST /rest/policyProto -- This message was sent by Atlassian JIRA (v6.4.14#64029)