This section describes the operations that can be performed on the endpoint /gsadmin/v1/cloud/redirects
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 |
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 objects 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" }, "Products": { "ecr:lastModifiedBy": "occ_admin", "ecr:lastModified": "2016-10-26T09:32:32.720-07:00", "ecr:createDate": "2016-10-26T09:32:32.720-07:00", "ecr:type": "redirect-group" } }
To export the full configuration of all child objects 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 redirects
object configuration 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 objects (redirect-group
objects ) of redirects
. The configuration of all objects is returned in a ZIP file. The ZIP file includes a file named _.json with the configuration of the redirects
object, and an additional _.json
file with partial configuration of each redirect-group
object.
F
or example, suppose that redirects
contains one redirect-group
, named Default
. The _.json
file that configures the redirects
objects 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 contains 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-id
.zip >pathname
/filename
.zip
Note: The ZIP file does not contain configuration of or list the grand-child objects of the targeted object.
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 through the same request that configures the redirects
object. For example, the POST endpoint above can import the following JSON content to configure not only the redirects
object, but also two redirect-group
objects and a redirect-entry
object within each redirect-group
object:
{ "ecr:type": "redirects", "Default": { "ecr:type": "redirect-group", "id1": { "ecr:type": "redirect-entry", "searchTerms": "fujifilm", "matchmode": "MATCHEXACT", "url": "/browse/Fujifilm/_/N-1z141wh" } }, "Products" : { "ecr:type": "redirect-group", "id3" : { "ecr:type": "redirect-entry", "searchTerms": "canon", "matchmode": "MATCHEXACT", "url": "/browse/Canon/_/N-1z141ya" } } }
Replace the entire redirects object
In JSON format, use a PUT endpoint to replace the redirects
object in its entirety 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 in its entirety 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": "/browse/Kodak/_/N-1z141wh" } }, "Products" : { "ecr:type": "redirect-group", "id3" : { "ecr:type": "redirect-entry", "searchTerms": "leica", "matchmode": "MATCHEXACT", "url": "/browse/Leica/_/N-1z141ya" } } }
Modify the redirects object
Use the following endpoint to modify the redirects
object:
PATCH /gsadmin/v1/cloud/redirects
Note: The PATCH method cannot be used with ZIP format.
A PATCH endpoint cannot access an object through its parent object. Thus, to modify a redirect-entry
object, you must use the following endpoint:
PATCH /gsadmin/v1/cloud/redirects/redirect-group-id
/redirect-entry
-name
For example, the following endpoint modifies the redirect-entry
object id1
under the redirect-group
object Default
:
PATCH /gsadmin/v1/cloud/redirects/Default/id1
For example, the following JSON illustrates content that can be provided as input to the endpoint above:
{ "searchTerms": "nikon", "ecr:lastModifiedBy": "occ_admin", "ecr:lastModified": "2016-10-26T17:45:02.799Z", "matchmode": "MATCHEXACT", "ecr:createDate": "2016-10-26T10:11:47.369-07:00", "url": "/browse/Nikon/_/N-1z141wh", "ecr:type": "redirect-entry" }
The endpoint above can then do one of two things:
If a
redirect-entry
object namedid1
is already configured, it modifiesid1
as necessary to make it identical to the JSON content above.If a
redirect-entry
object namedid1
does not exist, it returns an error stating that the resource does not exist.