This section describes how to get, create, modify, and replace the configuration of a redirect-group object. It contains the following sections:

Redirect-group object attributes

The following table lists the attributes of a redirect-group object:

Attribute

Required?

Type

Values

"ecr:type"

yes

String

redirect-group (required value)

Note: For almost all purposes, only one redirect-group object needs to be configured. Each redirect-group object, however, can contain one or more redirect-entries child objects.

See Sample redirects configuration.

Export the redirect-group object in ZIP format

Use an endpoint of the following form to export configuration of a redirect-group object in ZIP format:

GET /gsadmin/v1/cloud/redirects/redirect-group-name.ZIP

The ZIP file in which the configuration is downloaded contains the following _.JSON files:

{
  "ecr:lastModifiedBy": "occ_admin",
  "ecr:lastModified": "2016-10-26T17:11:47.308Z",
  "ecr:createDate": "2016-10-26T09:32:32.602-07:00",
  "ecr:type": "redirects"
}
{
  "ecr:lastModifiedBy": "occ_admin",
  "ecr:lastModified": "2016-10-26T10:11:47.369-07:00",
  "ecr:createDate": "2016-10-26T10:11:47.369-07:00",
  "ecr:type": "redirect-group",
  "id1": {
    "ecr:type": "redirect-entry",
    "searchTerms": "canon",
    "matchmode": "MATCHEXACT",
    "url": "http://www.acme.com/about-us",
    "searchTermExpansions": {
      "0":{"canon": ["canon"]}
    }
  },
  "id2": {
    "ecr:type": "redirect-entry",
    "searchTerms": "contacts",
    "matchmode": "MATCHEXACT",
    "url": "/contact-us",
    "searchTermExpansions": {
      "0": {"contacts": ["contact"]}
    }
  }
}

Note: searchTermExpansions is a system-generated attribute. Do not delete or modify it.

Export the redirect-group object in JSON format

Use an endpoint of the following form to export configuration of a redirect-group object in JSON format:

GET /gsadmin/v1/cloud/redirects/redirect-group-name.json, or
GET /gsadmin/v1/cloud/redirects/redirect-group-name

For example, the following endpoint exports configuration of a redirect-group named Default:

GET /gsadmin/v1/cloud/redirects/Default

The following sample illustrates content of the file to which the configuration of the Default redirect-group object is exported; note that the configuration of the two redirect-entry child objects under Default is contained in this same file:

{
  "ecr:type": "redirect-group",
  "id1": {
    "ecr:type": "redirect-entry",
    "searchTerms": "canon",
    "matchmode": "MATCHEXACT",
    "url": "http://www.acme.com/about-us",
    "searchTermExpansions": {
      "0": {"canon": ["canon"]}
    }
  },
  "id2": {
    "ecr:type": "redirect-entry",
    "searchTerms": "contacts",
    "matchmode": "MATCHEXACT",
    "url": "/contact-us",
    "searchTermExpansions": {
      "0": {"contacts": ["contact"]}
    }
  }
}

Note: searchTermExpansions is a system-generated attribute. Do not delete or modify it.

Create the redirect-group object

If no redirect-group object currently exists, you can create one using the POST method. If a redirect-group object currently exists, however, you do not need to create another. One redirect-group object is sufficient for all ordinary purposes.

Use a POST endpoint of the following form to create a redirect-group object, in JSON format or ZIP format:

POST /gsadmin/v1/cloud/redirects/redirect-group-name

The JSON content that configures the redirect-group object can include the configuration of the redirect-entry objects that the redirect-group is to contain; for example, the following content supplied to the POST endpoint above creates a redirect-group object containing two redirect-entry objects, id1 and id2:

{
  "ecr:type": "redirect-group",
  "id1": {
    "ecr:type": "redirect-entry",
    "searchTerms": "canon",
    "matchmode": "MATCHEXACT",
    "url": "http://www.acme.com/about-us",
    "searchTermExpansions": {
      "0": {"canon": ["canon"]}
    }
  },
  "id2": {
    "ecr:type": "redirect-entry",
    "searchTerms": "contacts",
    "matchmode": "MATCHEXACT",
    "url": "/contact-us",
    "searchTermExpansions": {
      "0": {"contacts": ["contact"]}
    }
  }
}

Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices