{"id":26905064,"url":"https://github.com/rj/edgegap-arbctl","last_synced_at":"2026-02-12T04:10:40.841Z","repository":{"id":268422552,"uuid":"904296629","full_name":"RJ/edgegap-arbctl","owner":"RJ","description":"A command line tool for the edgegap api","archived":false,"fork":false,"pushed_at":"2024-12-16T21:11:50.000Z","size":183,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T09:47:09.349Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-16T16:06:06.000Z","updated_at":"2024-12-16T21:11:54.000Z","dependencies_parsed_at":"2024-12-16T17:40:56.102Z","dependency_job_id":"0d33a512-0b69-4710-9d86-135756d91a21","html_url":"https://github.com/RJ/edgegap-arbctl","commit_stats":null,"previous_names":["rj/edgegap-arbctl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RJ%2Fedgegap-arbctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RJ%2Fedgegap-arbctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RJ%2Fedgegap-arbctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RJ%2Fedgegap-arbctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RJ","download_url":"https://codeload.github.com/RJ/edgegap-arbctl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246628280,"owners_count":20808106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-01T10:55:48.768Z","updated_at":"2026-02-12T04:10:35.808Z","avatar_url":"https://github.com/RJ.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arbctl - An Edgegap API tool\n\n[![Crates.io](https://img.shields.io/crates/v/arbctl.svg)](https://crates.io/crates/arbctl)\n\nThis is a tool for interacting with the Edgegap API.\n\nI've tried to build a scalable way to easily add api commands, but I plan to only really add enough functionality to be useful as part of my automated deployment pipeline. PRs welcome.\n\nA key feature is the ability to patch resources with json pointers, per [RFC 6901](https://tools.ietf.org/html/rfc6901). This should allow an ergonomic way to change values in application versions, create clone-and-modified versions of resources, etc,\n\n## Quick note about JSON Pointers\n\nJSON Pointers are a way to reference a specific value in a json document.\nThey are specified in the [RFC 6901](https://tools.ietf.org/html/rfc6901) specification, and support for\nthem is [built in](https://docs.rs/serde_json/latest/serde_json/enum.Value.html#method.pointer) to `serde_json`.\n\nWe use them in two ways:\n\n#### Render patches\nA quick way to edit the JSON returned from a command, before it's printed to stdout.\nThis is done via the global `--render-patch` arg, which each take 2 args (pointer and replacement value), and can be specified multiple times.\n\nEg:\n```\n$ arbctl application get simple_box\n\n{\n  \"create_time\": \"2024-12-12 12:26:39.029223\",\n  \"image\": \"iVBO...ggg==\",\n  \"is_active\": true,\n  \"is_telemetry_agent_active\": false,\n  \"last_updated\": \"2024-12-13 08:55:43.373337\",\n  \"name\": \"simple_box\"\n}\n```\n\n```\n# daft example, because image is supposed to be base64 encoded image data\n# but this only patches the stdout, we aren't sending a PATCH request\n\n$ arbctl \\\n    --render-patch /is_active false \\\n    --render-patch /image '\"foo\"' \\\n    application get simple_box\n\n{\n  \"create_time\": \"2024-12-12 12:26:39.029223\",\n  \"image\": \"foo\",\n  \"is_active\": false,\n  \"is_telemetry_agent_active\": false,\n  \"last_updated\": \"2024-12-13 08:55:43.373337\",\n  \"name\": \"simple_box\"\n}\n```\n\n#### Patching resources for PATCH commands\n\nSay we want to mutate an existing application version to change some settings. Here we change application `simple_box` version `1`:\n\n**Note:** we must pass literal json strings for replacement strings, so '\"quotes\"' like this are needed for string values.\n\n```\narbctl application patch-version simple_box 1 \\\n    --patch /termination_grace_period_seconds 6 \\\n    --patch /session_config/empty_ttl 15 \\\n    --patch /docker_tag '\"sha-1234567890\"'\n ```\n\nThis command will `GET` the existing version, apply the patches, and send a `PATCH` request to update it.\n\n\n\n## Example Invocations\n\nGet version 1 of the application \"simple_box\" (json)\n```\narbctl application version simple_box 1\n```\n\nModify it by using `--patch` and the `patch-version` application sub-command:\n```\narbctl application patch-version simple_box 1 \\\n    --patch /termination_grace_period_seconds 6 \\\n    --patch /ports/0/name '\"gameserver\"'\n```\n\n### Creating a new application version based on an existing one\n\nuse `application version` to fetch version 1, use `---render-patch` to change the output json, and pipe into `create-version` which reads from stfdin. Anything requiring advanced json edits can just use `jq` or whatever.\n```\narbctl --render-patch /name '\"2\"' --render-patch /docker_tag '\"v2\"' application version simple_box 1 \\\n | arbctl application create-version simple_box 2 --stdin\n```\n\n### Create a new application based on an existing one\n(copy simple_box to an application called testapp)\n```\narbctl --render-patch /name '\"testapp\"' application get simple_box | arbctl application create testapp\n```\n\n# Questions for Edgegap\n\nthe `docker_image` field seems to be validated by a mega regex when your submit a patch or create request – \na regex that is more restrictive than the web dashboard uses.\n\nit has to be lower case.\n\n```\n❌ \"docker_image\": \"RJ/lightyear-server\",\n✅ \"docker_image\": \"rj/lightyear-server\",\n```\n\n\n## Notes\n\n* [CLI Struture in Rust](https://kbknapp.dev/cli-structure-01/) - a great intro to writing scalable cli tools in rust using clap.\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frj%2Fedgegap-arbctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frj%2Fedgegap-arbctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frj%2Fedgegap-arbctl/lists"}