Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

POST-ParseResponse

import groovy.json.JsonSlurper 

def post = new URL("https://pruebas.tressrevolution.com/revolutionapiesp/common/credencialesAuth").openConnection();
def message = 'grant_type=password&[email protected]&password=revolution1'
post.setRequestMethod("POST")
post.setDoOutput(true)
post.setRequestProperty("Content-Type", "Text")
post.getOutputStream().write(message.getBytes("UTF-8"));
def postRC = post.getResponseCode();

def jsonSlurper = new JsonSlurper()
def object = jsonSlurper.parseText(post.getInputStream().getText());
      
println(object.access_token);
if(postRC.equals(200)) {
    println("OK");
}

ExampleParsing

import groovy.json.JsonSlurper 

class Example {
   static void main(String[] args) {
      def jsonSlurper = new JsonSlurper()
      def object = jsonSlurper.parseText('{ "access_token": "iIbJ9OfXapZ_bA4PStXTcNlCLmxHuv6bjAVDRqX8vjmc01QHOF1Q_dbk4VpkR1B1fbAozXq4wW8OVbGxGSr_k-nooZsJZos0SF_LCOLhfw6XSp-0QQI6QyZk07yPE4DVwB13gGYIqQ0w6X1ztTCEMfRXW72BbmN_kHLCmiweE8unfYgjDTv-EmdF1e8157diQtL_i6xxxvnnbUxJ2H0ruBsZaplit7n1sf0E2tfh5kLjBorSDn6e1kt0GzSDNKbvaxwex5SNdFogpFMhTUjSbpBX93doOFbNZ2Qk91oaGLTc59VzRCze4g-DMqQDgjLJyj_pa1890QpOwApicrlkNM58FTP8GKlczX3n1lNP5qmkpp_ZzbX9eTO9mPTvznz0zjaMlQ", "token_type": "bearer","expires_in": 31535999, "DespachoID": 0,"DespachoNombre": "", "UsuarioNombre": "Usuario ADMIN","NextUrl": "#despacho", "UsuarioID": 1, "SessionID": 1003,"Version": "" }') 
		
      println(object.token_type);
      println(object.access_token);
      println(object.expires_in);
      println(object.DespachoID);
      println(object.DespachoNombre);
      println(object.UsuarioNombre);
      println(object.NextUrl);
      println(object.UsuarioID);
      println(object.SessionID);
      println(object.Version);
      
      
   } 
}

Creating Your First Hello World Program

class Example {
   static void main(String[] args) {
      // Using a simple println statement to print output to the console
      println('Hello World');
      
      //Example of a int datatype 
      int x = 5;
      //Example of a long datatype 
      long y = 100L; 
      //Example of a floating point datatype 
      float a = 10.56f; 
      //Example of a double datatype 
      double b = 10.5e40; 
      //Example of a BigInteger datatype 
      BigInteger bi = 30g;
      //Example of a BigDecimal datatype 
      BigDecimal bd = 3.5g; 
		
      println(x); 
      println(y); 
      println(a); 
      println(b); 
      println(bi); 
      println(bd); 
   }
}

title

import java.sql.*; 
import groovy.sql.Sql 

class Example { 
   static void main(String[] args) {
      // Creating a connection to the database
      def sql = Sql.newInstance('jdbc:mysql://MYSQL7003.site4now.net/db_a439c5_meusing', 'a439c5_meusing',  
         'Manoj#1532', 'com.mysql.jdbc.Driver')
         
		def insertval = """INSERT INTO EMPLOYEE(FIRST_NAME,
         LAST_NAME, AGE, SEX, INCOME) VALUES ('Man', 'Mohan singh', 80, 'M', 20)""" 
		
		sql.execute(insertval)	
      def sqlstr = """CREATE TABLE EMPLOYEE ( 
         FIRST_NAME CHAR(20) NOT NULL,
         LAST_NAME CHAR(20),
         AGE INT,
         SEX CHAR(1),
         INCOME FLOAT )""" 
         
         
sql.eachRow('select * from employee') {
         tp -> 
         println([tp.FIRST_NAME,tp.LAST_NAME,tp.age,tp.sex,tp.INCOME])
 }
    //  sql.execute(sqlstr);
 
      sql.close() 
   } 
}

