mag_minio
mag_minio
alias()
-a, --alias
Source code in mag_minio/minio_options.py
14 15 16 17 18 19 |
|
api(realm, tenant, ports)
Launch minio server API. Launch this to be able to use mc command.
Source code in mag_minio/minio.py
78 79 80 81 82 83 84 85 |
|
bucket(realm, tenant, alias, ports, bucket_name)
Create a minio bucket in the tenant
Source code in mag_minio/minio.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
cli(ctx, verbose)
magasin client is the glue between magasin components, it makes easier common tasks
Source code in mag/mag.py
39 40 41 42 43 44 45 46 |
|
forward_port(realm, component, service_name, ports, verbose=False)
Forward ports for the specified realm, component, and service name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
realm |
str
|
A string representing the realm. |
required |
component |
str
|
A string representing the component. |
required |
service_name |
str
|
(str) A string representing the service name. The service name can be obtained using kubectl get services --namespace magasin-superset). |
required |
ports |
str
|
A string representing the ports to be forwarded (example: "8000:8000"). |
required |
verbose |
bool
|
A boolean indicating whether to enable verbose mode (default is False). |
False
|
Returns: None
Usage:
forward_port(realm, component, service_name, ports, verbose)
Example:
# Given this
kubectl get service -n magasin-superset
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
superset ClusterIP 10.100.96.47 <none> 8088/TCP 7d22h
forward_port("magasin", "superset", "superset", "8088:8088")
Notes:
- Assumes the port_forward_command function is defined elsewhere in the code.
- Uses subprocess.Popen to launch the port forwarding command in a subprocess.
- Registers the terminate_process function using atexit.register, ensuring that the port forwarding process is terminated when the script exits.
Source code in mag/mag_core/launch.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
generate_random_string(length=7)
Generate a random alphanumeric lowercase string of a specified length.
Parameters: - length (int): The desired length of the random string.
Returns: - str: A random string containing letters (both lowercase and uppercase) and digits.
Source code in mag/mag_core/random.py
4 5 6 7 8 9 10 11 12 13 14 15 |
|
launch_ui(realm, component, service_name, ports, protocol='http', verbose=False)
Launches the user interface for a given realm, component, and service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
realm |
str
|
The realm of the magasin instance. |
required |
component |
str
|
The magasin component (f.i superset, daskhub, drill, ...) |
required |
service_name |
str
|
The name of the kubernetes service to forward. |
required |
ports |
str
|
The ports to forward, using the format "local_port:remote_port". |
required |
protocol |
str
|
The protocol to use (default is "http"). |
'http'
|
verbose |
bool
|
Whether to display verbose output (default is False). |
False
|
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
Nothing |
Source code in mag/mag_core/launch.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
|
minio(realm, tenant)
MinIO commands
Source code in mag_minio/minio.py
34 35 36 37 38 |
|
sui(realm, tenant, ports)
Launch user tenant ssl secured user interface
Source code in mag_minio/minio.py
47 48 49 50 51 52 53 |
|
tenant()
-t, --tenant
Source code in mag_minio/minio_options.py
7 8 9 10 11 12 |
|
ui(realm, tenant, ports)
Launch user tenant non-ssl user interface
Source code in mag_minio/minio.py
59 60 61 62 63 64 65 |
|
user(realm, tenant, ports, accesskey, secretkey)
Create a minio user in the tenant
Source code in mag_minio/minio.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|