Skip to content

Commit b7a130f

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Command doc: federation protocol"
2 parents 1dd6112 + a0c63de commit b7a130f

3 files changed

Lines changed: 152 additions & 27 deletions

File tree

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
===================
2+
federation protocol
3+
===================
4+
5+
Identity v3
6+
7+
`Requires: OS-FEDERATION extension`
8+
9+
federation protocol create
10+
--------------------------
11+
12+
Create new federation protocol
13+
14+
.. program:: federation protocol create
15+
.. code:: bash
16+
17+
os federation protocol create
18+
--identity-provider <identity-provider>
19+
--mapping <mapping>
20+
<name>
21+
22+
.. option:: --identity-provider <identity-provider>
23+
24+
Identity provider that will support the new federation protocol (name or ID) (required)
25+
26+
.. option:: --mapping <mapping>
27+
28+
Mapping that is to be used (name or ID) (required)
29+
30+
.. describe:: <name>
31+
32+
New federation protocol name (must be unique per identity provider)
33+
34+
federation protocol delete
35+
--------------------------
36+
37+
Delete a federation protocol
38+
39+
.. program:: federation protocol delete
40+
.. code:: bash
41+
42+
os federation protocol delete
43+
--identity-provider <identity-provider>
44+
<federation-protocol>
45+
46+
.. option:: --identity-provider <identity-provider>
47+
48+
Identity provider that supports <federation-protocol> (name or ID) (required)
49+
50+
.. describe:: <federation-protocol>
51+
52+
Federation protocol to delete (name or ID)
53+
54+
federation protocol list
55+
------------------------
56+
57+
List federation protocols
58+
59+
.. program:: federation protocol list
60+
.. code:: bash
61+
62+
os federation protocol list
63+
--identity-provider <identity-provider>
64+
65+
.. option:: --identity-provider <identity-provider>
66+
67+
Identity provider to list (name or ID) (required)
68+
69+
federation protocol set
70+
-----------------------
71+
72+
Set federation protocol properties
73+
74+
.. program:: federation protocol set
75+
.. code:: bash
76+
77+
os federation protocol set
78+
--identity-provider <identity-provider>
79+
[--mapping <mapping>]
80+
<federation-protocol>
81+
82+
.. option:: --identity-provider <identity-provider>
83+
84+
Identity provider that supports <federation-protocol> (name or ID) (required)
85+
86+
.. option:: --mapping <mapping>
87+
88+
Mapping that is to be used (name or ID)
89+
90+
.. describe:: <federation-protocol>
91+
92+
Federation protocol to modify (name or ID)
93+
94+
federation protocol show
95+
------------------------
96+
97+
Display federation protocol details
98+
99+
.. program:: federation protocol show
100+
.. code:: bash
101+
102+
os federation protocol show
103+
--identity-provider <identity-provider>
104+
<federation-protocol>
105+
106+
.. option:: --identity-provider <identity-provider>
107+
108+
Identity provider that supports <federation-protocol> (name or ID) (required)
109+
110+
.. describe:: <federation-protocol>
111+
112+
Federation protocol to display (name or ID)

‎doc/source/commands.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ referring to both Compute and Volume quotas.
8383
* ``ec2 cedentials``: (**Identity**) AWS EC2-compatible credentials
8484
* ``endpoint``: (**Identity**) the base URL used to contact a specific service
8585
* ``extension``: (**Compute**, **Identity**, **Volume**) OpenStack server API extensions
86+
* ``federation protocol``: (**Identity**) the underlying protocol used while federating identities
8687
* ``flavor``: (**Compute**) predefined server configurations: ram, root disk, etc
8788
* ``group``: (**Identity**) a grouping of users
8889
* ``host``: Compute - the physical computer running a hypervisor

‎openstackclient/identity/v3/federation_protocol.py‎

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

2727
class CreateProtocol(show.ShowOne):
28-
"""Create new Federation Protocol tied to an Identity Provider"""
28+
"""Create new federation protocol"""
2929

3030
log = logging.getLogger(__name__ + 'CreateProtocol')
3131

@@ -34,16 +34,19 @@ def get_parser(self, prog_name):
3434
parser.add_argument(
3535
'federation_protocol',
3636
metavar='<name>',
37-
help='Protocol (must be unique per Identity Provider')
37+
help='New federation protocol name (must be unique per identity '
38+
' provider)')
3839
parser.add_argument(
3940
'--identity-provider',
4041
metavar='<identity-provider>',
41-
help=('Identity Provider you want to add the Protocol to '
42-
'(must already exist)'), required=True)
42+
required=True,
43+
help='Identity provider that will support the new federation '
44+
' protocol (name or ID) (required)')
4345
parser.add_argument(
4446
'--mapping',
45-
metavar='<mapping>', required=True,
46-
help='Mapping you want to be used (must already exist)')
47+
metavar='<mapping>',
48+
required=True,
49+
help='Mapping that is to be used (name or ID) (required)')
4750

