-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #38019 - Add hammer support for flatpak remotes
- Loading branch information
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
module HammerCLIKatello | ||
class FlatpakRemoteCommand < HammerCLIKatello::Command | ||
resource :flatpak_remotes | ||
|
||
class ListCommand < HammerCLIKatello::ListCommand | ||
include OrganizationOptions | ||
output do | ||
field :id, _('ID') | ||
field :name, _('Name') | ||
field :url, _('URL') | ||
field :description, _('Description') | ||
field :username, _('User') | ||
field :token, _('Token') | ||
field :registry_url, _('Registry URL') | ||
end | ||
|
||
build_options | ||
end | ||
|
||
class InfoCommand < HammerCLIKatello::InfoCommand | ||
output do | ||
field :id, _('ID') | ||
field :name, _('Name') | ||
field :label, _('Label') | ||
field :description, _('Description'), Fields::Field, :hide_blank => true | ||
field :url, _('Flatpak index URL') | ||
field :username, _('Username'), Fields::Field, :hide_blank => true | ||
field :token, _('Token'), Fields::Field, :hide_blank => true | ||
field :registry_url, _('Registry URL') | ||
end | ||
|
||
build_options | ||
end | ||
|
||
class CreateCommand < HammerCLIKatello::CreateCommand | ||
success_message _('Flatpak Remote created.') | ||
failure_message _('Could not create the Flatpak Remote.') | ||
|
||
build_options | ||
end | ||
|
||
class UpdateCommand < HammerCLIKatello::UpdateCommand | ||
success_message _('Flatpak Remote updated.') | ||
failure_message _('Could not update the Flatpak Remote.') | ||
|
||
build_options | ||
end | ||
|
||
class DeleteCommand < HammerCLIKatello::DeleteCommand | ||
success_message _('Flatpak Remote deleted.') | ||
failure_message _('Could not delete the Flatpak Remote.') | ||
|
||
build_options | ||
end | ||
|
||
class ScanCommand < HammerCLIKatello::SingleResourceCommand | ||
include HammerCLIForemanTasks::Async | ||
|
||
action :scan | ||
command_name 'scan' | ||
|
||
success_message _("Flatpak remote is being scanned in task %{id}.") | ||
failure_message _('Could not scan the Flatpak remote') | ||
|
||
build_options | ||
end | ||
|
||
|
||
autoload_subcommands | ||
end | ||
end |