Useful commands and scipts¶
Expire managed transactions holds¶
Prerequisite¶
- Access to prod Kubernetes cluster
Command¶
We can reach Galileo endpoints from Galileo service via the following command
kubectl exec -it minority-galileo-service-<pod id> -- curl -X POST --url http://localhost:32123/manual/custom?relativePath=<GalileoEndpoint> -H 'accept: application/json' -H 'content-type: application/json' --data '{<JSON DATA Required for the query>}'
Here you can find the different endpoints: https://docs.galileo-ft.com/pro/reference/program-api-intro
Add credit to user(s)¶
Prerequisite¶
- Admin rights on Hydra (prod)
- Python and pandas library installed locally (but it could be adapted to bash or powershell) so it requires
Script¶
This is a sample where we credit users for 'Cash load Refund', so we use specific type 'AdminCredit' and subtype 'AdministrativeAdjustment'. All types can be found here and subtypes here
import pandas as pd
import requests
ACCESS_TOKEN = '<Access token that can be found when login into hydra>'
if __name__ == '__main__':
headers = {
'Authorization': f'Bearer {ACCESS_TOKEN}',
'Content-Type': 'application/json; charset=UTF-8'
}
df = pd.read_csv('<path/to/csv containing users and amounts>')
for _, row in df.iterrows():
credit_data = {
"accountHolderIds": [f"{row['user_ids']}"],
"amount": row['amount'],
"description": "Cash Load Refund",
"forceTransaction": False,
"ownerResourceId": None,
"subType": "AdministrativeAdjustment",
"type": "AdminCredit",
}
print(credit_data)
response = requests.post(
'https://hydra.minority.com/v1/transactions/add-credits',
headers=headers,
json=credit_data
)
print(response.status_code, response.reason)