Create an Index
post
/mobile/system/databaseManagement/tables/{table}/indexes
Creates an index for the table.
Request
Supported Media Types
- application/json
Path Parameters
-
table: string
The name of the table
Root Schema : index
Type:
object
The table index metadata.
Show Source
-
columns:
array indexColumns
Minimum Number of Items:
1
Unique Items Required:true
The indexed columns. -
name:
string
The index name.
Nested Schema : indexColumns
Type:
array
Minimum Number of Items:
1
Unique Items Required:
true
The indexed columns.
Show Source
Example Request (application/json)
{
"columns":[
"first_name",
"last_name"
],
"name":"my_index_name"
}
Response
Supported Media Types
- application/json
201 Response
The index was created successfully.
The table index metadata.
Root Schema : index
Type:
object
The table index metadata.
Show Source
-
columns:
array indexColumns
Minimum Number of Items:
1
Unique Items Required:true
The indexed columns. -
name:
string
The index name.
Nested Schema : indexColumns
Type:
array
Minimum Number of Items:
1
Unique Items Required:
true
The indexed columns.
Show Source
Example Response (application/json)
{
"columns":[
"first_name",
"last_name"
],
"name":"my_index_name"
}
409 Response
The index already exists. To modify the index, delete it and then create it again.
Root Schema : Error
Type:
object
Title:
Error
The error JSON object returned by the service.
Show Source
-
detail:
string
Message that provides the error details.
-
o:ecid:
string
Execution context ID, which is a unique identifier to correlate events or requests that are associated with the same transaction across several components.
-
o:errorCode:
string
The service's error code.
-
o:errorDetails:
array o:errorDetails
Minimum Number of Items:
0
Included when the error is caused by multiple issues. -
o:errorPath:
string
The relative point in the API path where the error occurred.
-
status:
integer
HTTP status code. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more details.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
Nested Schema : o:errorDetails
Type:
array
Minimum Number of Items:
0
Included when the error is caused by multiple issues.
Show Source
-
[0]:
object Error Detail
Title:
Error Detail
Nested Schema : Error Detail
Type:
object
Title:
Show Source
Error Detail
-
instance:
string
URI to the link that provides more detailed information about the error.
-
o:errorCode:
string
The service's error code.
-
o:errorPath:
string
The relative point in the API path where the error occurred.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
Examples
The following example shows how to create an index by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL.
curl -i
-X POST
-u username:password
-d @index.json
-H "Content-Type: application/json; charset=utf-8"
-H "Oracle-Mobile-Backend-ID: ABCDd59b-f13c-4722-81b8-4e719b5a4622"
https://fif.cloud.oracle.com/mobile/system/databaseManagement/tables/Movies/indexes
Example of Request Body
The following shows an example of the request body. This example creates an index on the inTheaters
and releaseDate
columns.
{
"columns":[
"inTheaters",
"releaseDate"
],
"name":"release"
}
Example of Response Header
The following shows an example of the response header:
200 OK Content-Type: application/json Date: Mon, 29 Jan 2017 20:32:51 GMT
Example of Response Body
The following example shows, in JSON format, the contents of the response body.
{
"name": "release",
"columns": [
"inTheaters",
"releaseDate"
]
}