This section explains how to create a project and then check that it was created properly.
In K5, the virtual resources, groups and users to be used in a contract are divided up and managed by project.
Note that a project can also be referred to as a "tenant" in the API.
Note: You cannot delete projects that have been created.
-
Set the environment variables below as follows:
$ TENANT_NAME=<projName>
$ DESCRIPTION=<projDesc>
-
Execute the following API:
$ curl -X POST -Ss $IDENTITY/v3/projects \
-H "X-Auth-Token:$OS_AUTH_TOKEN" -H "Content-Type:application/json" \
-d '{"project": {"name": "'$TENANT_NAME'",
"description": "'$DESCRIPTION'", "domain_id": "'$DOMAIN_ID'",
"enabled": true}}' | jq .
-
The following response is output:
{
"project": {
"description": "<projDesc>",
"links": {
"self": "http://identity.cloud.global.fujitsu.com/v3/projects/<createdProjId>"
},
"enabled": true,
"id": "<createdProjId>",
"domain_id": "<contractOrgNoToWhichUserBelongs>",
"name": "<createdProjName>"
}
}
-
Check the created project:
$ curl -X GET -Ss $IDENTITY/v3/projects?domain_id=$DOMAIN_ID \
-H "X-Auth-Token:$OS_AUTH_TOKEN" -H "Content-Type:application/json" | \
jq .
-
If the project, including the specified project name, is output as follows, creation is complete.
{
"links": {
"self": "http://identity.cloud.global.fujitsu.com/v3/projects",
"previous": null,
"next": null
},
"projects": [
...
{
"description": "<projDesc>",
"links": {
"self": "http://identity.cloud.global.fujitsu.com/v3/projects/<createdProjId>"
},
"enabled": true,
"id": "<createdProjId>",
"domain_id": "<contractOrgNoToWhichUserBelongs>",
"name": "<createdProjName>"
},
...
]
}