python-openstackclient/doc/source/command-objects/project.rst
adrian-turjak 49f6032b69 Non-Admin can't list own projects
Due to a default Keystone policy until Newtown,
and the use of resource_find, non-admins are unable
to list their own projects.

This patch bypasses this problem while also introducing better
UX for non-admins wishing to get their project list.

'openstack project list' retains the default of 'list all projects'
but on a forbidden error will default instead to 'list my projects'.
This way for non-admins 'list my projects' feels like the default
without breaking the expected admin default.

Adding the '--my-projects' option allows admins to easily list their
own projects or allows non-admins to be explicit and bypass the
forbidden error fallback.

Change-Id: I1021276f69fbbf28e13e17c4e567d932fce7ed8b
Closes-Bug: #1627555
2017-03-20 14:40:56 +13:00

4.2 KiB

project

Identity v2, v3

project create

Create new project

project create

openstack project create
    [--domain <domain>]
    [--parent <project>]
    [--description <description>]
    [--enable | --disable]
    [--property <key=value>]
    [--or-show]
    <name>

--domain <domain>

Domain owning the project (name or ID)

3

--parent <project>

Parent of the project (name or ID)

3

--description <description>

Project description

--enable

Enable project (default)

--disable

Disable project

--property <key=value>

Add a property to \<name\> <project_create-name> (repeat option to set multiple properties)

--or-show

Return existing project

If the project already exists return the existing project data and do not fail.

New project name

project delete

Delete project(s)

project delete

openstack project delete
    [--domain <domain>]
    <project> [<project> ...]

--domain <domain>

Domain owning \<project\> <project_delete-project> (name or ID)

3

Project to delete (name or ID)

project list

List projects

project list

openstack project list
    [--domain <domain>]
    [--user <user>]
    [--my-projects]
    [--long]
    [--sort <key>[:<direction>,<key>:<direction>,..]]

--domain <domain>

Filter projects by \<domain\> <--domain> (name or ID)

3

--user <user>

Filter projects by \<user\> <--user> (name or ID)

3

--my-projects

List projects for the authenticated user. Supersedes other filters.

3

--long

List additional fields in output

--sort <key>[:<direction>,<key>:<direction>,..]

Sort output by selected keys and directions (asc or desc) (default: asc), multiple keys and directions can be specified --sort <key>[:<direction>,<key>:<direction>,..]

project set

Set project properties

project set

openstack project set
    [--name <name>]
    [--domain <domain>]
    [--description <description>]
    [--enable | --disable]
    [--property <key=value>]
    <project>

--name <name>

Set project name

--domain <domain>

Domain owning \<project\> <project_set-project> (name or ID)

3

--description <description>

Set project description

--enable

Enable project (default)

--disable

Disable project

--property <key=value>

Set a property on \<project\> <project_set-project> (repeat option to set multiple properties)

Identity version 2 only

Project to modify (name or ID)

project show

Display project details

project show

openstack project show
    [--domain <domain>]
    <project>

--domain <domain>

Domain owning \<project\> <project_show-project> (name or ID)

3

--parents

Show the project's parents as a list

3

--children

Show project's subtree (children) as a list

3

Project to display (name or ID)

project unset

Unset project properties

Identity version 2 only

project unset

openstack project unset
    --property <key> [--property <key> ...]
    <project>

--property <key>

Property key to remove from project (repeat option to remove multiple properties)

<project>

Project to modify (name or ID)