Skip to content

Instantly share code, notes, and snippets.

View imobachgs's full-sized avatar

Imobach González Sosa imobachgs

View GitHub Profile
@imobachgs
imobachgs / README.md
Created November 6, 2025 15:40
Interacting with Agama's API

Interacting with Agama's API

This document includes some small scripts that you can use to interact with Agama's API from the CLI. You must define the Agama's server URL using the AGAMA_URL (e.g., https://192.168.122.10).

Logging in

The following script logs in and writes the headers to use in the subsequent calls in the headers.txt file. Adjust the password (linux) to your use case.

#!/usr/bin/bash
@imobachgs
imobachgs / test-agama-api.sh
Last active May 6, 2024 13:09
Shell scripts to test the Agama HTTP API
TOKEN=$(curl --silent http://localhost:3000/api/auth -d '{"password": "your-password"}' \
-H "Content-Type: application/json" | jq .token | tr -d '"')
echo $TOKEN
echo "Content-Type: application/json" >headers.txt
echo -n "Authorization: Bearer " >>headers.txt
echo $TOKEN >>headers.txt
curl --silent -H @headers.txt \
http://localhost:3000/api/software/products | jq
@imobachgs
imobachgs / README.md
Last active November 10, 2023 15:40
[Hack Week 23] Relm4-based user interface for Agama

Relm4-based user interface for Agama

This document summarizes the result of the Relm4-based user interface for Agama which was part of SUSE’s Hack Week 23. It was just an experiment and I do not plan to continue working on it.

However, I will keep the branch in my fork in case anyone is interested, but bear in mind that the code quaility is far from production-ready.

Achievements

The initial idea of the project was to play around with Relm4 and build a simple user interface for Agama. At the end of the, the following features were implemented:

<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<% home_in_sdb = disks.map { |d| d[:device] }.include?("sdb") %>
<partitioning config:type="list">
<drive>
<device>/dev/sda</device>
<disklabel>gpt</disklabel>
<enable_snapshots t="boolean">true</enable_snapshots>
# Copyright (c) [2019] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@imobachgs
imobachgs / self-update-use-cases.md
Last active February 20, 2017 15:00
Self-Update Uses Cases and Error Handling

Self-Update Use Cases and Error Handling

About this document

This document tries to define how self-update should behave in different scenarios. It contains also some information about which changes should be made.

Requeriments

  1. Minimize the amount of error messages. In a nutshell, we should
@imobachgs
imobachgs / directory-and-namespaces-structure.jpg
Last active June 28, 2018 11:25
Proposal to reorganize YaST2 code
directory-and-namespaces-structure.jpg