jhorvath commented on code in PR #7700:
URL: https://github.com/apache/netbeans/pull/7700#discussion_r1738439558


##########
enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/MetricsItem.java:
##########
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.netbeans.modules.cloud.oracle.developer;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.netbeans.modules.cloud.oracle.adm.URLProvider;
+import org.netbeans.modules.cloud.oracle.items.OCID;
+import org.netbeans.modules.cloud.oracle.items.OCIItem;
+import org.openide.util.Exceptions;
+
+/**
+ *
+ * @author Dusan Petrovic
+ */
+public class MetricsItem extends OCIItem implements URLProvider {
+    
+    private static final String DEFAULT_AGGREGATION_FUNCTION = "mean()";
+    private static final String DEFAULT_INTERVAL = "1m";
+    private static final String BASE_URL = 
"https://cloud.oracle.com/monitoring/explore";;
+    private static final String DEFAULT_ADVANCED_MODE = "false";
+    private static final String DEFAULT_AGGREGATE_METRICS = "false";
+
+    final String namespace;
+    final String region;
+
+    public MetricsItem(String compartmentId, String name, String namespace, 
String region) {
+        super(OCID.of(null, "MetricsNamespace/Metrics"), compartmentId, name);
+        this.namespace = namespace;
+        this.region = region;
+    }
+    
+    public String getNamespace() {
+        return namespace;
+    }
+
+    @Override
+    public URL getURL() {
+        StringBuilder sb = new StringBuilder(BASE_URL);
+        sb.append("?");
+        
sb.append("panelConfigs[0][advanced]=").append(DEFAULT_ADVANCED_MODE).append("&");

Review Comment:
   Parameter names and values should be URL encoded, so no raw brackets or 
special characters should be used.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to