{"id":15672459,"url":"https://github.com/timsusa/aptly_api_cli","last_synced_at":"2025-09-15T09:26:54.438Z","repository":{"id":57411191,"uuid":"45901013","full_name":"TimSusa/aptly_api_cli","owner":"TimSusa","description":"Command line interface, able to make calls to the complete aptly REST API inclusive further features, written in python and ready to be integrated to a CI-Workflow (JENKINS). ","archived":false,"fork":false,"pushed_at":"2019-01-27T00:51:11.000Z","size":121,"stargazers_count":18,"open_issues_count":5,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T21:26:16.927Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimSusa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-10T09:19:37.000Z","updated_at":"2024-11-11T23:26:39.000Z","dependencies_parsed_at":"2022-09-09T22:23:18.766Z","dependency_job_id":null,"html_url":"https://github.com/TimSusa/aptly_api_cli","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/TimSusa/aptly_api_cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimSusa%2Faptly_api_cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimSusa%2Faptly_api_cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimSusa%2Faptly_api_cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimSusa%2Faptly_api_cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimSusa","download_url":"https://codeload.github.com/TimSusa/aptly_api_cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimSusa%2Faptly_api_cli/sbom","scorecard":{"id":141815,"data":{"date":"2025-08-11","repo":{"name":"github.com/TimSusa/aptly_api_cli","commit":"011ba8e7f464726b336b53f6b2cbdc4490b5180c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q","Warn: Project is vulnerable to: PYSEC-2018-28 / GHSA-x84v-xcm2-53pg"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T08:19:25.426Z","repository_id":57411191,"created_at":"2025-08-16T08:19:25.426Z","updated_at":"2025-08-16T08:19:25.426Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275234428,"owners_count":25428634,"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","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-10-03T15:26:38.392Z","updated_at":"2025-09-15T09:26:54.377Z","avatar_url":"https://github.com/TimSusa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aptly_api_cli\n\n### Why do we need another aptly cli interface?\n- Because aptly-api-cli has a lot of more features build in.\n- aptly-api-cli is made accessible to the python community\n- aptly-api-cli utils are already integrated into a CI Workflow\n- Additional scripts are offered (see ci-scripts folder), which can be used along your CI jobs (e.g. jenkins)\n\n\n# Description\nThis python command line interface, executes calls to the Aptly server remotely, without blocking the Aptly database.\nAll functionality from here http://www.aptly.info/doc/api/ is extended by even more useful features, like showing or cleaning out snapshots, packages for couple of repos or mirrors.\n\nYou can make either use of the aptly_api_request.py as a starting point for your own application or just use the cli (aptly_api_cli.py)\nbundled with this repository to execute your requests via command line or run scripts, calling the cli, integrated into a CI Workflow.\n\nThis project is in use on production for www.lambdanow.com running on a JENKINS server.\n\n# Build\n\n```\n  mkvirtualenv aptly-cli\n  pip install -r dev-requirements.txt\n  ./aptly-api-cli --help\n```\n\n# Installation\n\n```\n  python setup.py install\n  aptly-cli --help\n```\n\nor create a debian package (see debian folder) and install it, locally.\n\n\n# Get started\nQuickstart: Look into the ci-scripts folder to explore aptly-cli in action.\n\n## How to configure aptly server on a CI with JENKINS?\n\nWe use upstart: http://upstart.ubuntu.com/ to ensure, aptly server is running (here on Ubuntu 12.04).\n\nTherefore, please create a file: /etc/init/aptly.conf\n\nwith content:\n\n```\n\ndescription \"starting aptly\"\nauthor \"maxMuster@muster.de\"\n\nstart on runlevel [2345]\n\nstop on runlevel [!2345]\n\nsetuid jenkins\n\nscript\n    export AWS_ACCESS_KEY_ID=\"PUT_YOUR_AWS_CREDENTIAL_HERE\"\n    export AWS_SECRET_ACCESS_KEY=\"PUT_YOUR_AWS_CREDENTIAL_HERE\"\n\n    /usr/bin/aptly api serve -config=/var/lib/jenkins/.aptly.conf -listen=\":9003\"\nend script\n\n```\n\n# Command Line Options\n\n## Help\nShow this help message and exit\n```\n-h, --help\n```\n\n### Build documentation\n```\ncd docs\nmake html\n```\n\n\n## Extensions\nFurther functionalities improving your aptly CI workflow.\n\n\n#### Create configuration file\nCreates standard config file (aptly-cli.conf) at $HOME directory.\n\n```\naptly_api_cli --create_config\n```\nPlease Note: You can configure the following keys:\n\n- basic_url: the basic url\n- port: the port\n- prefixes_mirrors: prefixes for all mirrors that you have created\n- repos_to_clean: reponames, which should be searched for to be cleaned out\n- package_prefixes: package-prefixes, which should be searched for to be cleaned out\n- save_last_pkg: Number of package-versions for each prefix, that should be kept\n- save_last_snap: Number of snapshot-versions for each prefix, that should be kept\n\nSee an working example (aptly-cli.conf):\n\n```\n# aptly-cli config file\n[general]\nbasic_url=http://localhost\nport=:9003\nprefixes_mirrors=cloudera, erlang, mongodb2, mongodb_, nginx, puppetmaster, rabbitmq, redis, saltstack2014.7, saltstack2015.5, saltstack_, git\nrepos_to_clean=unstable-repo, stable-repo\npackage_prefixes=cluster-manager, puppet-config, ingest-api, camus-etl, aptly-cli\nsave_last_pkg=10\nsave_last_snap=3\n\n[3rd_party]\n# 3rd party s3 buckets to publish switch to\nrepos=3rdparty-eu-west-1, 3rdparty-us-east-1\n# Pre and postfix of the staging snapshots\nstaging_snap_pre_post=3rdparty-s3-repo, 3rdparty-staging_snapshot\n```\n\n\n\n#### Get last n snapshots sorted by prefix\nReturns the last n snapshots by prefix or optional postfix.\n```\naptly_api_cli --get_last_snapshots=PREFIX NR_OF_VERS [POSTFIX]\n```\n\n#### Clean out last n snapshots by prefix\nCleans the last n snapshots by prefix or optional postfix.\n ```\n aptly_api_cli --clean_last_snapshots=PREFIX NR_OF_VERS [POSTFIX]\n ```\n\n\n#### List all repos and packages\nList all repos with their containing packages.\n```\n aptly_api_cli --list_repos_and_packages\n ```\n\n#### Get last n packages by reponame and sorted by prefix\nReturns the last n packages by reponame, prefix or optional postfix.\n```\n aptly_api_cli --get_last_packages=REPO_NAME PREFIX NR_OF_VERS [POSTFIX]\n ```\n\n#### Clean last n packages by reponame and sorted by prefix\nDelete the last n packages by reponame, prefix or optional postfix.\n```\n  --clean_last_packages=REPO_NAME PREFIX NR_OF_VERS [POSTFIX]\n```\n\n#### Diff all mirror snapshots\nSorts list of snapshots and makes a diff between the last two.\n```\n aptly_api_cli --diff_both_last_snapshots_mirrors\n\n```\n\n#### Clean all mirror snapshots\nCleans out snapshots, which were taken from mirrors (from config)\n```\n aptly_api_cli --clean_mirrored_snapshots\n\n```\n\n#### Clean all packages from repos\nCleans out packages globally, which were taken from repo names (from config)\n```\n aptly_api_cli --clean_repo_packages\n\n```\n\n#### Publish 3rd party staging snapshot to production\nPublish the last 3rd party staging snapshot to production (e.g. s3 bucket), only if new content is available. The taken snapshot\nstems from the script 'update-3rdparty-staging.sh'.\n\n```\n aptly_api_cli --publish_switch_3rdparty_production\n\n```\n\n\n## CI - Scripts\n\nThis script is called by other scripts, just to check if aptly server is alive.\n```\naptly-check-port-running.sh\n```\n\nThis script is called, whenever we release new software as debian package to staging or production repositories (No 3rd Party).\n```\npublish.sh 'cluster-manager' 'unstable'\n```\n\nThis script starts the 3rdPartyMirror update chain beginning from staging:\n```\nupdate-3rdparty-staging.sh\n```\n\n## Local Repos API\nLocal repositories management via REST API.\n\n#### List\nList all local repos\n```\naptly_api_cli --repo_list\n```\n\n#### Create\nCreate empty local repository with specified parameters. REPO_NAME is the name of the repository to create. COMMENT,  DISTRIBUTION (e.g.: precise) and COMPONENT (e.g.: main) are optional.\n\n```\naptly_api_cli --repo_create=REPO_NAME [COMMENT] [DISTRIBUTION] [COMPONENT]\n```\n\n#### Show\nShow basic information about a local repository. REPO_NAME is the name of the repository.\n\n```\naptly_api_cli --repo_show=REPO_NAME\n```\n\n#### Show Package\nShow all packages of a local repository. REPO_NAME is the name of the repository. PACKAGE_TO_SEARCH (Name of the Package to search for), WITH_DEPS (e.g.: 0 or 1), FORMAT (e.g.: compact or detail) are optional. Please see http://www.aptly.info/doc/api/ for more details.\n\n```\naptly_api_cli --repo_show_packages=REPO_NAME [PACKAGE_TO_SEARCH] [WITH_DEPS] [FORMAT]\n```\n\n#### Edit\nEdit information of a local repository.\n\n```\naptly_api_cli --repo_edit=REPO_NAME COMMENT DISTRIBUTION COMPONENT\n```\n\n#### Delete\nDelete repository.\n\n```\naptly_api_cli --repo_delete=REPO_NAME\n```\n\n#### Add Packages\nAdd packages to local repo by key\n```\naptly_api_cli --repo_add_packages_by_key=REPO_NAME PACKAGE_REFS\n```\n\n#### Delete Packages\nDelete packages from repository by key\n```\naptly_api_cli --repo_delete_packages_by_key=REPO_NAME PACKAGE_REFS\n```\n\n## File Upload API\nUpload package files temporarily to aptly service. These files could be added to local repositories using local repositories API.\n\nAll uploaded files are stored under \u003crootDir\u003e/upload directory (see configuration). This directory would be created automatically if it doesn’t exist.\n\nUploaded files are grouped by directories to support concurrent uploads from multiple package sources. Local repos add API can operate on directory (adding all files from directory) or on individual package files. By default, all successfully added package files would be removed.\n\n#### List Directories\nLists all upload-directories.\n```\naptly_api_cli --file_list_dirs\n```\n\n#### Upload files\nUpload file to local upload-directory\n```\naptly_api_cli --file_upload=UPLOAD_DIR FILE\n```\n\n#### Add Package\nAdd package from upload folder to local repo\n```\naptly_api_cli --repo_add_package_from_upload=REPO_NAME UPLOAD_DIR PACKAGE_NAME\n```\n\n#### List files\nList uploaded files\n```\naptly_api_cli --file_list\n```\n\n#### Delete directory\nDelete upload directory\n```\naptly_api_cli --file_delete_dir=UPLOAD_DIR\n```\n\n#### Delete file\nDelete a file in upload directory\n```\naptly_api_cli --file_delete=UPLOAD_DIR FILE\n```\n\n## Snapshot API\nSnapshot management APIs.\n\nSnapshot is a immutable package reference list taken from local repository, mirror or result of other snapshot processing.\n\n\n#### Create snapshot from local repo\nCreate snapshot from local repo by giving the snapshot and repo name as parameter. A description is optional.\n```\naptly_api_cli --snapshot_create_from_local_repo=SNAPSHOT_NAME REPO_NAME [DESCRIPTION]\n```\n\n#### Create snapshot by package references\nCreate snapshot by package references. The snapshot name, a comma separated list of snapshots and package references should be given as parameter. A description is optional.\n```\naptly_api_cli --snapshot_create_by_pack_refs=SNAPSHOT_NAME SOURCE_SNAPSHOTS PACKAGE_REF_LIST [DESCRIPTION]\n```\n\n#### Snapshot show\nShow basic information about snapshot\n```\naptly_api_cli --snapshot_show=SNAPSHOT_NAME\n```\n\n#### Snapshot show packages\nShow all packages the snapshot is containing or optionally search for one.\n```\naptly_api_cli --snapshot_show_packages=SNAPSHOT_NAME [PACKAGE_TO_SEARCH] [WITH_DEPS] [FORMAT]\n```\n\n#### Update snapshot\nRename snapshot and optionally change description\n```\naptly_api_cli --snapshot_update=OLD_SNAPSHOT_NAME NEW_SNAPSHOT_NAME [DESCRIPTION]\n```\n\n#### Snapshot list\nLists all available snapshots\n```\naptly_api_cli --snapshot_list\n```\n\n#### Snapshot diff\nList differences of two snapshots\n```\naptly_api_cli --snapshot_diff=LEFT_SNAPSHOT_NAME RIGHT_SNAPSHOT_NAME\n```\n#### Snapshot delete\nDelete snapshot by name. Optionally force deletion.\n```\naptly_api_cli --snapshot_delete=SNAPSHOT_NAME [FORCE_DELETION]\n```\n\n## Publish API\nManages published repositories.\n\n#### Publish list\nList all available repositories to publish to\n```\naptly_api_cli --publish_list\n```\n\n#### Publish\nPublish snapshot or repository to storage\n```\naptly_api_cli --publish=PREFIX SOURCES_KIND SOURCES_LIST DISTRIBUTION COMPONENT_LIST [LABEL] [ORIGIN] [FORCE_OVERWRITE] [ARCHITECTURES_LIST]\n```\n\n#### Publish drop\nDrop published repo content\n```\naptly_api_cli --publish_drop=PREFIX DISTRIBUTION [FORCE_REMOVAL]\n```\n\n\n#### Publish switch\nSwitching snapshots to published repo with minimal server down time.\n\n```\naptly_api_cli --publish_switch=PREFIX SOURCES_LIST DISTRIBUTION [COMPONENT] [FORCE_OVERWRITE]\n```\n\n## Misc API\n\n#### Returns aptly version\n```\naptly_api_cli --get_version\n```\n\n## Package API\nAPIs related to packages on their own.\n\n#### Package show\nShow packages by key\n```\naptly_api_cli --package_show_by_key=PACKAGE_KEY\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimsusa%2Faptly_api_cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimsusa%2Faptly_api_cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimsusa%2Faptly_api_cli/lists"}