JSON format is a convenient technique for retrieving the configuration of individual resources and saving the configuration on the system. The feature is useful for configuring individual resources.
Note: Currently, only the following resources can be retrieved and saved in JSON format:
searchInterfacesearchInterface/AllsearchIndexConfig
Retrieve configuration in JSON format
A request to retrieve configuration using the JSON format is of the following form:
GET /gsadmin/v1/cloud/resourcePath.json
where:
resourcePathspecifies the location of the particular resource to the retrieved.
.jsonindicates that JSON format is used. The .JSONextension is used only with theGETmethod.
Note: The retrieved configuration does not include the configuration of any child-resources of the resource at resourcePath.
For example, the following GET request obtains the configuration of the search interface All:
GET http://host:port/gsadmin/v1/cloud/searchInterfaces/All.json
Import configuration in JSON format
To import configuration in JSON format, you must specify application/JSON in a Content-Type HTTP header, and provide the JSON configuration in the body of the request.
JSON format supports three different methods for importing content:
POST: Creates configuration of a currently unconfigured resource. In JSON format, the POST command requires that the JSON configuration be included in a
:contentform parameter.PUT: Overwrites configuration of a currently configured resource. The configuration to be imported must be included in the body of the PUT request.
PATCH: Modifies existing configuration by replacing attributes in the configuration or adding attributes to it. The configuration to be imported must be included in the body of the PATCH request.
Note: Oracle recommends that you back up a resource before you overwrite it using POST (ZIP format), PUT, or PATCH.
For example, the following POST request imports configuration for searchIndexConfig, overwriting any existing configuration of that resource:
POST http://host:port/gsadmin/v1/cloud/searchIndexConfig/All
Content-Type: application/json
:content = {
"ecr:type": "search-index-config",
"defaultLocale": "en",
"locales": [
"en-GB",
"fr-CA",
"de",
"es"
]
}

