Gluster Management APIs
URL
/volumes
HTTP Method
get
#!/usr/bin/env dub | |
/+ dub.sdl: | |
dependency "serverino" version="~>0.7.9" | |
+/ | |
import std.typecons; | |
import std.string; | |
import std.conv; | |
import serverino; |
# Run this using | |
# touch sample.txt | |
# crystal run missing_errnos.cr -- sample.txt | |
# Above command fails to compile if we uncomment the line 39 | |
lib LibXAttr | |
{% if flag?(:linux) %} | |
fun getxattr(path : LibC::Char*, name : LibC::Char*, value : LibC::Char*, size : LibC::SizeT) : LibC::Int | |
{% end %} | |
{% if flag?(:darwin) %} | |
fun getxattr(path : LibC::Char*, name : LibC::Char*, value : LibC::Char*, size : LibC::SizeT, position : LibC::UInt32T, options : LibC::Int) : LibC::Int |
MASTER=master.example.com | |
N1=kube-node1.example.com | |
N2=kube-node2.example.com | |
N3=kube-node3.example.com | |
STORAGE_POOL_NAME=sp1 | |
OPERATOR_YAML=operator.yaml | |
PVC_NAME=pv1 | |
PVC_FILE_NAME=pv1.yaml | |
APP_POD_NAME=pod1 | |
APP_POD_FILE=pod1.yaml |
#!/usr/bin/rdmd | |
import std.stdio; | |
import std.string; | |
import std.conv; | |
void main(string[] args) | |
{ | |
string[] records; | |
bool inRecord; |
import sys | |
from datetime import datetime | |
first_ts = None | |
FMT = "%Y-%m-%d %H:%M:%S" | |
class Result(object): | |
def __init__(self): | |
self.start_ts = None | |
self.total = 0 |
# Collects the stats of PVC claims created in Kubernetes | |
# Install dependencies using `pip3 install kubernetes` | |
# Run this file and redirect the output to a file | |
# KUBECONFIG=<path_to_kube_config> python3 pv_claims_stats.py > data.txt | |
# For example, kubeconfig file will be available in the gcs/deploy directory | |
# KUBECONFIG=/root/gcs/deploy/kubeconfig python3 pv_claims_stats.py > data.txt | |
import time | |
from datetime import datetime | |
from kubernetes import client, config |
#!/usr/bin/python3 | |
import sys | |
from datetime import datetime, timedelta | |
import jwt | |
def jwt_token(user, secret): | |
claims = dict() |
openapi: 3.0.0 | |
info: | |
title: Gluster Management APIs | |
description: Gluster Peer and Volume Management APIs | |
version: 1 | |
servers: | |
- url: http://gluster.example.com/v1 | |
description: Gluster node | |
paths: | |
/volumes: |
import sys | |
defines = { | |
"VKEY_DIAG_LAT_MEASUREMENT" : "diagnostics.latency-measurement", | |
"VKEY_DIAG_CNT_FOP_HITS" : "diagnostics.count-fop-hits", | |
"AUTH_ALLOW_MAP_KEY" : "auth.allow", | |
"AUTH_REJECT_MAP_KEY" : "auth.reject", | |
"SSL_OWN_CERT_OPT" : "ssl.own-cert", | |
"SSL_PRIVATE_KEY_OPT" : "ssl.private-key", | |
"SSL_CA_LIST_OPT" : "ssl.ca-list", |