adadsd

class Example {
   static void main(String[] args) {
      // Using a simple println statement to print output to the console
      println('Hello World');
   }
}

Execute Groovy Online

/* Hello World in Groovy */
println("Hello world")


class Hello{
    String tableName;
    String columnName;
    public Hello(String tableName,String columnName){
        this.tableName=tableName
        this.columnName=columnName
    }

    
}

ArrayList<Hello> ar=new ArrayList<Hello>();

Hello h1=new Hello('t1','c1')

Hello h2=new Hello('t1','c2')
Hello h3=new Hello('t1','c3')
Hello h4=new Hello('t1','c4')
Hello h5=new Hello('t1','c5')

Hello h6=new Hello('t2','c1')
Hello h7=new Hello('t2','c2')
Hello h8=new Hello('t2','c3')
Hello h9=new Hello('t2','c4')
Hello h10=new Hello('t2','c5')

ar.add(h1)
ar.add(h2)
ar.add(h3)
ar.add(h4)
ar.add(h5)

ar.add(h6)
ar.add(h7)
ar.add(h8)
ar.add(h9)
ar.add(h10)

println ar

https://www.tutorialspoint.com/execute_groovy_online.php

/* Hello World in Groovy */
println("Hello world")

find_model_version

/* Hello World in Groovy */
statusOutput="""
<cnx>
  <system clear-requires-restart="true" config-digest="7DB3E6FE4F47F61ADCA8DF44F3C2C2BB"
          description="Corvil CNE Appliance software: Version 9.4.1 (9.4.1.13560-GA.206928-64bit Wed 31 Oct 2018)" is-64bit="true"
          is-64bit-ready="true" localhost-external-ip="172.20.2.101" name="probe601"
          nic-buffer-utilization="0" num-processes="1377" packets-dropped-during-capture="0"
          platform-model="CNE-7750" probed-uptime="2230468" product-short-name="CNE"
          session-count="33" sysid="042064f2cf42b1a4aeb6" time="1546932526"
          uptime="2243238" users="2">
    <license bandwidth="120000" external-storage-enabled="true" live-dashboards-enabled="true"
             message-decoders-enabled="true" packet-capture-enabled="true"
             packet-capture-only="false" sites="1000" status="valid"
             time-remaining="2046674" trade-analysis-enabled="true" warning="">
      <unassigned-licenses>
        <unassigned-license count="2" type="7"/>
      </unassigned-licenses>
    </license>
    <memory physical-free="749772" physical-total="198066032" physical-utilization="89"
            swap-free="0" swap-total="0" swap-utilization="0"/>
    <processors utilization="6" utilization-5min="6">
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="0" status="running" utilization="12" utilization-5min="12"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="1" status="running" utilization="12" utilization-5min="12"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="2" status="running" utilization="1" utilization-5min="2"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="3" status="running" utilization="1" utilization-5min="2"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="4" status="running" utilization="12" utilization-5min="12"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="5" status="running" utilization="10" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="6" status="running" utilization="10" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="7" status="running" utilization="11" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="8" status="running" utilization="11" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="9" status="running" utilization="11" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="10" status="running" utilization="11" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="11" status="running" utilization="11" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="12" status="running" utilization="11" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="13" status="running" utilization="11" utilization-5min="8"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="14" status="running" utilization="3" utilization-5min="4"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="15" status="running" utilization="4" utilization-5min="4"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="16" status="running" utilization="5" utilization-5min="4"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="17" status="running" utilization="3" utilization-5min="3"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="18" status="running" utilization="3" utilization-5min="3"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="19" status="running" utilization="3" utilization-5min="5"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="20" status="running" utilization="3" utilization-5min="3"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="21" status="running" utilization="4" utilization-5min="4"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="22" status="running" utilization="3" utilization-5min="3"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="23" status="running" utilization="5" utilization-5min="4"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="24" status="running" utilization="4" utilization-5min="4"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="25" status="running" utilization="3" utilization-5min="4"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="26" status="running" utilization="3" utilization-5min="3"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="27" status="running" utilization="4" utilization-5min="5"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="28" status="running" utilization="11" utilization-5min="12"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="29" status="running" utilization="12" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="30" status="running" utilization="0" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="31" status="running" utilization="1" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="32" status="running" utilization="11" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="33" status="running" utilization="6" utilization-5min="10"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="34" status="running" utilization="10" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="35" status="running" utilization="10" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="36" status="running" utilization="11" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="37" status="running" utilization="11" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="38" status="running" utilization="11" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="39" status="running" utilization="11" utilization-5min="11"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="40" status="running" utilization="11" utilization-5min="10"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="41" status="running" utilization="10" utilization-5min="8"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="42" status="running" utilization="1" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="43" status="running" utilization="1" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="44" status="running" utilization="2" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="45" status="running" utilization="1" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="46" status="running" utilization="1" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="47" status="running" utilization="0" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="48" status="running" utilization="0" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="49" status="running" utilization="1" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="50" status="running" utilization="1" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="51" status="running" utilization="1" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="52" status="running" utilization="1" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="53" status="running" utilization="1" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="54" status="running" utilization="1" utilization-5min="1"/>
      <processor alert="0" alert-message="" description="Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz; cache=35840 KB"
                 id="55" status="running" utilization="0" utilization-5min="1"/>
    </processors>
    <disks raid-cache-warning="false" utilization="36">
      <disk alert="0" alert-message="" capacity="1151473404" description="" id="0"
            status="running" type="internal" used="758770380" utilization="66"
            warning="0" warning-message=""/>
      <disk alert="0" alert-message="" capacity="78132676572" description="" id="1"
            status="running" type="internal" used="4670179604" utilization="6"
            warning="0" warning-message=""/>
    </disks>
    <interfaces>
      <interface alert="0" alert-message="" enabled="1" id="0" in-bytes="4590549467"
                 in-discards="0" in-errors="0" in-nucast-packets="19964812"
                 in-processed-bytes="4590549467" in-processed-packets="50667387"
                 in-ucast-packets="50667387" in-unknown-protocols="0"
                 last-dropped-at="-1" last-dropped-msg="" mtu="1500"
                 name="mgmt" out-bytes="423061927" out-discards="0"
                 out-dropped="0" out-errors="0" out-nucast-packets="0"
                 out-queue-len="0" out-ucast-packets="670249" phys-address="a4:bf:01:39:94:59"
                 speed="1000000000" status="running" tcp-reassembly-errors="0"
                 type="ethernet-csmacd"/>
      <interface alert="0" alert-message="" enabled="1" id="1" in-bytes="21988928478058"
                 in-discards="0" in-errors="0" in-nucast-packets="0"
                 in-processed-bytes="21988928478058" in-processed-packets="109243423992"
                 in-ucast-packets="109243423992" in-unknown-protocols="0"
                 last-dropped-at="-1" last-dropped-msg="" license="8"
                 license-claimed="true" mtu="0" name="PortA" out-bytes="0"
                 out-discards="0" out-dropped="0" out-errors="0"
                 out-nucast-packets="0" out-queue-len="0" out-ucast-packets="0"
                 phys-address="" speed="10000000000" status="running"
                 tcp-reassembly-errors="4079009471" type="ethernet-csmacd"/>
      <interface alert="0" alert-message="" enabled="1" id="2" in-bytes="0" in-discards="0"
                 in-errors="0" in-nucast-packets="0" in-processed-bytes="0"
                 in-processed-packets="0" in-ucast-packets="0" in-unknown-protocols="0"
                 last-dropped-at="-1" last-dropped-msg="" license="8"
                 license-claimed="true" mtu="0" name="PortB" out-bytes="0"
                 out-discards="0" out-dropped="0" out-errors="0"
                 out-nucast-packets="0" out-queue-len="0" out-ucast-packets="0"
                 phys-address="" speed="10000000000" status="running"
                 tcp-reassembly-errors="0" type="ethernet-csmacd"/>
      <interface alert="0" alert-message="" enabled="1" id="3" in-bytes="0" in-discards="0"
                 in-errors="0" in-nucast-packets="0" in-processed-bytes="0"
                 in-processed-packets="0" in-ucast-packets="0" in-unknown-protocols="0"
                 last-dropped-at="-1" last-dropped-msg="" license="7"
                 license-claimed="true" mtu="0" name="PortC" out-bytes="0"
                 out-discards="0" out-dropped="0" out-errors="0"
                 out-nucast-packets="0" out-queue-len="0" out-ucast-packets="0"
                 phys-address="" speed="10000000000" status="running"
                 tcp-reassembly-errors="0" type="ethernet-csmacd"/>
      <interface alert="0" alert-message="" enabled="1" id="4" in-bytes="0" in-discards="0"
                 in-errors="0" in-nucast-packets="0" in-processed-bytes="0"
                 in-processed-packets="0" in-ucast-packets="0" in-unknown-protocols="0"
                 last-dropped-at="-1" last-dropped-msg="" license="7"
                 license-claimed="true" mtu="0" name="PortD" out-bytes="0"
                 out-discards="0" out-dropped="0" out-errors="0"
                 out-nucast-packets="0" out-queue-len="0" out-ucast-packets="0"
                 phys-address="" speed="10000000000" status="running"
                 tcp-reassembly-errors="0" type="ethernet-csmacd"/>
      <interface alert="0" alert-message="" enabled="0" id="5" in-bytes="0" in-discards="0"
                 in-errors="0" in-nucast-packets="0" in-processed-bytes="0"
                 in-processed-packets="0" in-ucast-packets="0" in-unknown-protocols="0"
                 last-dropped-at="-1" last-dropped-msg="" mtu="0"
                 name="mgmt2" out-bytes="0" out-discards="0" out-dropped="0"
                 out-errors="0" out-nucast-packets="0" out-queue-len="0"
                 out-ucast-packets="0" phys-address="" speed="0"
                 status="down" tcp-reassembly-errors="0" type="ethernet-csmacd"/>
      <interface alert="0" alert-message="" enabled="0" id="6" in-bytes="0" in-discards="0"
                 in-errors="0" in-nucast-packets="0" in-processed-bytes="0"
                 in-processed-packets="0" in-ucast-packets="0" in-unknown-protocols="0"
                 last-dropped-at="-1" last-dropped-msg="" mtu="0"
                 name="mgmt3" out-bytes="0" out-discards="0" out-dropped="0"
                 out-errors="0" out-nucast-packets="0" out-queue-len="0"
                 out-ucast-packets="0" phys-address="" speed="0"
                 status="down" tcp-reassembly-errors="0" type="ethernet-csmacd"/>
    </interfaces>
    <fans>
      <fan alert="0" alert-message="" description="Fan Redundancy" id="0" status="running"/>
      <fan alert="0" alert-message="" description="System Fan 1" id="1" status="running"/>
      <fan alert="0" alert-message="" description="System Fan 2" id="2" status="running"/>
      <fan alert="0" alert-message="" description="System Fan 3" id="3" status="running"/>
      <fan alert="0" alert-message="" description="System Fan 4" id="4" status="running"/>
      <fan alert="0" alert-message="" description="System Fan 5" id="5" status="running"/>
      <fan alert="0" alert-message="" description="System Fan 6" id="6" status="running"/>
      <fan alert="0" alert-message="" description="PS1 Fan Fail" id="7" status="running"/>
      <fan alert="0" alert-message="" description="PS2 Fan Fail" id="8" status="running"/>
      <fan alert="0" alert-message="" description="Napatech FAN" id="9" status="running"/>
    </fans>
    <power-supplies>
      <power-supply alert="0" alert-message="" description="PS1 Status" id="0" status="running"/>
      <power-supply alert="0" alert-message="" description="PS2 Status" id="1" status="running"/>
    </power-supplies>
    <temperature-sensors>
      <temperature-sensor alert="0" alert-message="" description="SSB Therm Trip"
                          id="0" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="BB P1 VR Temp" id="1"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="BB P2 VR Temp" id="2"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Front Panel Temp"
                          id="3" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="SSB Temp" id="4"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="BB BMC Temp" id="5"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="BB Rt Rear Temp"
                          id="6" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="BB Lft Rear Temp"
                          id="7" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="I/O Mod Temp" id="8"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Riser 1 Temp" id="9"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Riser 2 Temp" id="10"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="HSBP 1 Temp" id="11"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="HSBP 4 Temp" id="12"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="SAS Mod Temp" id="13"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Exit Air Temp" id="14"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="LAN NIC Temp" id="15"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="PS1 Temperature"
                          id="16" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="PS2 Temperature"
                          id="17" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="P1 Therm Margin"
                          id="18" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="P2 Therm Margin"
                          id="19" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="P1 Therm Ctrl %"
                          id="20" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="P2 Therm Ctrl %"
                          id="21" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="P1 DTS Therm Mgn"
                          id="22" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="P2 DTS Therm Mgn"
                          id="23" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="VRD Hot" id="24"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="DIMM Thrm Mrgn 1"
                          id="25" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="DIMM Thrm Mrgn 2"
                          id="26" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="DIMM Thrm Mrgn 3"
                          id="27" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="DIMM Thrm Mrgn 4"
                          id="28" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Agg Therm Mgn 1"
                          id="29" status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Napatech FPGA" id="30"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Napatech MCU" id="31"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Napatech PSU0" id="32"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Napatech PSU1" id="33"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Napatech OSC" id="34"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Napatech EXT" id="35"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Napatech PCB" id="36"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Napatech SFP+" id="37"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Napatech SFP+" id="38"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Napatech SFP+" id="39"
                          status="running"/>
      <temperature-sensor alert="0" alert-message="" description="Napatech SFP+" id="40"
                          status="running"/>
    </temperature-sensors>
    <gps alert="0" alert-message="Recent clock-sync error" enabled="0" status="unknown"/>
    <correlator alert="0" missed-measurements="0" signature-drops="0"/>
    <pnqm-stats secs-since-last-drop="2230432" sig-drops-nospace="0" sig-drops-timeout="0"
                sigs-total="0"/>
    <capture-settings event-percent="90" global-percent="90"/>
    <order-tracking-stats>
      <order-stats accumulated="7619547429" active="4798" deleted-decoder-request="0"
                   deleted-failed-move="0" deleted-flow-end="7619547428"
                   deleted-moved="0" failed-create="0" failed-disabled="0"
                   max-active="28306" moved="0" timed-out="0"/>
      <key-stats accumulated="7619547429" active="4798" collisions="85" deepest-collision="1"
                 deleted="7619542631" failed-create="0" failed-create-too-many-keys="0"
                 failed-move="0" invalid="0" max-active="28306" max-per-order="1"
                 moved="0">
        <keys-active-at-deletion key-count="1" num-orders="7619542631"/>
      </key-stats>
      <post-deletion-messages/>
      <decoder-requests delete-key="0" find="7619547429" find-while-disabled="0"/>
      <order-eviction max-idle-time-sec="0" mean-idle-time-sec="0" min-idle-time-sec="0"
                      number="0"/>
      <life-times count="7619542631" max-sec="2" mean-sec="1" median-sec="1" min-sec="0"
                  percentile-10-sec="1" percentile-90-sec="1"/>
      <buffer-utilisation active-flows="28452" in-use-memory="614144" memory-keys="307072"
                          memory-order-state="0" memory-orders="307072"
                          total-memory="1879048192"/>
    </order-tracking-stats>
    <apo-stats apo-errors="0" capture-updates="1" disk-threshold-updates="0" fault-updates="0"
               iptables-restarts="0" java-restarts="0" ntp-restarts="0"
               remoteauth-restarts="0" resolver-restarts="0" service-starts="0"
               service-stops="0" syslog-restarts="0" unmanaged-cne-notifications="0"/>
    <decoder-status status="The following decoders are out of date and should be upgraded: BATS-BinaryOrderEntry OUCH"/>
    <resource-usage available="2050" decoder-dynamic-storage="2240" decoder-indexed-storage="700"
                    decoder-memory-per-thread="5040" decoder-order-store="1792"
                    decoder-system-store="3072" discovery-cache="5"
                    packet-capture-buffer="62325" tshark="0" watchlist="120"/>
  </system>
</cnx>

"""
def version = statusOutput =~ /Version.+[)]/
println version[0]
def model = statusOutput =~ /platform-model=(\S+)/
println model[0][1]

