This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Dict test" | |
declare -A appdomain_workflowID=( | |
["test-$1/$2"]="cow" | |
["test-$1/$2"]="dog" | |
["test-$1/$2"]="cat" | |
["test-$1/$2"]="fish" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Based on kizbitz/dockerhub-v2-api-organization.sh at https://gist.github.com/kizbitz/175be06d0fbbb39bc9bfa6c0cb0d4721 | |
# Example for the Docker Hub V2 API | |
# Returns all images and tags associated with a Docker Hub organization account. | |
# Requires 'jq': https://stedolan.github.io/jq/ | |
# set username, password, and organization | |
UNAME="" | |
UPASS="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Example for the Docker Hub V2 API | |
# Returns all imagas and tags associated with a Docker Hub user account. | |
# Requires 'jq': https://stedolan.github.io/jq/ | |
# set username and password | |
UNAME="" | |
UPASS="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getNewKeyValuePair(sourcekey): | |
with open("test1.json") as jsonFile: | |
data = json.load(jsonFile) | |
dict = {} | |
lst = [] | |
dict[sourcekey] = {} | |
print("_______",list(data.keys())) | |
print("++++++++++++", len(data)) | |
# rules_items_source = list(findkeysvalues(data, sourcekey)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def insertValueindictonary(): | |
with open("test1.json") as jsonFile: | |
data = json.load(jsonFile) | |
Dict = { } | |
for p in data: | |
print("ooooooooooo",p) | |
Dict[p] = { } | |
return Dict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import re | |
def findkeysvalues(inputDict, key): | |
if isinstance(inputDict, list): | |
for i in inputDict: | |
for x in findkeysvalues(i, key): | |
yield x | |
if isinstance(inputDict, dict): | |
if key in inputDict: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"client": { | |
"name": "anyname" | |
}, | |
"PEP": { | |
"tire2": { | |
"tire3": { | |
"compname": "test1" | |
}, | |
"tire4": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"tire1": { | |
"source": [ "{{ 'PEP' | YYYYYYY | join }}" ], | |
"dest": [ "{{ Microservice.host }}" ], | |
"port": "555" | |
}, | |
"tire6": { | |
"source": [ "{{ 'REP' | LLLLLL | join }}" ], | |
"dest": [ "{{ Microservice.host2 }}" ], | |
"port": "555" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import re | |
def findkeysvalues(inputDict, key): | |
if isinstance(inputDict, list): | |
for i in inputDict: | |
for x in findkeysvalues(i, key): | |
yield x | |
if isinstance(inputDict, dict): | |
if key in inputDict: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def findkeysvalues(inputDict, key): | |
if isinstance(inputDict, list): | |
for i in inputDict: | |
for x in findkeysvalues(i, key): | |
yield x | |
if isinstance(inputDict, dict): | |
if key in inputDict: | |
yield inputDict[key] | |
for j in inputDict.values(): | |
for x in findkeysvalues(j, key): |
NewerOlder