doc-exports/docs/obs/api-swift/obs_03_0007.html
zhangyue 894279c39a Object Storage Service API Reference Swift V1
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2023-02-02 08:50:48 +00:00

89 lines
7.3 KiB
HTML

<a name="obs_03_0007"></a><a name="obs_03_0007"></a>
<h1 class="topictitle1">Locating a Resource</h1>
<div id="body8662426"><p id="obs_03_0007__p52452228">In REST, specific information or data on a network is represented by a resource, which is referenced with a uniform resource identifier (URI). Clients on a network can locate resources using uniform resource locators (URLs). In OBS (compatible with OpenStack Swift), a resource can be an account, container, object, or specific resource related to an account, container, or object. Such a resource is identified by a URL and can be operated after requests are sent using the URL.</p>
<p id="obs_03_0007__p60849796">The common URL format is as follows (the content in brackets ([ ]) is optional):</p>
<p id="obs_03_0007__p16350278">protocol ://hostname[:port] /v1/account[/container] [/object] [?param]</p>
<p id="obs_03_0007__p32077368"><a href="obs_03_0007.html#obs_03_0007__table6854763">Table 1</a> describes parameters in a URL.</p>
<div class="tablenoborder"><a name="obs_03_0007__table6854763"></a><a name="table6854763"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_03_0007__table6854763" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URL parameters</caption><thead align="left"><tr id="obs_03_0007__row32038589"><th align="left" class="cellrowborder" valign="top" width="17.11%" id="mcps1.3.5.2.4.1.1"><p id="obs_03_0007__p44988935">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="65.60000000000001%" id="mcps1.3.5.2.4.1.2"><p id="obs_03_0007__p20225109">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.29%" id="mcps1.3.5.2.4.1.3"><p id="obs_03_0007__p65584754">Required or Optional</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_03_0007__row27621136"><td class="cellrowborder" valign="top" width="17.11%" headers="mcps1.3.5.2.4.1.1 "><p id="obs_03_0007__p54018267">protocol</p>
</td>
<td class="cellrowborder" valign="top" width="65.60000000000001%" headers="mcps1.3.5.2.4.1.2 "><p id="obs_03_0007__p26810586">The protocol used for sending requests. Possible values include HTTP and HTTPS.</p>
<p id="obs_03_0007__p39968683">You can specify HTTPS to ensure secure access to resources.</p>
</td>
<td class="cellrowborder" valign="top" width="17.29%" headers="mcps1.3.5.2.4.1.3 "><p id="obs_03_0007__p14183880">Required</p>
</td>
</tr>
<tr id="obs_03_0007__row53749059"><td class="cellrowborder" valign="top" width="17.11%" headers="mcps1.3.5.2.4.1.1 "><p id="obs_03_0007__p63226018">hostname</p>
</td>
<td class="cellrowborder" valign="top" width="65.60000000000001%" headers="mcps1.3.5.2.4.1.2 "><p id="obs_03_0007__p5659133">The host name, namely, the domain name or service IP address of OBS (compatible with OpenStack Swift).</p>
</td>
<td class="cellrowborder" valign="top" width="17.29%" headers="mcps1.3.5.2.4.1.3 "><p id="obs_03_0007__p34112870">Required</p>
</td>
</tr>
<tr id="obs_03_0007__row48680776"><td class="cellrowborder" valign="top" width="17.11%" headers="mcps1.3.5.2.4.1.1 "><p id="obs_03_0007__p44771124">port</p>
</td>
<td class="cellrowborder" valign="top" width="65.60000000000001%" headers="mcps1.3.5.2.4.1.2 "><p id="obs_03_0007__p49971353155110">The port enabled for protocols used for sending requests. The value varies with software server deployment. In OBS (compatible with OpenStack Swift), the HTTP port is <strong id="obs_03_0007__b403665502162048">80</strong> and the HTTPS port is <strong id="obs_03_0007__b1793576432162048">443</strong>. If this parameter is not specified, the default port will be used.</p>
</td>
<td class="cellrowborder" valign="top" width="17.29%" headers="mcps1.3.5.2.4.1.3 "><p id="obs_03_0007__p35946674">Optional</p>
</td>
</tr>
<tr id="obs_03_0007__row10729716172858"><td class="cellrowborder" valign="top" width="17.11%" headers="mcps1.3.5.2.4.1.1 "><p id="obs_03_0007__p63800683172858">v1</p>
</td>
<td class="cellrowborder" valign="top" width="65.60000000000001%" headers="mcps1.3.5.2.4.1.2 "><p id="obs_03_0007__p472863172858">The version used in the request. <strong id="obs_03_0007__b46555465">v1</strong> indicates the object storage version.</p>
</td>
<td class="cellrowborder" valign="top" width="17.29%" headers="mcps1.3.5.2.4.1.3 "><p id="obs_03_0007__p25767589173144">Required</p>
</td>
</tr>
<tr id="obs_03_0007__row59923241172854"><td class="cellrowborder" valign="top" width="17.11%" headers="mcps1.3.5.2.4.1.1 "><p id="obs_03_0007__p21944357172854">account</p>
</td>
<td class="cellrowborder" valign="top" width="65.60000000000001%" headers="mcps1.3.5.2.4.1.2 "><p id="obs_03_0007__p32662489172854">A user path. Each path identifies a unique user in the system. An account consists of a management prefix and a project ID, for example, <strong id="obs_03_0007__b842352706101410">AUTH_</strong><em id="obs_03_0007__i842352697101413">ProjectID</em>.</p>
</td>
<td class="cellrowborder" valign="top" width="17.29%" headers="mcps1.3.5.2.4.1.3 "><p id="obs_03_0007__p28415982172854">Required</p>
</td>
</tr>
<tr id="obs_03_0007__row10118767"><td class="cellrowborder" valign="top" width="17.11%" headers="mcps1.3.5.2.4.1.1 "><p id="obs_03_0007__p42763981">container</p>
</td>
<td class="cellrowborder" valign="top" width="65.60000000000001%" headers="mcps1.3.5.2.4.1.2 "><p id="obs_03_0007__p52847049">A container path.</p>
</td>
<td class="cellrowborder" valign="top" width="17.29%" headers="mcps1.3.5.2.4.1.3 "><p id="obs_03_0007__p48772767">Optional</p>
</td>
</tr>
<tr id="obs_03_0007__row32859274"><td class="cellrowborder" valign="top" width="17.11%" headers="mcps1.3.5.2.4.1.1 "><p id="obs_03_0007__p62499712">object</p>
</td>
<td class="cellrowborder" valign="top" width="65.60000000000001%" headers="mcps1.3.5.2.4.1.2 "><p id="obs_03_0007__p37952466">An object path.</p>
</td>
<td class="cellrowborder" valign="top" width="17.29%" headers="mcps1.3.5.2.4.1.3 "><p id="obs_03_0007__p59198213">Optional</p>
</td>
</tr>
<tr id="obs_03_0007__row55809335"><td class="cellrowborder" valign="top" width="17.11%" headers="mcps1.3.5.2.4.1.1 "><p id="obs_03_0007__p54685102">param</p>
</td>
<td class="cellrowborder" valign="top" width="65.60000000000001%" headers="mcps1.3.5.2.4.1.2 "><p id="obs_03_0007__p47559554">The specific resource. By default, it is the requested container or object itself.</p>
</td>
<td class="cellrowborder" valign="top" width="17.29%" headers="mcps1.3.5.2.4.1.3 "><p id="obs_03_0007__p58187889">Optional</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="notice" id="obs_03_0007__note5961720811339"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="obs_03_0007__p6679283111339">For security reasons, HTTP is not recommended. HTTPS should be used instead.</p>
<p id="obs_03_0007__p47311530161543">In OBS (compatible with OpenStack Swift), HTTPS supports TLS 1.2 only.</p>
</div></div>
<div class="note" id="obs_03_0007__note17112947165810"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_03_0007__p60908996165817">If the version in a URL is set to V1 (the correct one is actually v1), OBS (compatible with OpenStack Swift) returns a 404 Not Found error code, whereas OpenStack Swift returns a 400 Bad Request error code.</p>
</div></div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_03_0006.html">Methods of Calling APIs</a></div>
</div>
</div>