|
26 | 26 | from openstack.network.v2 import pool_member as _pool_member |
27 | 27 | from openstack.network.v2 import port as _port |
28 | 28 | from openstack.network.v2 import quota as _quota |
| 29 | +from openstack.network.v2 import rbac_policy as _rbac_policy |
29 | 30 | from openstack.network.v2 import router as _router |
30 | 31 | from openstack.network.v2 import security_group as _security_group |
31 | 32 | from openstack.network.v2 import security_group_rule as _security_group_rule |
@@ -1199,6 +1200,91 @@ def update_quota(self, quota, **attrs): |
1199 | 1200 | """ |
1200 | 1201 | return self._update(_quota.Quota, quota, **attrs) |
1201 | 1202 |
|
| 1203 | + def create_rbac_policy(self, **attrs): |
| 1204 | + """Create a new RBAC policy from attributes |
| 1205 | +
|
| 1206 | + :param dict attrs: Keyword arguments which will be used to create a |
| 1207 | + :class:`~openstack.network.v2.rbac_policy.RBACPolicy`, |
| 1208 | + comprised of the properties on the RBACPolicy class. |
| 1209 | +
|
| 1210 | + :return: The results of RBAC policy creation |
| 1211 | + :rtype: :class:`~openstack.network.v2.rbac_policy.RBACPolicy` |
| 1212 | + """ |
| 1213 | + return self._create(_rbac_policy.RBACPolicy, **attrs) |
| 1214 | + |
| 1215 | + def delete_rbac_policy(self, rbac_policy, ignore_missing=True): |
| 1216 | + """Delete a RBAC policy |
| 1217 | +
|
| 1218 | + :param rbac_policy: The value can be either the ID of a RBAC policy or |
| 1219 | + a :class:`~openstack.network.v2.rbac_policy.RBACPolicy` instance. |
| 1220 | + :param bool ignore_missing: When set to ``False`` |
| 1221 | + :class:`~openstack.exceptions.ResourceNotFound` will be |
| 1222 | + raised when the RBAC policy does not exist. |
| 1223 | + When set to ``True``, no exception will be set when |
| 1224 | + attempting to delete a nonexistent RBAC policy. |
| 1225 | +
|
| 1226 | + :returns: ``None`` |
| 1227 | + """ |
| 1228 | + self._delete(_rbac_policy.RBACPolicy, rbac_policy, |
| 1229 | + ignore_missing=ignore_missing) |
| 1230 | + |
| 1231 | + def find_rbac_policy(self, id, ignore_missing=True): |
| 1232 | + """Find a single RBAC policy |
| 1233 | +
|
| 1234 | + :param id: The ID of a RBAC policy. |
| 1235 | + :param bool ignore_missing: When set to ``False`` |
| 1236 | + :class:`~openstack.exceptions.ResourceNotFound` will be |
| 1237 | + raised when the resource does not exist. |
| 1238 | + When set to ``True``, None will be returned when |
| 1239 | + attempting to find a nonexistent resource. |
| 1240 | + :returns: One |
| 1241 | + :class:`~openstack.network.v2.rbac_policy.RBACPolicy` or None |
| 1242 | + """ |
| 1243 | + return self._find(_rbac_policy.RBACPolicy, id, |
| 1244 | + ignore_missing=ignore_missing) |
| 1245 | + |
| 1246 | + def get_rbac_policy(self, rbac_policy): |
| 1247 | + """Get a single RBAC policy |
| 1248 | +
|
| 1249 | + :param rbac_policy: The value can be the ID of a RBAC policy or a |
| 1250 | + :class:`~openstack.network.v2.rbac_policy.RBACPolicy` instance. |
| 1251 | +
|
| 1252 | + :returns: One :class:`~openstack.network.v2.rbac_policy.RBACPolicy` |
| 1253 | + :raises: :class:`~openstack.exceptions.ResourceNotFound` |
| 1254 | + when no resource can be found. |
| 1255 | + """ |
| 1256 | + return self._get(_rbac_policy.RBACPolicy, rbac_policy) |
| 1257 | + |
| 1258 | + def rbac_policies(self, **query): |
| 1259 | + """Return a generator of RBAC policies |
| 1260 | +
|
| 1261 | + :param kwargs \*\*query: Optional query parameters to be sent to limit |
| 1262 | + the resources being returned. Available parameters include: |
| 1263 | +
|
| 1264 | + * tenant_id: The owner tenant ID. |
| 1265 | + * target_tenant: ID of the tenant to which the RBAC policy |
| 1266 | + will be enforced. |
| 1267 | + * object_type: Type of the object that RBAC policy affects. |
| 1268 | + * action: Action for the RBAC policy. |
| 1269 | +
|
| 1270 | + :returns: A generator of rbac objects |
| 1271 | + :rtype: :class:`~openstack.network.v2.rbac_policy.RBACPolicy` |
| 1272 | + """ |
| 1273 | + return self._list(_rbac_policy.RBACPolicy, paginated=False, **query) |
| 1274 | + |
| 1275 | + def update_rbac_policy(self, rbac_policy, **attrs): |
| 1276 | + """Update a RBAC policy |
| 1277 | +
|
| 1278 | + :param rbac_policy: Either the id of a RBAC policy or a |
| 1279 | + :class:`~openstack.network.v2.rbac_policy.RBACPolicy` instance. |
| 1280 | + :attrs kwargs: The attributes to update on the RBAC policy represented |
| 1281 | + by ``value``. |
| 1282 | +
|
| 1283 | + :returns: The updated RBAC policy |
| 1284 | + :rtype: :class:`~openstack.network.v2.rbac_policy.RBACPolicy` |
| 1285 | + """ |
| 1286 | + return self._update(_rbac_policy.RBACPolicy, rbac_policy, **attrs) |
| 1287 | + |
1202 | 1288 | def create_router(self, **attrs): |
1203 | 1289 | """Create a new router from attributes |
1204 | 1290 |
|
|
0 commit comments