Bug 1023147 - [RFE] hammer: proxy create/update should provide option to associate Orgs
Summary: [RFE] hammer: proxy create/update should provide option to associate Orgs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: Nightly
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-24 17:33 UTC by Corey Welton
Modified: 2019-09-26 13:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-09 15:23:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 3497 0 None None None 2016-04-22 16:35:52 UTC

Description Corey Welton 2013-10-24 17:33:52 UTC
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 11:09:39 UTC
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 17:22:52 UTC
Upstream bug component is Hammer

Comment 6 Bryan Kearney 2016-08-10 18:14:28 UTC
Upstream bug component is Uncategorized

Comment 7 Bryan Kearney 2016-08-10 18:59:35 UTC
Upstream bug component is Hammer

Comment 8 Tomas Strachota 2016-11-09 15:23:52 UTC
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.