doc-exports/docs/iam/api-ref/en-us_topic_0066154566.html
zhangyue 3b5a58b1fe IAM API 2.0.38
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2022-10-26 04:31:24 +00:00

163 lines
13 KiB
HTML

<a name="en-us_topic_0066154566"></a><a name="en-us_topic_0066154566"></a>
<h1 class="topictitle1">Modifying Project Data</h1>
<div id="body1499771471794"><div class="section" id="en-us_topic_0066154566__section136583151330"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0066154566__p11708905118">This API is used to modify project information.</p>
</div>
<div class="section" id="en-us_topic_0066154566__section9658161518332"><h4 class="sectiontitle">URI</h4><ul id="en-us_topic_0066154566__ul17658915123319"><li id="en-us_topic_0066154566__li465819157330">URI format<p id="en-us_topic_0066154566__p4658715203318"><a name="en-us_topic_0066154566__li465819157330"></a><a name="li465819157330"></a>PATCH /v3/projects/{project_id}</p>
</li></ul>
<ul id="en-us_topic_0066154566__ul465810152335"><li id="en-us_topic_0066154566__li0658171513339">URI parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0066154566__table1765831514339" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0066154566__row136591215133314"><th align="left" class="cellrowborder" valign="top" width="18.37%" id="mcps1.3.2.3.1.1.1.5.1.1"><p id="en-us_topic_0066154566__p66598151330"><strong id="en-us_topic_0066154566__b53311302182144">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.89%" id="mcps1.3.2.3.1.1.1.5.1.2"><p id="en-us_topic_0066154566__p1565991583314"><strong id="en-us_topic_0066154566__b13290795182156_1">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.41%" id="mcps1.3.2.3.1.1.1.5.1.3"><p id="en-us_topic_0066154566__p9659315143313"><strong id="en-us_topic_0066154566__b1400565718225_1">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.330000000000005%" id="mcps1.3.2.3.1.1.1.5.1.4"><p id="en-us_topic_0066154566__p4659131573319"><strong id="en-us_topic_0066154566__b15483672182216">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0066154566__row365911520332"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="en-us_topic_0066154566__p37620953151130">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="18.89%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="en-us_topic_0066154566__p20659171513317">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.41%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="en-us_topic_0066154566__p5659191514336">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.330000000000005%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="en-us_topic_0066154566__p56591315203314">Project ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="en-us_topic_0066154566__section4659131517333"><h4 class="sectiontitle">Request Parameters</h4><ul id="en-us_topic_0066154566__ul6659161513333"><li id="en-us_topic_0066154566__li86592155333">Parameters in the request header
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0066154566__table9659111593317" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0066154566__row76601115103317"><th align="left" class="cellrowborder" valign="top" width="18.36816318368163%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="en-us_topic_0066154566__p15660215143314"><strong id="en-us_topic_0066154566__b51854391182410">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.85811418858114%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="en-us_topic_0066154566__p1366016151333"><strong id="en-us_topic_0066154566__b13290795182156_3">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.238176182381764%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="en-us_topic_0066154566__p12660141523316"><strong id="en-us_topic_0066154566__b1400565718225_3">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.535546445355465%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="en-us_topic_0066154566__p366041510334"><strong id="en-us_topic_0066154566__b4654987182428">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0066154566__row16601915183311"><td class="cellrowborder" valign="top" width="18.36816318368163%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0066154566__p066081553317">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="18.85811418858114%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0066154566__p18660191533319">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.238176182381764%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0066154566__p13660141512331">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.535546445355465%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0066154566__p1066031573318">Text type and encoding mode.</p>
<p id="en-us_topic_0066154566__p5660181593311">Fill <strong id="en-us_topic_0066154566__b842352706161331">application/json;charset=utf8</strong> in this field.</p>
</td>
</tr>
<tr id="en-us_topic_0066154566__row6660191533312"><td class="cellrowborder" valign="top" width="18.36816318368163%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0066154566__p11660915173320">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="18.85811418858114%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0066154566__p146607157336">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.238176182381764%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0066154566__p966071513313">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.535546445355465%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0066154566__p2219223591414">Authenticated token with the <strong id="en-us_topic_0066154566__b750798910387">Security Administrator</strong> permission.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0066154566__ul6660181518336"><li id="en-us_topic_0066154566__li136601815183319">Parameters in the request body
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0066154566__table46601915113311" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0066154566__row126611515123310"><th align="left" class="cellrowborder" valign="top" width="18.37%" id="mcps1.3.3.3.1.1.1.5.1.1"><p id="en-us_topic_0066154566__p196611915173316"><strong id="en-us_topic_0066154566__b12756667182446">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.72%" id="mcps1.3.3.3.1.1.1.5.1.2"><p id="en-us_topic_0066154566__p1966141515334"><strong id="en-us_topic_0066154566__b2980390182457">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.37%" id="mcps1.3.3.3.1.1.1.5.1.3"><p id="en-us_topic_0066154566__p866110159333"><strong id="en-us_topic_0066154566__b1400565718225_5">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.54%" id="mcps1.3.3.3.1.1.1.5.1.4"><p id="en-us_topic_0066154566__p66619159336"><strong id="en-us_topic_0066154566__b9907860182436">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0066154566__row10661141573316"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.3.1.1.1.5.1.1 "><p id="en-us_topic_0066154566__p46611015103314">name</p>
</td>
<td class="cellrowborder" valign="top" width="18.72%" headers="mcps1.3.3.3.1.1.1.5.1.2 "><p id="en-us_topic_0066154566__p366191510336">No</p>
</td>
<td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.3.1.1.1.5.1.3 "><p id="en-us_topic_0066154566__p26611515103318">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.54%" headers="mcps1.3.3.3.1.1.1.5.1.4 "><p id="en-us_topic_0066154566__p066131553314">Project name, which must start with the ID of an existing region and be less than or equal to 64 characters.</p>
<p id="en-us_topic_0066154566__p646762814348">Example: <em id="en-us_topic_0066154566__i14525175082319">{region}</em><strong id="en-us_topic_0066154566__b172651454142311">_test2</strong></p>
</td>
</tr>
<tr id="en-us_topic_0066154566__row1661101514336"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.3.1.1.1.5.1.1 "><p id="en-us_topic_0066154566__p1766110156335">description</p>
</td>
<td class="cellrowborder" valign="top" width="18.72%" headers="mcps1.3.3.3.1.1.1.5.1.2 "><p id="en-us_topic_0066154566__p1466116158331">No</p>
</td>
<td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.3.1.1.1.5.1.3 "><p id="en-us_topic_0066154566__p1566181512332">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.54%" headers="mcps1.3.3.3.1.1.1.5.1.4 "><p id="en-us_topic_0066154566__p186611215103311">Project description, which can contain a maximum of 255 characters.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0066154566__ul16661111516336"><li id="en-us_topic_0066154566__li6661181511339">Example Request<pre class="screen" id="en-us_topic_0066154566__screen1666181563310">curl -i -k -H "X-Auth-Token:$token" -H 'Content-Type:application/json;charset=utf8' -X PATCH -d '{"project":{"name":"region_test2","description":"test_project_desc"}}' <em id="en-us_topic_0066154566__i5844137113119">https://sample.domain.com</em>/v3/projects/23da5961c8214f5caf701c27d9703959</pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0066154566__section116611315193312"><h4 class="sectiontitle">Response Parameters</h4><p id="en-us_topic_0066154566__p14009291184813">Example Response</p>
<pre class="screen" id="en-us_topic_0066154566__screen12661111523315">{
"project": {
"is_domain": false,
"description": "test_project_desc",
"links": {
"self": "<em id="en-us_topic_0066154566__i28112316575">https://sample.domain.com</em>/v3/projects/23da5961c8214f5caf701c27d9703959"
},
"enabled": true,
"id": "23da5961c8214f5caf701c27d9703959",
"parent_id": "d1294857fdf64251994892b344f53e88",
"domain_id": "d1294857fdf64251994892b344f53e88",
"name": "region_test2"
}
}</pre>
</div>
<div class="section" id="en-us_topic_0066154566__section36611815103319"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0066154566__table156611415193318" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0066154566__row2066121533319"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.1"><p id="en-us_topic_0066154566__p46611151332"><strong id="en-us_topic_0066154566__b25940534182714">Status Code</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.2"><p id="en-us_topic_0066154566__p566114154334"><strong id="en-us_topic_0066154566__b37731373182726">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0066154566__row1166116156330"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0066154566__p6661181583317">200</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0066154566__p196611715173319">The request is successful.</p>
</td>
</tr>
<tr id="en-us_topic_0066154566__row12661131516333"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0066154566__p17661121514334">400</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0066154566__p666114154335">The server failed to process the request.</p>
</td>
</tr>
<tr id="en-us_topic_0066154566__row3661115103315"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0066154566__p16661191593311">401</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0066154566__p26611915193313">Authentication failed.</p>
</td>
</tr>
<tr id="en-us_topic_0066154566__row156611915163319"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0066154566__p1366191518335">403</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0066154566__p666191513317">Access denied.</p>
</td>
</tr>
<tr id="en-us_topic_0066154566__row18867124011346"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0066154566__p14867104033419">409</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0066154566__p3867204073419">Duplicate project name.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0057845642.html">Project Management</a></div>
</div>
</div>