Execute Groovy Online

/*def string = 'California, Oklahoma, Texas, New York, New York'
string.split(",")
string.each {
    it -> print it /*it represents the elements in the list; it's like the temporary variable I use in Python.. It can be any temp Variable name. It doesn't have to be 'it'
}*/
 
/*string.each { it ->       *** .each {it ->}  this iterates through objects*** 
    print it
}*/
 
/*string.eachWithIndex { idx, it ->      
    print "Index #{idx}:${it} "
} 
def newList = [] as Set

newList << string

print newList*/

(1..3).each {
    print "Number:${it} " /*I aded a space at the end within the sting to allow space fpr the results for the next result for iterator{it}*/
}

/*def name = ['One','Two','Two','Three'].toSet().asSynchronized() /*.toSet() outputs unique values....asSynchronized, arranges the data by order of index position */

/*name.eachWithIndex{      /*Variable name.each within the list abave and with index*/
    /*it, idx -> print " ${idx}:${it} "*/  /*HERE...BEGIN with the temp variables: temp variable for the elements using {it}; temp variable for INDEX{idx}.....but....in my output or print statement, I code index variable first, then the temp variable for the elements
}*/
/*Also, within the print statement "space..allows space between each iteration. Each time the logic iterates trhough the list, if there isn't a space at the begining of the string...the output will position the beginning of the second output against the prior iteration's output....so I needed to lead off with a space. The logic in the website isn't coded that way, but in my console it works this way.... I can test that output in DPT. */

