This section describes the operations that can be performed to export, create, replace, and modify configuration of the redirects
object. It contains the following sections:
redirects object attribute
The following table summarizes the attribute of redirects
objects.
Attribute | Required? | Type | Values |
---|---|---|---|
| yes | String |
There can be only one |
Note: You cannot add attributes to or modify the attribute value of the redirects
object. You can only create it, if for any reason it is missing.
Export redirects object in json format
Use the following endpoint to export configuration of the redirects
object, in JSON format:
GET /gsadmin/v1/cloud/redirects.json
In JSON format, the GET endpoint returns full configuration of the redirects
object, and lists the child object, Default
, of the redirects
object; for example:
{ "ecr:lastModifiedBy": "occ_admin", "ecr:lastModified": "2016-10-26T09:32:32.602-07:00", "ecr:createDate": "2016-10-26T09:32:32.602-07:00", "ecr:type": "redirects", "Default": { "ecr:lastModifiedBy": "occ_admin", "ecr:lastModified": "2016-10-26T09:32:32.661-07:00", "ecr:createDate": "2016-10-26T09:32:32.661-07:00", "ecr:type": "redirect-group" } }
To export the full configuration of the child object of the redirects
object, use the GET method in ZIP format, as described in the following section.
Export redirects object in ZIP format
Use the following endpoint to export configuration of the redirects
object in ZIP format:
GET /gsadmin/v1/cloud/redirects.zip
In ZIP format, the GET endpoint returns not only the redirects
object, but also the immediate child object (redirect-group
) of redirects
.
The configuration of all objects is returned in a ZIP file. The ZIP file includes a file named _.json
containing the configuration of the redirects
object, and an additional _.json
file containing partial configuration of the redirect-group
object.
For example, suppose that the redirects
object contains a redirect-group
named Default
. The _.json
file that configures the redirects
object contains the following:
{ "ecr:lastModifiedBy": "admin", "ecr:lastModified": "2016-10-17T05:25:35.760-07:00", "ecr:createDate": "2016-10-17T05:25:35.760-07:00", "ecr:type": "redirects" }
The _.json
file that configures the redirect-group
object named Default
is contained in a directory named Default within the ZIP file. This _.json
file contains configuration such as the following:
{ "ecr:lastModifiedBy": "admin", "ecr:lastModified": "2016-10-24T07:57:48.924-07:00", "ecr:createDate": "2016-10-24T07:57:48.924-07:00", "ecr:type": "redirect-group" }
To get full configuration of a redirect-group
object, specify the following endpoint:
GET /gsadmin/v1/cloud/redirects/redirect-group-name
.zippathname
/filename
.zip
Create a redirects object
Use the following endpoint to configure the redirects
object, in JSON format or ZIP format:
POST /gsadmin/v1/cloud/redirects
For most purposes, it is convenient to configure all child objects of redirects
through the same request that configures redirects
.
For example, the POST endpoint above can import the following JSON content to configure not only the redirects
object, but also a redirect-group
object named Default
and a redirect-entry
object named id1
within the redirect-group
object:
{ "ecr:type": "redirects", "Default": { "ecr:type": "redirect-group", "id1": { "ecr:type": "redirect-entry", "searchTerms": "fujifilm", "matchmode": "MATCHEXACT", "url": "http://www.acme.com/about-us" } } }
Replace the redirects object and its children
In JSON format, use a PUT endpoint to replace the redirects
object and all its child objects with the content provided as input to the endpoint:
PUT /gsadmin/v1/cloud/redirects
Note: The PUT method cannot be used with ZIP format.
In ZIP format, use a POST endpoint to replace the redirects
object and all its child objects with the content provided as input to the endpoint:
POST /gsadmin/v1/cloud/redirects
For example, the PUT and POST endpoints above can import the following JSON content to replace all existing configuration of the redirects
object and its child objects:
{ "ecr:type": "redirects", "Default": { "ecr:type": "redirect-group", "id1": { "ecr:type": "redirect-entry", "searchTerms": "kodak", "matchmode": "MATCHEXACT", "url": "http://www.acme.com/about-us" } } }