4851
return parser
4952

@@ -66,20 +69,22 @@ def take_action(self, parsed_args):
6669

6770

6871
class DeleteProtocol(command.Command):
69-
"""Delete Federation Protocol tied to a Identity Provider"""
72+
"""Delete a federation protocol"""
7073

7174
log = logging.getLogger(__name__ + '.DeleteProtocol')
7275

7376
def get_parser(self, prog_name):
7477
parser = super(DeleteProtocol, self).get_parser(prog_name)
7578
parser.add_argument(
7679
'federation_protocol',
77-
metavar='<name>',
78-
help='Protocol (must be unique per Identity Provider')
80+
metavar='<federation-protocol>',
81+
help='Federation protocol to delete (name or ID)')
7982
parser.add_argument(
8083
'--identity-provider',
81-
metavar='<identity-provider>', required=True,
82-
help='Identity Provider the Protocol is tied to')
84+
metavar='<identity-provider>',
85+
required=True,
86+
help='Identity provider that supports <federation-protocol> '
87+
'(name or ID) (required)')
8388

8489
return parser
8590

@@ -92,16 +97,17 @@ def take_action(self, parsed_args):
9297

9398

9499
class ListProtocols(lister.Lister):
95-
"""List Protocols tied to an Identity Provider"""
100+
"""List federation protocols"""
96101

97102
log = logging.getLogger(__name__ + '.ListProtocols')
98103

99104
def get_parser(self, prog_name):
100105
parser = super(ListProtocols, self).get_parser(prog_name)
101106
parser.add_argument(
102107
'--identity-provider',
103-
metavar='<identity-provider>', required=True,
104-
help='Identity Provider the Protocol is tied to')
108+
metavar='<identity-provider>',
109+
required=True,
110+
help='Identity provider to list (name or ID) (required)')
105111

106112
return parser
107113

@@ -118,7 +124,7 @@ def take_action(self, parsed_args):
118124

119125

120126
class SetProtocol(command.Command):
121-
"""Set Protocol tied to an Identity Provider"""
127+
"""Set federation protocol properties"""
122128

123129
log = logging.getLogger(__name__ + '.SetProtocol')
124130

@@ -127,21 +133,26 @@ def get_parser(self, prog_name):
127133
parser.add_argument(
128134
'federation_protocol',
129135
metavar='<name>',
130-
help='Protocol (must be unique per Identity Provider')
136+
help='Federation protocol to modify (name or ID)')
131137
parser.add_argument(
132138
'--identity-provider',
133-
metavar='<identity-provider>', required=True,
134-
help=('Identity Provider you want to add the Protocol to '
135-
'(must already exist)'))
139+
metavar='<identity-provider>',
140+
required=True,
141+
help='Identity provider that supports <federation-protocol> '
142+
'(name or ID) (required)')
136143
parser.add_argument(
137144
'--mapping',
138-
metavar='<mapping>', required=True,
139-
help='Mapping you want to be used (must already exist)')
145+
metavar='<mapping>',
146+
help='Mapping that is to be used (name or ID)')
140147
return parser
141148

142149
def take_action(self, parsed_args):
143150
identity_client = self.app.client_manager.identity
144151

152+
if not parsed_args.mapping:
153+
self.app.log.error("No changes requested")
154+
return
155+
145156
protocol = identity_client.federation.protocols.update(
146157
parsed_args.identity_provider, parsed_args.federation_protocol,
147158
parsed_args.mapping)
@@ -156,21 +167,22 @@ def take_action(self, parsed_args):
156167

157168

158169
class ShowProtocol(show.ShowOne):
159-
"""Show Protocol tied to an Identity Provider"""
170+
"""Display federation protocol details"""
160171

161172
log = logging.getLogger(__name__ + '.ShowProtocol')
162173

163174
def get_parser(self, prog_name):
164175
parser = super(ShowProtocol, self).get_parser(prog_name)
165176
parser.add_argument(
166177
'federation_protocol',
167-
metavar='<name>',
168-
help='Protocol (must be unique per Identity Provider')
178+
metavar='<federation-protocol>',
179+
help='Federation protocol to display (name or ID)')
169180
parser.add_argument(
170181
'--identity-provider',
171-
metavar='<identity-provider>', required=True,
172-
help=('Identity Provider you want to add the Protocol to '
173-
'(must already exist)'))
182+
metavar='<identity-provider>',
183+
required=True,
184+
help=('Identity provider that supports <federation-protocol> '
185+
'(name or ID) (required)'))
174186
return parser
175187

176188
def take_action(self, parsed_args):

0 commit comments

Comments
 (0)