/*def alias = ["Joe","James; Joe","James Joe",";","James"].toSet() 
def first = ["Joe"]
def last =  ["James"]
def maiden = [] as Set

maidenName = alias

print alias[0] + alias[3] /*I entered the index [2]=result [;] this is bc .toSet() is making the values, "James; Joe" and "James Joe", the same index because it's a duplicate. Althought the ; is in the first of the set, WHEN IT PRINTS OUT, the output would remove the ; so considering that, the results would be the same in terms of output ....the index position counts those two values as base 1 index and the ";"  base index and "James" as base 3 index...if those two values were the same values, the index count would count each index.*/

/*print nameLast*/
 
/*def empty = ['Color':'Blue','Name':'Smurf']
empty << ['altName':'Test']  /*Here I've added a new key and value to a mapping string and shifting it to string
    print empty            

personDetails = ['Name':'Bobby','Age':32,'Dept':'Accounting']
    print " Name: ${personDetails.name}"
    print " Age: ${personDetails.Age}"
 
personDetails = ['name':'Bobby','Age':32,'Dept':'Accounting']
    print " Name:${personDetails.name} " + " " + " Age:${personDetails.Age}"
    print " Age:${personDetails.Age}"*/ /*Here I'm using the key and values as a getter with the Key and setter, while printing, for the key and value of the variable. REMEMBER if I want to add spacing, I could add it within the mappings in the string and concatenate parathesis and / or add spacing between the quotes or double quotes from the variableName in the string "variableName" versus  " variableName"*/
 
 /*I don't need the parathesis, bc I'm retrieving from a map*/ 
 
 nameList = ["Pedro","Hydra","Iron Man"]  /*Here's the list of items*/
 
 def wordWrap = nameList.collectEntries{ [(it):it.length() 
   ]
 }
 print wordWrap

/*def medList = {'Patient':01}
def newList = [:]

oldList = [{"Cold":1, "Name":{"nameFirst":"Bob"}}]*/

def medList = ['Patient':322] /* IN GROOVY....I use [] Brackets for Mapping..  {} to define an object*/ 

print medList 

def tbl = ['Test':01]
def tbl1 = ['Testing':02]
def newTbl = tbl + tbl1
print newTbl








    

def employee = ['sam', 'peter', 'ram', 'priya'] assert animals.findAll {it in ['sam', 'ram', 'vijay'] }

def employee = ['sam', 'peter', 'ram', 'priya']
assert animals.findAll {it in ['sam', 'ram', 'vijay'] }

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.