[identity][POST /v3/policies] Wrong response

This patch does:
- Added user_id and project_id to sample JSON request and response.
- Marked user_id and project_id as "Optional" on parameter table
of "Create policy" API.

Change-Id: Ib7f8852487c626c039bb71acfec7e215e1e489ba
Closes-Bug: #1538556
This commit is contained in:
Anh Tran 2016-01-28 20:16:23 +07:00
parent f31c7c83b7
commit ee9129f641
3 changed files with 50 additions and 6 deletions

View File

@ -1785,6 +1785,16 @@
</para>
</wadl:doc>
</param>'>
<!ENTITY policy_create-project_idRequestParameter '
<param name="project_id" style="plain" type="csapi:UUID"
xmlns="http://wadl.dev.java.net/2009/02" required="false">
<wadl:doc xmlns:wadl="http://wadl.dev.java.net/2009/02"
xmlns="http://docbook.org/ns/docbook" xml:lang="EN">
<para>
The UUID for the associated project.
</para>
</wadl:doc>
</param>'>
<!ENTITY policy-typeRequestParameter '
<param name="type" style="plain" type="xsd:string"
xmlns="http://wadl.dev.java.net/2009/02" required="true">
@ -1811,6 +1821,16 @@
</para>
</wadl:doc>
</param>'>
<!ENTITY policy_create-user_idRequestParameter '
<param name="user_id" style="plain" type="xsd:string"
xmlns="http://wadl.dev.java.net/2009/02" required="false">
<wadl:doc xmlns:wadl="http://wadl.dev.java.net/2009/02"
xmlns="http://docbook.org/ns/docbook" xml:lang="EN">
<para>
The ID of the user who owns the policy.
</para>
</wadl:doc>
</param>'>
<!-- ************************************ -->
<!-- POLICY RESPONSE PARAMETERS -->
<!-- ************************************ -->
@ -1874,6 +1894,16 @@
</para>
</wadl:doc>
</param>'>
<!ENTITY policy_create-project_idResponseParameter '
<param name="project_id" style="plain" type="csapi:UUID"
xmlns="http://wadl.dev.java.net/2009/02" required="false">
<wadl:doc xmlns:wadl="http://wadl.dev.java.net/2009/02"
xmlns="http://docbook.org/ns/docbook" xml:lang="EN">
<para>
The UUID for the associated project.
</para>
</wadl:doc>
</param>'>
<!ENTITY policy-rule-blobResponseParameter '
<param name="blob" style="plain" type="xsd:string"
xmlns="http://wadl.dev.java.net/2009/02" required="true">
@ -1911,6 +1941,16 @@
</para>
</wadl:doc>
</param>'>
<!ENTITY policy_create-user_idResponseParameter '
<param name="user_id" style="plain" type="xsd:string"
xmlns="http://wadl.dev.java.net/2009/02" required="false">
<wadl:doc xmlns:wadl="http://wadl.dev.java.net/2009/02"
xmlns="http://docbook.org/ns/docbook" xml:lang="EN">
<para>
The ID of the user who owns the policy.
</para>
</wadl:doc>
</param>'>
<!-- ************************************ -->
<!-- PROJECTS -->
<!-- ************************************ -->
@ -3259,7 +3299,7 @@
<para>
(Since v3.1) Additionally, if your default project is
not valid, a token is issued without an explicit scope of
authorization.
authorization.
</para>
</wadl:doc>
</param>'>

View File

@ -1,8 +1,12 @@
{
"policy": {
"user_id": "0ffd248c55b443eaac5253b4e9cbf9b5",
"links": {
"self": "http://identity:35357/v3/policies/88f5b83f8f8e41daba4c25eed1a7bbc6"
},
"blob": "{'foobar_user': 'role:compute-user'}",
"project_id": "0426ac1e48f642ef9544c2251e07e261",
"type": "application/json",
"user_id": "0ffd248c55b443eaac5253b4e9cbf9b5"
"id": "88f5b83f8f8e41daba4c25eed1a7bbc6"
}
}

View File

@ -1538,9 +1538,9 @@
</wadl:doc>
&policyObjectParameter;
&policy-blobRequestParameter;
&policy-project_idRequestParameter;
&policy-mime-typeRequestParameter;
&policy-user_idRequestParameter;
&policy_create-project_idRequestParameter;
&policy_create-user_idRequestParameter;
</representation>
</request>
<response status="201">
@ -1556,9 +1556,9 @@
&policy-rule-blobResponseParameter;
&policy-idResponseParameter;
&policy-linksResponseParameter;
&policy-project_idResponseParameter;
&policy-mime-typeResponseParameter;
&policy-user_idResponseParameter;
&policy_create-project_idResponseParameter;
&policy_create-user_idResponseParameter;
</representation>
</response>
&postPutDeleteFaults;