mini_buildd.api module¶
API arguments and calls
>>> Setup.from_command_line("--update all --archives-from-proxy --sources bullseye --sources-from-origin Debian:lts --repositories-from-distributions test --chroots-from-sources").command_line()
'--update all --archives-from-proxy --sources bullseye --sources-from-origin Debian:lts --repositories-from-distributions test --chroots-from-sources'
- class mini_buildd.api.Argument(id_list, doc='Undocumented', default=None, choices=None, header=None)¶
Bases:
objectGeneric Argument Class
value()always provides a non-Nonevalue of the specific type, either thedefaultor agivenvalue.strvalue()always provides a non-Nonestrvalue.The
defaultvalue is given in the constructor. For server-specific defaults, this may be function – then the default value will be computed only at run time on the server.- A
givenvalue can be provided via specialset()method: Empty
str,listor falseboolwill yieldNone.Non-empty
strwill be converted to the specific type.Other given values will be used as is.
Type
value() type
svalue() ex.
HTML GET
argparse
Str
str
“string”
key=string
–key “string”
Url
str
“http://..”
key=string
–key “string”
MultilineStr
str
“long”
key=string
–key “string”
Choice
str
“c0”
key=string
–key “string”
Int
int
“17”
key=string
–key “int”
Bool
bool
“True”
key=True
–key
List
list of str
“v0,v1,..”
key=v0,v1..
–key “v0” “v1”..
- VALUE_TYPE¶
Validate that values are actually of that type
alias of
str
- SERVER_DEFAULT = '<server_default>'¶
Magic string value to use as value when a default callable on the server should be used.
- classmethod s2v(str_value)¶
Convert string to value
- classmethod v2s(value)¶
Convert value to string
- required()¶
- needs_value()¶
If user input is no_value
- choices()¶
- default()¶
- strdefault()¶
- value()¶
- strvalue()¶
- strgiven()¶
- icommand_line_given()¶
- set(given)¶
- argparse_kvsargs()¶
Python ‘argparse’ support
- A
- class mini_buildd.api.StrArgument(id_list, doc='Undocumented', default=None, choices=None, header=None)¶
Bases:
Argument- HTML_TYPE = 'text'¶
- argparse_kvsargs()¶
Python ‘argparse’ support
- class mini_buildd.api.UrlArgument(id_list, doc='Undocumented', default=None, choices=None, header=None)¶
Bases:
StrArgument- HTML_TYPE = 'url'¶
- class mini_buildd.api.MultilineStrArgument(id_list, doc='Undocumented', default=None, choices=None, header=None)¶
Bases:
StrArgument- HTML_TYPE = 'textarea'¶
- class mini_buildd.api.ChoiceArgument(id_list, doc='Undocumented', default=None, choices=None, header=None)¶
Bases:
Argument- HTML_TYPE = 'select'¶
- value()¶
- argparse_kvsargs()¶
Python ‘argparse’ support
- class mini_buildd.api.IntArgument(id_list, doc='Undocumented', default=None, choices=None, header=None)¶
Bases:
StrArgument- VALUE_TYPE¶
alias of
int
- HTML_TYPE = 'number'¶
- argparse_kvsargs()¶
Python ‘argparse’ support
- class mini_buildd.api.BoolArgument(*args, **kwargs)¶
Bases:
ChoiceArgument- VALUE_TYPE¶
alias of
bool
- HTML_TYPE = 'checkbox'¶
- classmethod s2v(str_value)¶
Convert string to value
- icommand_line_given()¶
Empty generator – bools are just command line options like
--with-foo
- argparse_kvsargs()¶
Python ‘argparse’ support
- class mini_buildd.api.ListArgument(id_list, doc='Undocumented', default=None, choices=None, header=None)¶
Bases:
StrArgument- VALUE_TYPE¶
alias of
list
- SEPARATOR = ','¶
- classmethod s2v(str_value)¶
Convert string to value
- classmethod v2s(value)¶
Convert value to string
- icommand_line_given()¶
- argparse_kvsargs()¶
Python ‘argparse’ support
- class mini_buildd.api.Repository(id_list, **kwargs)¶
Bases:
StrArgument- object()¶
- class mini_buildd.api.Repositories(id_list, **kwargs)¶
Bases:
ListArgument- objects()¶
- class mini_buildd.api.Codenames(id_list, **kwargs)¶
Bases:
ListArgument
- mini_buildd.api.diststr2repository(diststr)¶
- class mini_buildd.api.Distribution(id_list, choices=Name.ACTIVE_DISTRIBUTIONS, extra_doc='', **kwargs)¶
Bases:
StrArgument- dist()¶
- class mini_buildd.api.Distributions(id_list, choices=Name.ACTIVE_DISTRIBUTIONS, **kwargs)¶
Bases:
ListArgument
- class mini_buildd.api.Source(id_list, extra_doc='', **kwargs)¶
Bases:
StrArgument
- class mini_buildd.api.UploadOptions(id_list, **kwargs)¶
Bases:
StrArgument
- class mini_buildd.api.Output¶
Bases:
ChoiceArgumentMeta API call option ‘output’
- class mini_buildd.api.Rollbacks(id_list, extra_doc='', **kwargs)¶
Bases:
IntArgument- range(suite)¶
Get valid range for this suite
- class mini_buildd.api.Call(**kwargs)¶
Bases:
object- AUTH = <mini_buildd.config.Auth object>¶
- NEEDS_RUNNING_DAEMON = False¶
- CONFIRM = False¶
- CUSTOM_HTML_SNIPPET = None¶
- classmethod name()¶
- classmethod doc()¶
- classmethod doc_title()¶
- classmethod doc_body()¶
- CATEGORIES = ['Consumer', 'Developer', 'Administrator']¶
- classmethod category()¶
- classmethod uri()¶
- classmethod iarguments()¶
- classmethod from_sloppy_args(**kwargs)¶
Construct ignoring any unknown arguments given
- set_args(**kwargs)¶
- classmethod from_command_line(command_line)¶
- set_request(request)¶
- classmethod get_plain(result, force_json=False)¶
Get
strresult (non-strresults get json pretty-formatted)
- plain(force_json=False)¶
- json_pretty()¶
For (arg-less) use in templates only
- classmethod parse_command_line(command_line)¶
- icommand_line(full=False, with_user=False, user=None, exclude=None)¶
- command_line(full=False, with_user=False, user=None, exclude=None)¶
- command_line_full()¶
- http_args(with_confirm=False, with_output=None)¶
- url()¶
- run()¶
- class mini_buildd.api.Status(**kwargs)¶
Bases:
CallGet the status of this instance
JSON Result:
version : mini-buildd’s version.
identity : Instance identity.
url : Instance URL (HTTP).
incoming_url: Incoming URL (currently FTP).
load : Instance’s (0 =< load <= 1). If negative, the instance is not powered on.
chroots : Active chroots.
remotes : Active or auto-reactivatable remotes.
[repositories: Simplified structural representation of all repositories]
Authorization: NONE
- classmethod iarguments()¶
- class mini_buildd.api.PubKey(**kwargs)¶
Bases:
CallGet public key
Get ASCII-armored GnuPG public key of this instance.
Used to sign the apt repositories (apt key) and for authorization across instances.
Authorization: NONE
- class mini_buildd.api.DputConf(**kwargs)¶
Bases:
CallGet recommended dput config snippet
Usually, this is for integration in your personal ~/.dput.cf.
Tip
Can I add a custom dput config snippet?
Just put your custom snippet in
~mini-buildd/etc/dput.cf. If that file exists, it will be added to the output of API call ‘dput_conf’.Authorization: NONE
- class mini_buildd.api.SourcesList(**kwargs)¶
Bases:
CallGet sources.list (apt lines)
Usually, this output is put to a file like ‘/etc/sources.list.d/mini-buildd-xyz.list’.
Authorization: NONE
- classmethod iarguments()¶
- class mini_buildd.api.Ls(**kwargs)¶
Bases:
CallList source package
Authorization: NONE
- classmethod iarguments()¶
- class mini_buildd.api.Debdiff(**kwargs)¶
Bases:
CallCompare two internal source packages
- classmethod iarguments()¶
- class mini_buildd.api.Migrate(**kwargs)¶
Bases:
_Staff,_Confirm,CallMigrate source package
Migrates a source package along with all its binary packages. If run for a rollback distribution, this will perform a rollback restore.
Authorization: STAFF
- classmethod iarguments()¶
- class mini_buildd.api.Remove(**kwargs)¶
Bases:
_Admin,_Confirm,CallRemove source package
Removes a source package along with all its binary packages.
Authorization: ADMIN
- classmethod iarguments()¶
- class mini_buildd.api.Port(**kwargs)¶
Bases:
_Staff,_Running,_Confirm,CallPort internal source package
An internal ‘port’ is a no-changes (i.e., only the changelog will be adapted) rebuild of the given locally-installed package.
When from-distribution equals to_distribution, a rebuild will be done.
- JSON Result (dict):
list of dicts of all items uploaded
Authorization: STAFF
- classmethod iarguments()¶
- class mini_buildd.api.PortExt(**kwargs)¶
Bases:
_Staff,_Running,_Confirm,CallPort external source package
An external ‘port’ is a no-changes (i.e., only the changelog will be adapted) rebuild of any given source package.
- JSON Result (dict):
list of dicts of all items uploaded
Authorization: STAFF
- classmethod iarguments()¶
- class mini_buildd.api.Retry(**kwargs)¶
Bases:
_Staff,_Running,_Confirm,CallRetry a previously failed source package
JSON Result:
changes: Changes file that has been re-uploaded.
Authorization: STAFF
- BKEY_FORMAT = '<source>/<version>/<timecode>/source[ <arch>]'¶
- BKEY_REGEX = re.compile('[^/]+/[^/]+/[^/]+/[^/]+')¶
- classmethod iarguments()¶
- class mini_buildd.api.Cancel(**kwargs)¶
Bases:
_Staff,_Running,_Confirm,CallCancel an ongoing package build Authorization: STAFF
- classmethod iarguments()¶
- class mini_buildd.api.SetUserKey(**kwargs)¶
Bases:
_Login,_Confirm,CallSet a user’s GnuPG public key
Authorization: LOGIN
- classmethod category()¶
- classmethod iarguments()¶
- class mini_buildd.api.Subscribe(**kwargs)¶
Bases:
_Login,CallSubscribe to (email) notifications
Authorization: LOGIN
- classmethod iarguments()¶
- class mini_buildd.api.Unsubscribe(**kwargs)¶
Bases:
SubscribeUnsubscribe from (email) notifications
Authorization: LOGIN
- class mini_buildd.api.RemakeChroots(**kwargs)¶
Bases:
_Admin,_Confirm,_Maintenance,CallRemake chroots
Run actions ‘remove’, ‘prepare’, ‘check’ and ‘activate’.
Note that Daemon will be stopped before running, cancelling ongoing events (
BUILDING,PACKAGING).Authorization: ADMIN
- classmethod iarguments()¶
- class mini_buildd.api.Power(**kwargs)¶
Bases:
_Admin,_Confirm,CallPower Daemon on or off (toggles by default)
This essentially stops accepting incoming, and forcibly stops any possibly running builds.
This state is not persisted. Please deactivate the Daemon instance via mini-buildd’s ‘setup’ page to make the state persist over mini-buildd service restarts.
Authorization: ADMIN
- classmethod iarguments()¶
- class mini_buildd.api.Wake(**kwargs)¶
Bases:
_Staff,_Confirm,CallWake a remote instance
Authorization: STAFF
- classmethod iarguments()¶
- class mini_buildd.api.Handshake(**kwargs)¶
Bases:
CallCheck if signed message matches a remote, reply our signed message on success
This is for internal use only.
Authorization: NONE
- classmethod category()¶
- classmethod iarguments()¶
- class mini_buildd.api.Cronjob(**kwargs)¶
Bases:
_Admin,_Confirm,CallRun a cron job now (out of schedule)
Authorization: ADMIN
- classmethod iarguments()¶
- class mini_buildd.api.Uploaders(**kwargs)¶
Bases:
_Admin,_Running,CallGet upload permissions for repositories
Authorization: ADMIN
- classmethod iarguments()¶
- class mini_buildd.api.SnapshotLs(**kwargs)¶
Bases:
_Running,CallGet list of repository snapshots for a distribution
- JSON Result (dict):
dict: <distribution>: [snasphot,…]: List of snapshots for the given distribution.
Authorization: NONE
- classmethod iarguments()¶
- class mini_buildd.api.SnapshotCreate(**kwargs)¶
Bases:
_Admin,_Confirm,SnapshotLsCreate a repository snapshot
Authorization: ADMIN
- classmethod iarguments()¶
- class mini_buildd.api.SnapshotDelete(**kwargs)¶
Bases:
SnapshotCreateDelete a repository snapshot
- class mini_buildd.api.Debmirror(**kwargs)¶
Bases:
_Admin,_Confirm,CallMake local partial repository mirror via Debian package ‘debmirror’
This may be useful if you plan on publishing a stripped-down (f.e., only certain repos, only
stable, omit rollbacks) variant of your repo somewhere remote.Error
debmirror (Debian Bug #819925):
apt updatefails onexperimentalsuites (contents not mirrored)This happens only on systems where APT is configured to download contents, most likely just because
apt-fileis installed. So, the easiest workaround is:apt purge apt-file
Closest to an actual fix is to install debmirror variant ‘+abfixes’ from
Hellfield Archive, where the “bug” has been fixed (Dec 2022: at least available for bullseye).Authorization: ADMIN
- PROGRAM = '/usr/bin/debmirror'¶
- DEB = 'debmirror'¶
- classmethod iarguments()¶
- class mini_buildd.api.KeyringPackages(**kwargs)¶
Bases:
_Admin,_Running,_Confirm,CallBuild keyring packages
Tip
keyring-packages: No compat for urold (
apt-key add)Since
2.x, keyring packages will use/etc/apt/trusted.gpg.d/<foo>.gpg, not deprecatedapt-key add <foo>.In Debian, this is supported since
wheezy (2013).For distributions
<= squeeze(apt versions~<= 0.8.x), you would manually have to runapt-key add /etc/apt/trusted.gpg.d/<foo>.gpgafter installation of the keyring package.- JSON Result (dict):
list of dicts of all items uploaded
Authorization: ADMIN
- classmethod iarguments()¶
- class mini_buildd.api.TestPackages(**kwargs)¶
Bases:
_Admin,_Running,_Confirm,CallBuild test packages
- JSON Result (dict):
list of dicts of all items uploaded
Authorization: ADMIN
- classmethod iarguments()¶
- class mini_buildd.api.Setup(**kwargs)¶
Bases:
_Admin,_Confirm,_Maintenance,CallCreate, update or inspect your setup
Note that Daemon will be stopped before running, cancelling ongoing events (
BUILDING,PACKAGING).Authorization: ADMIN
- classmethod iarguments()¶
- class Instance(call, model, options, update_args, **identifiers)¶
Bases:
object- diff()¶
Overload/expand this for additional custom diffs.
- update()¶
- classmethod ilocal_archive_urls()¶
- classmethod iapt_cacher_archive_urls()¶
- class Dists(items=None)¶
Bases:
dict- classmethod iexpand_arch(arch)¶
- classmethod iexpand_archs(archs)¶
- set(codename, archs)¶
- as_argument_value()¶
- merge(dists)¶
- classmethod from_models()¶
- class mini_buildd.api.Calls¶
Bases:
OrderedDictAutomatically collect all calls defined in this module, and make them accessible