Bug 1023147 - [RFE] hammer: proxy create/update should provide option to associate Orgs
[RFE] hammer: proxy create/update should provide option to associate Orgs
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
Nightly
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
Katello QA List
http://projects.theforeman.org/issues...
: FutureFeature, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-24 13:33 EDT by Corey Welton
Modified: 2016-11-09 10:23 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-09 10:23:52 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 3497 None None None 2016-04-22 12:35 EDT

  None (edit)
Description Corey Welton 2013-10-24 13:33:52 EDT
Description of problem:
In the UI, we can associate organization with a proxy.  There does not appear to be a way to do that in the CLI, however.  Would be nice to have.


Something like

hammer -u admin -p admin proxy create --name foobar --url https://example.com:9090 --add_org org_name
hammer -u admin -p admin proxy create --name foobar --url https://example.com:9090 --remove_org org_name
hammer -u admin -p admin proxy update --name foobar --remove_org org_name
hammer -u admin -p admin proxy update --name foobar --remove_org org_name

and even possibly comma-separated, e.g., 

--add_org NorthAmerica,EMEA,APAC

Version-Release number of selected component (if applicable):
Satellite-6.0.2-RHEL-6-20131023.1
Comment 2 Dominic Cleal 2013-10-25 07:09:39 EDT
It's possible to do this today via the organization subcommand, rather than the command for the resource you're associating, though I did just hit another bug while attempting it (http://projects.theforeman.org/issues/3499).

Something like "hammer organization add_smartproxy ..." should work.

Filed this as a feature too though, you should be able to do it at resource creation.
Comment 5 Bryan Kearney 2015-08-25 13:22:52 EDT
Upstream bug component is Hammer
Comment 6 Bryan Kearney 2016-08-10 14:14:28 EDT
Upstream bug component is Uncategorized
Comment 7 Bryan Kearney 2016-08-10 14:59:35 EDT
Upstream bug component is Hammer
Comment 8 Tomas Strachota 2016-11-09 10:23:52 EST
Fixed in satellite 6.2, hammer provides association options/commands for proxies that are consistent with other resources:

[root@sat62 ~]# hammer proxy create -h
Usage:
    hammer proxy create [OPTIONS]

Options:
 --location-ids LOCATION_IDS         REPLACE locations with given ids
                                     Comma separated list of values.
 --locations LOCATION_NAMES          Comma separated list of values.
 --name NAME                          
 --organization-ids ORGANIZATION_IDS REPLACE organizations with given ids.
                                     Comma separated list of values.
 --organizations ORGANIZATION_NAMES  Comma separated list of values.
 --url URL                            
 -h, --help                          print help
[root@sat62 ~]# hammer proxy update -h
Usage:
    hammer proxy update [OPTIONS]

Options:
 --id ID                              
 --location-ids LOCATION_IDS         REPLACE locations with given ids
                                     Comma separated list of values.
 --locations LOCATION_NAMES          Comma separated list of values.
 --name NAME                         Name to search by
 --new-name NEW_NAME                  
 --organization-ids ORGANIZATION_IDS REPLACE organizations with given ids.
                                     Comma separated list of values.
 --organizations ORGANIZATION_NAMES  Comma separated list of values.
 --url URL                            
 -h, --help                          print help
[root@sat62 ~]# hammer organization -h | grep proxy
 add-smart-proxy               Associate a smart proxy
 remove-smart-proxy            Disassociate a smart proxy


[root@sat62 ~]# hammer --version
hammer (0.5.1.11)
 * hammer_cli_csv (unknown version)
 * hammer_cli_foreman (0.5.1.9)
 * hammer_cli_foreman_admin (0.0.5)
 * hammer_cli_foreman_bootdisk (0.1.3.3)
 * hammer_cli_foreman_discovery (0.0.2.3)
 * hammer_cli_foreman_docker (unknown version)
 * hammer_cli_foreman_remote_execution (unknown version)
 * hammer_cli_foreman_tasks (unknown version)
 * hammer_cli_import (0.11.2)
 * hammer_cli_katello (0.0.22.26)

Note You need to log in before you can comment on or make changes to this bug.