Skip to content

Instantly share code, notes, and snippets.

View chamilaadhi's full-sized avatar

Chamila Adhikarinayake chamilaadhi

View GitHub Profile
###################### Filebeat Configuration Example #########################
# This file is an example configuration file highlighting only the most common
# options. The filebeat.reference.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/filebeat/index.html
# For more available modules and options, please see the filebeat.reference.yml sample

Employees API Documentation

This document describes the structure and operations of the Employees API, based on the provided OpenAPI 3.0.1 specification.

Server Information

The API is served at the following base URL:

http://34.69.70.249:8080/internal-operations/v1
upstream sslapi.am.wso2.com {
server 127.0.0.1:9443;
server 127.0.0.1:9444;
ip_hash;
#sticky learn create=$upstream_cookie_jsessionid
#lookup=$cookie_jsessionid
#zone=client_sessions:1m;
}
@chamilaadhi
chamilaadhi / openapi.yaml
Created November 26, 2025 18:06
openapi.yaml
openapi: 3.0.1
info:
title: Employees
version: 1.0.0
servers:
- url: http://34.69.70.249:8080/internal-operations/v1
security:
- default: []
paths:
'/employees/contract/{employee-name}':
openapi: 3.0.0
info:
title: Vehicles
description: A simple API to retrieve vehicle information.
version: 1.0.0
servers:
- url: https://686d3e17c9090c495385b953.mockapi.io
description: Mock API server
paths:
/vehicles:
-- Start of IDENTITY Tables--
CREATE TABLE IF NOT EXISTS IDN_BASE_TABLE (
PRODUCT_NAME VARCHAR(20),
PRIMARY KEY (PRODUCT_NAME)
)ENGINE INNODB;
INSERT INTO IDN_BASE_TABLE values ('WSO2 Identity Server');
CREATE TABLE IF NOT EXISTS IDN_OAUTH_CONSUMER_APPS (
ID INTEGER NOT NULL AUTO_INCREMENT,
#!/bin/bash
wso2_is_host="localhost:9443" # Replace with your WSO2 IS hostname
client_id="xxxxxxx"
client_secret="xxxxxxx"
redirect_uri="https://www.google.com"
post_logout_redirect_uri="https://www.google.com" #For logout redirect
state="mystate" #Optional state for logout
scopes="openid profile roles"
@chamilaadhi
chamilaadhi / xml-backend.js
Created December 24, 2024 11:46
xml-backend.js
const http = require('http');
const port = 3011;
// Create an HTTP server
const server = http.createServer((req, res) => {
if (req.url === '/metrics/summary' && req.method === 'GET') {
// Define the XML response content
const xmlResponse = `<?xml version="1.0" encoding="UTF-8"?>
<metrics>
<summary>
@chamilaadhi
chamilaadhi / json-backend.js
Created December 24, 2024 11:43
json-backend.js
const http = require('http');
const port = 3010;
// Create an HTTP server
const server = http.createServer((req, res) => {
if (req.url === '/bookings' && req.method === 'GET') {
// Define the response JSON with multiple elements
const response = {
bookings: {
total: 42,
@chamilaadhi
chamilaadhi / custom-backend.xml
Last active December 24, 2024 11:44
custom-backend.xml
<sequence name="custom-backend" xmlns="http://ws.apache.org/ns/synapse">
<property name="REST_URL_POSTFIX" value="" scope="axis2"/>
<call blocking="true">
<endpoint name="JSONBackend" xmlns="http://ws.apache.org/ns/synapse">
<http method="get" uri-template="http://localhost:3010/bookings" />
</endpoint>
</call>
<property name="nexus_total" expression="json-eval($.bookings.total)" scope="default" type="STRING"/>
<!-- Call WishqueEndpoint and extract the summary text -->